Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Business::FedEx::RateRequest 0.98

    Download button

    No screenshots available
    Downloads: 109  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steve Troxel | More programs
    Perl Artistic License / FREE
    September 8th, 2012, 20:53 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Business::FedEx::RateRequest description

    Perl extension for getting available rates from FedEx using their Web Services API

    Business::FedEx::RateRequest uses a simple XML/POST instead of the slower and more complex Soap based method to obtain available rates between two zip codes for a given package weight and size. At the time of this writing FedEx evidently encourages the use of Soap to get available rates and provides source code examples for Java, PHP, C# but no Perl. FedEx doesn't provide non-Soap XML examples that I could find. Took me a while to develop the XML request but it returns results faster than the PHP Soap method.

    The XML returned is voluminous, over 30k bytes to return a few rates, but is smaller than the comparable Soap results.

    SYNOPSIS

     use Business::FedEx::RateRequest;

     use Data::Dumper;

     # Get your account/meter/key/password numbers from Fedex
     my %rate_args;
     $rate_args{'account'} = '_your_account_number_';
     $rate_args{'meter'} = '_your_meter_number_';
     $rate_args{'key'} = '_your_key_';
     $rate_args{'password'} = '_your_password_';

     $rate_args{'uri'} = 'https://gatewaybeta.fedex.com:443/xml/rate';

     my $Rate = new Business::FedEx::RateRequest(%rate_args);

     my %ship_args;
     $ship_args{'src_zip'} = '83835';
     $ship_args{'dst_zip'} = '55411';
     $ship_args{'weight'} = 5;
     
     # Optional args
     $ship_args{'dst_residential'} = 'true'; # defualt is commercial
     $ship_args{'insured_value'} = 50;
     
     my $rtn = $Rate->get_rates(%ship_args);

     if ( $rtn ) { print Dumper $rtn }
     else { print $Rate->err_msg() }

    Should return something like

     $VAR1 = [
     {
     'ship_cost' => '112.93',
     'ServiceType' => 'FIRST_OVERNIGHT'
     },
     {
     'ship_cost' => '48.91',
     'ServiceType' => 'PRIORITY_OVERNIGHT'
     },
     {
     'ship_cost' => '75.04',
     'ServiceType' => 'STANDARD_OVERNIGHT'
     },
     {
     'ship_cost' => '42.84',
     'ServiceType' => 'FEDEX_2_DAY'
     },
     {
     'ship_cost' => '28.81',
     'ServiceType' => 'FEDEX_EXPRESS_SAVER'
     },
     {
     'ship_cost' => '7.74',
     'ServiceType' => 'FEDEX_GROUND'
     }
     ];



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    FedEx rates | Perl module | Perl | FedEx | rates

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM