Have the USPS shipping driver accept ZIP+4, even if USPS doesn't.
This commit is contained in:
parent
ddf3fa108f
commit
cc0cc0ba64
3 changed files with 58 additions and 4 deletions
|
|
@ -54,9 +54,12 @@ sub buildXML {
|
|||
$xmlTop->{Package} = [];
|
||||
##Do a request for each package.
|
||||
my $packageIndex;
|
||||
my $shipType = $self->get('shipType');
|
||||
my $service = $shipType eq 'PRIORITY VARIABLE' ? 'PRIORITY'
|
||||
: $shipType;
|
||||
my $shipType = $self->get('shipType');
|
||||
my $service = $shipType eq 'PRIORITY VARIABLE'
|
||||
? 'PRIORITY'
|
||||
: $shipType;
|
||||
my $sourceZip = $self->get('sourceZip');
|
||||
$sourceZip =~ s/^(\d{5}).*$/$1/;
|
||||
PACKAGE: for(my $packageIndex = 0; $packageIndex < scalar @packages; $packageIndex++) {
|
||||
my $package = $packages[$packageIndex];
|
||||
next PACKAGE unless scalar @{ $package };
|
||||
|
|
@ -79,6 +82,7 @@ sub buildXML {
|
|||
}
|
||||
my $destination = $package->[0]->getShippingAddress;
|
||||
my $destZipCode = $destination->get('code');
|
||||
$destZipCode =~ s/^(\d{5}).*$/$1/;
|
||||
$packageData{ID} = $packageIndex;
|
||||
$packageData{Service} = [ $service ];
|
||||
$packageData{ZipOrigination} = [ $self->get('sourceZip') ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue