[ic] diffs for usps_query.tag for protocol V4

Tom Friedel tom at readyink.com
Sat Mar 31 19:09:40 UTC 2012


Hurry, you only have 9 hours to apply these!!
I use a subset of the protocol so you may need more changes.
tom 

*** usps_query.tag_V2	2012-03-31 12:30:12.000000000 -0400
 --- usps_query.tag	2012-03-31 15:05:49.000000000 -0400
***************
*** 59,65 ****
     my $userid = $opt->{userid} || $::Variable->{USPS_ID};
     my $passwd = $opt->{passwd} || $::Variable->{USPS_PASSWORD};
     my $url = $opt->{url} || $::Variable->{USPS_URL} || 
'http://Production.ShippingAPIs.com/ShippingAPI.dll';
!     my $container = $opt->{container} || $::Variable->{USPS_CONTAINER} || 
'None';
     my $machinable = $opt->{machinable} || $::Variable->{USPS_MACHINABLE} 
|| 'False';

     $service = uc $service;
 --- 59,65 ----
     my $userid = $opt->{userid} || $::Variable->{USPS_ID};
     my $passwd = $opt->{passwd} || $::Variable->{USPS_PASSWORD};
     my $url = $opt->{url} || $::Variable->{USPS_URL} || 
'http://Production.ShippingAPIs.com/ShippingAPI.dll';
!     my $container = $opt->{container} || $::Variable->{USPS_CONTAINER} || 
'';
     my $machinable = $opt->{machinable} || $::Variable->{USPS_MACHINABLE} 
|| 'False';

     $service = uc $service;
***************
*** 144,150 ****
 EOXML
     }
     else {
! 	$xml = qq{API=Rate\&XML=<RateRequest USERID="$userid" 
PASSWORD="$passwd">};
 	$xml .= <<EOXML;
 	<Package ID="0">
 	    <Service>$service</Service>
 --- 144,150 ----
 EOXML
     }
     else {
! 	$xml = qq{API=RateV4\&XML=<RateV4Request USERID="$userid" >};
 	$xml .= <<EOXML;
 	<Package ID="0">
 	    <Service>$service</Service>
***************
*** 156,162 ****
 	    <Size>$size</Size>
 	    <Machinable>$machinable</Machinable>
 	</Package>
! 	</RateRequest>
 EOXML
     }

 --- 156,162 ----
 	    <Size>$size</Size>
 	    <Machinable>$machinable</Machinable>
 	</Package>
! 	</RateV4Request>
 EOXML
     }

***************
*** 174,182 ****
 	$error_msg .= 'Error obtaining rate quote from usps.com.';
     }

 -
 - 	
 -
     if ($resp =~ /<Error>/i) {
 	$resp =~ m|<Description>(.+)</Description>|;
 	$error_msg .=  $1;
 --- 174,179 ----
***************
*** 196,202 ****
 	    }
 	}
 	else {
! 	    $resp =~ m|<Postage>(.+)</Postage>|;
 	    $rate += $1;
 	    undef $error_msg;
 	}
 --- 193,199 ----
 	    }
 	}
 	else {
! 	    $resp =~ m|<Rate>(.+)</Rate>|;
 	    $rate += $1;
 	    undef $error_msg;
 	} 




More information about the interchange-users mailing list