Sha256: 698461ad8993f083296057faa63224e05bd0f585691e45aa3685112cc329da7c

Contents?: true

Size: 639 Bytes

Versions: 37

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  module Services
    class Ups
      class SerializeCityStateLookupRequest
        REQUEST_ACTION = 'AV'

        def self.call(location:)
          xml_builder = Nokogiri::XML::Builder.new do |xml|
            xml.AddressValidationRequest do
              xml.Request do
                xml.RequestAction REQUEST_ACTION
              end
              xml.Address do
                xml.PostalCode location.zip
                xml.CountryCode location.country.code
              end
            end
          end
          xml_builder.to_xml
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
friendly_shipping-0.10.1 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.10.0 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.9.0 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.8.1 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.8.0 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.7.3 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.7.2 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.7.1 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.7.0 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.5 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.4 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.3 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.2 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.1 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.6.0 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.5.3 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.5.2 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.5.1 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.5 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb
friendly_shipping-0.4.14 lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb