lib/active_merchant/billing/gateways/d_local.rb in activemerchant-1.91.0 vs lib/active_merchant/billing/gateways/d_local.rb in activemerchant-1.92.0
- old
+ new
@@ -91,19 +91,19 @@
return unless address = options[:billing_address] || options[:address]
post[:country] = lookup_country_code(address[:country])
end
def lookup_country_code(country)
- Country.find(country).code(:alpha2)
+ Country.find(country).code(:alpha2).value
end
def add_payer(post, card, options)
address = options[:billing_address] || options[:address]
post[:payer] = {}
post[:payer][:name] = card.name
post[:payer][:email] = options[:email] if options[:email]
post[:payer][:birth_date] = options[:birth_date] if options[:birth_date]
- post[:payer][:phone] = address[:phone] if address[:phone]
+ post[:payer][:phone] = address[:phone] if address && address[:phone]
post[:payer][:document] = options[:document] if options[:document]
post[:payer][:document2] = options[:document2] if options[:document2]
post[:payer][:user_reference] = options[:user_reference] if options[:user_reference]
post[:payer][:address] = add_address(post, card, options)
end