[ic] bug in Business::UPS for international shipping

Jeff Dafoe interchange-users@icdevgroup.org
Fri Aug 30 16:26:02 2002


    There is a bug in Business::UPS relating to international shipping.  I
know that this affects the XPD shipping mode at a minimum, I don't know if
it affects other modes.
    The problem is that Business::UPS assumes that the UPS server always
returns the total shipping cost in column 11.  This is not a correct
assumption.  When the shipping destination is to certain overseas postal
codes, UPS adds on (substantial) additional charges, in which case column 11
becomes a subtotal and the actual total is reflected in column 13.
    To remedy this I modified UPS.pm as follows:

     else {
       # Good results
       my $total_shipping = $ret[10];
       my $ups_zone = $ret[6];
       return ($total_shipping,$ups_zone,undef);
      }

    to:

     } else {
                       # Good results
                       my $total_shipping=0;
                       if ($#ret>12) {
                               $total_shipping = $ret[12];
                       } else {
                               $total_shipping = $ret[10];
                       }
                       my $ups_zone = $ret[6];
                       return ($total_shipping,$ups_zone,undef);
      }



Jeff