pullingshots / Shipment

Perl interface into various shipping web service API's - FedEx, UPS, Purolator, Temando, Canada Post
https://metacpan.org/pod/Shipment
19 stars 19 forks source link

Implicit BillAddress requirement for UPS integration #39

Closed mjaquilina closed 8 years ago

mjaquilina commented 8 years ago

These lines require by inference that a bill_address be provided; otherwise it dies because you can't call the postal_code() method on nothing.

    $payment_option->{$bill_type_map{$self->bill_type}}->{Address}->{PostalCode} = $self->bill_address->postal_code if $self->bill_type =~ /(recipient|third_party)/; 
    $payment_option->{$bill_type_map{$self->bill_type}}->{Address}->{CountryCode} = $self->bill_address->country_code if $self->bill_type eq 'third_party'; 

This should not be required since recipient and third-party billing do not always require a billing address.