Skip to content

Commit

Permalink
bug fix: _build_services failing when default services not available
Browse files Browse the repository at this point in the history
  • Loading branch information
pullingshots committed May 25, 2011
1 parent 1f1ee88 commit 7a23eab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Shipment/UPS.pm
Expand Up @@ -43,7 +43,6 @@ It makes extensive use of SOAP::WSDL in order to create/decode xml requests and
use Try::Tiny;
use Moose;
use Moose::Util::TypeConstraints;
use Shipment::SOAP::WSDL;

extends 'Shipment::Base';

Expand Down Expand Up @@ -343,9 +342,9 @@ sub _build_services {
cost => Data::Currency->new($service->get_TotalCharges->get_MonetaryValue, $service->get_TotalCharges->get_CurrencyCode),
);
}
$services{ground} = ($services{'03'}) ? $services{'03'} : $services{'11'};
$services{express} = $services{'02'} if $services{'02'};
$services{priority} = $services{'01'} if $services{'01'};
$services{ground} = $services{'03'} || $services{'11'} || Shipment::Service->new();
$services{express} = $services{'02'} || Shipment::Service->new();
$services{priority} = $services{'01'} || Shipment::Service->new();

if ( $response->get_Response->get_Alert ) {
warn $response->get_Response->get_Alert->get_Description->get_value;
Expand Down

0 comments on commit 7a23eab

Please sign in to comment.