lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.67.0 vs lib/active_merchant/billing/gateways/authorize_net.rb in activemerchant-1.68.0
- old
+ new
@@ -141,10 +141,12 @@
return response if response.success?
return response unless options[:force_full_refund_if_unsettled]
if response.params["response_reason_code"] == INELIGIBLE_FOR_ISSUING_CREDIT_ERROR
void(authorization, options)
+ else
+ response
end
end
def void(authorization, options={})
if auth_was_for_cim?(authorization)
@@ -551,15 +553,16 @@
def add_billing_address(xml, payment_source, options)
address = options[:billing_address] || options[:address] || {}
xml.billTo do
first_name, last_name = names_from(payment_source, address, options)
+ full_address = "#{address[:address1]} #{address[:address2]}".strip
+
xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
xml.lastName(truncate(last_name, 50)) unless empty?(last_name)
-
xml.company(truncate(address[:company], 50)) unless empty?(address[:company])
- xml.address(truncate(address[:address1], 60))
+ xml.address(truncate(full_address, 60))
xml.city(truncate(address[:city], 40))
xml.state(empty?(address[:state]) ? 'n/a' : truncate(address[:state], 40))
xml.zip(truncate((address[:zip] || options[:zip]), 20))
xml.country(truncate(address[:country], 60))
xml.phoneNumber(truncate(address[:phone], 25)) unless empty?(address[:phone])
@@ -575,15 +578,15 @@
first_name, last_name = if address[:name]
split_names(address[:name])
else
[address[:first_name], address[:last_name]]
end
+ full_address = "#{address[:address1]} #{address[:address2]}".strip
xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
xml.lastName(truncate(last_name, 50)) unless empty?(last_name)
-
xml.company(truncate(address[:company], 50)) unless empty?(address[:company])
- xml.address(truncate(address[:address1], 60))
+ xml.address(truncate(full_address, 60))
xml.city(truncate(address[:city], 40))
xml.state(truncate(address[:state], 40))
xml.zip(truncate(address[:zip], 20))
xml.country(truncate(address[:country], 60))
end