[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Using getUPS
Hi,
Has anyone successfully implemented the Business::UPS module with
Interchange? I have the Perl module installed, but I'm getting an error
message when Interchange starts.
Here is my UserTag code that calls Business::UPS::getUPS for real-time
shipping:
UserTag ups-query Order mode origin zip weight country
UserTag ups-query Routine <<EOR
sub {
my( $mode, $origin, $zip, $weight, $country) = @_;
BEGIN {
eval {
require Business::UPS;
import Business::UPS;
};
};
$origin = $::Variable->{UPS_ORIGIN}
if ! $origin;
$country = $::Values->{$::Variable->{UPS_COUNTRY_FIELD}}
if ! $country;
$zip = $::Values->{$::Variable->{UPS_POSTCODE_FIELD}}
if ! $zip;
$country = uc $country;
$country = undef if $country eq 'US';
my ($shipping, $zone, $error) = Business::UPS::getUPS( $mode,
$origin, $zip, $weight, $country);
if($error) {
$Vend::Session->{ship_message} .= " $mode: $error";
return 0;
}
return $shipping;
}
EOR
I'm getting an error saying...
UserTag 'ups_query' subroutine failed safe check: require trapped by
operation mask at (eval 326) line 5, <CONFIG> chunk 359.
In line 359 of the configuration file 'catalog.cfg':
UserTag ups-query Routine <<EOR
Any suggestions?
Ben