Skip to content

Function build_location() incorrectly process destination set as an array #3

Description

@KoulSlou

Class Ups_Live_Rates has functions for setting destination and origin. These 2 functions are based on the build_location() method. You can pass just zipcode string (for US) or more detailed address in array format.

For zipcode function will return array with 1 element address:

'address' => array( 'state' => FL, 'postal_code' => 32548, 'country_code' => US )

And this array will be correctly transformed to XML for calling UPS API.

But when you pass array to build_location function, address details are not enclosed in 'address' element. Let's say I pass this array to build_location

array( 'state' => OK, 'postal_code' => 33010, 'country_code' => US )

I expect to get

'address' => array( 'state' => OK, 'postal_code' => 33010, 'country_code' => US )

but I get just

array( 'state' => OK, 'postal_code' => 33010, 'country_code' => US )

And it causes error in calling API -"No packages added"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions