lib/active_merchant/billing/integrations/helper.rb in activemerchant-1.15.0 vs lib/active_merchant/billing/integrations/helper.rb in activemerchant-1.16.0
- old
+ new
@@ -12,11 +12,11 @@
# Useful for things like the PayPal build notation (BN) id fields
class_attribute :application_id
self.application_id = 'ActiveMerchant'
def initialize(order, account, options = {})
- options.assert_valid_keys([:amount, :currency, :test, :credential2, :credential3, :credential4])
+ options.assert_valid_keys([:amount, :currency, :test, :credential2, :credential3, :credential4, :country, :account_name])
@fields = {}
self.order = order
self.account = account
self.amount = options[:amount]
self.currency = options[:currency]
@@ -62,12 +62,12 @@
code = lookup_country_code(params.delete(:country))
add_field(mappings[key][:country], code)
add_fields(key, params)
end
- def lookup_country_code(name_or_code)
+ def lookup_country_code(name_or_code, format = country_format)
country = Country.find(name_or_code)
- country.code(country_format).to_s
+ country.code(format).to_s
rescue InvalidCountryCodeError
name_or_code
end
def method_missing(method_id, *args)