lib/active_merchant/billing/gateways/d_local.rb in activemerchant-1.107.3 vs lib/active_merchant/billing/gateways/d_local.rb in activemerchant-1.107.4
- old
+ new
@@ -91,11 +91,13 @@
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).value
+ def lookup_country_code(country_field)
+ Country.find(country_field).code(:alpha2).value
+ rescue InvalidCountryCodeError
+ nil
end
def add_payer(post, card, options)
address = options[:billing_address] || options[:address]
post[:payer] = {}