Sha256: 9f8e3baeee16e7131ffba546eaaf67075055fa7e37d4d0e1ab2dbc1e8ac7f369
Contents?: true
Size: 1.13 KB
Versions: 35
Compression:
Stored size: 1.13 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.ConsigneeName(location.company_name.presence || location.name) 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
35 entries across 35 versions & 1 rubygems