Sha256: 54df7efb4ffef086be8089178ef605d82fe7c2c6b0c8a9d0876c14329945e943
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module FriendlyShipping module Services class Ups class SerializeAddressValidationRequest attr_reader :location REQUEST_ACTION = 'XAV' REQUEST_OPTIONS = { validation: 1, classification: 2, both: 3 }.freeze def self.call(location:) xml_builder = Nokogiri::XML::Builder.new do |xml| xml.AddressValidationRequest do xml.Request do xml.RequestAction REQUEST_ACTION xml.RequestOption REQUEST_OPTIONS[:both] end xml.AddressKeyFormat do xml.AddressLine location.address1 xml.AddressLine location.address2 xml.PoliticalDivision2 location.city xml.PoliticalDivision1 location.region.code xml.PostcodePrimaryLow location.zip xml.CountryCode location.country.code end end end xml_builder.to_xml end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems