81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/offsite_payments/integrations/chronopay.rb', line 81
def billing_address(mapping = {})
country_code = lookup_country_code(mapping.delete(:country))
add_field(mappings[:billing_address][:country], country_code)
countries_with_supported_states = ['USA', 'CAN']
if !countries_with_supported_states.include?(country_code)
mapping.delete(:state)
add_field(mappings[:billing_address][:state], 'XX')
end
mapping.each do |k, v|
field = mappings[:billing_address][k]
add_field(field, v) unless field.nil?
end
add_field('language', checkout_language_from_country(country_code))
end
|