lib/friendly_shipping/services/ups.rb
# Find city and state for a given ZIP code
# @param [Physical::Location] location A location object with country and ZIP code set
# @return [Result<ApiResult<Array<Physical::Location>>>] The response data from UPS encoded in a
#   `Physical::Location` object. Country, City and ZIP code will be set, everything else nil.
Find city and state for a given ZIP code
Find city and state for a given ZIP code
def city_state_lookup(location, debug: false)
        city_state_lookup_request_xml = SerializeCityStateLookupRequest.call(location: location)
        url = base_url + RESOURCES[:city_state_lookup]
        request = FriendlyShipping::Request.new(
          url: url,
          body: access_request_xml + city_state_lookup_request_xml,
          readable_body: city_state_lookup_request_xml,
          debug: debug
        )
        client.post(request).bind do |response|
          ParseCityStateLookupResponse.call(response: response, request: request, location: location)
        end
      end
def city_state_lookup ( location , debug : false ) city_state_lookup_request_xml = SerializeCityStateLookupRequest . call ( location : location ) url = base_url + RESOURCES [ :city_state_lookup ] request = FriendlyShipping :: Request . new ( url : url , body : access_request_xml + city_state_lookup_request_xml , readable_body : city_state_lookup_request_xml , debug : debug ) client . post ( request ) . bind do | response | ParseCityStateLookupResponse . call ( response : response , request : request , location : location ) end end
Find city and state for a given ZIP code
Find city and state for a given ZIP code
The response data from UPS encoded in a `Physical::Location` object. Country, City and ZIP code will be set, everything else nil.
The response data from UPS encoded in a ` Physical :: Location ` object . Country City and ZIP code will be set everything else nil .
Result<ApiResult<Array<Physical::Location>>>
location
<not_specific>
debug
<not_specific>
<not_specific>
location A location object with country and ZIP code set
location A location object with country and ZIP code set