[ic] FedEx interface in catalog.cfg

Chet Pressler chet@pressler.com
Wed, 28 Feb 2001 11:12:09 -0800


I have added this to my catalog.cfg to test out the fedex interface.

UserTag  fedex-query  Order  mode weight
UserTag  fedex-query  attrAlias origin_zip origin
UserTag  fedex-query  Routine <<EOR
sub {
   require Business:Fedex;
   my( $mode, $weight, $opt) = @_;
   my $fedex = new Business::Fedex (
         orig_country => 'US', # ISO code
         orig_zip => '89052',
         dest_country => 'US',
         dest_zip => '95054',
         weight=> '26',
         );
   $fedex->packaging('My Packaging'); #  your packaging
::logGlobal("calling with: " . join("|", $mode, $weight, ));
   my $rate = $fedex->getrate; # dies on error
     my %fe_index =(
         'FPO' ,0,
         'FSO' ,1,
         'F2D' ,2,
         'FES' ,3,
         );

   my $index = $fe_index{$mode};
   my @myar = $fedex->services;
   my $therate = $myar[$index]->{total};
    return $therate;
}
EOR



When I restart interchange I am receiving this error in the log.

- - - [28/February/2001:10:32:14 -0800] - - ...UI is loaded....
- - - [28/February/2001:10:32:14 -0800] - - Interchange V4.6.3
- - - [28/February/2001:10:32:14 -0800] - - Using default DBM database.
- - - [28/February/2001:10:32:17 -0800] - - Using MySQL, 
DSN=dbi:mysql:test_psg.
- - - [28/February/2001:10:32:18 -0800] - - UserTag 'fedex_query' 
subroutine failed safe check: require trapped by operation mask at (eval 
317) line 2, <CONFIG> chunk 375.
 >
 > In line 375 of the configuration file 'catalog.cfg':
 > UserTag  fedex-query  Routine <<EOR

What are we missing here?