lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.38.1 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.39.0
- old
+ new
@@ -33,11 +33,11 @@
XSD_VERSION = "1.69"
# visa, master, american_express, discover
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
- self.supported_countries = ['US']
+ self.supported_countries = %w(US BR CA CN DK FI FR DE JP MX NO SE GB SG)
self.default_currency = 'USD'
self.homepage_url = 'http://www.cybersource.com'
self.display_name = 'CyberSource'
# map credit card to the CyberSource expected representation
@@ -399,12 +399,10 @@
xml.tag!('grandTotalAmount', amount(money)) if include_grand_total
end
end
def add_address(xml, payment_method, address, options, shipTo = false)
- requires!(options, :email)
-
xml.tag! shipTo ? 'shipTo' : 'billTo' do
xml.tag! 'firstName', payment_method.first_name if payment_method
xml.tag! 'lastName', payment_method.last_name if payment_method
xml.tag! 'street1', address[:address1]
xml.tag! 'street2', address[:address2] unless address[:address2].blank?
@@ -412,10 +410,10 @@
xml.tag! 'state', address[:state]
xml.tag! 'postalCode', address[:zip]
xml.tag! 'country', address[:country]
xml.tag! 'company', address[:company] unless address[:company].blank?
xml.tag! 'companyTaxID', address[:companyTaxID] unless address[:company_tax_id].blank?
- xml.tag! 'phoneNumber', address[:phone_number] unless address[:phone_number].blank?
+ xml.tag! 'phoneNumber', address[:phone] unless address[:phone].blank?
xml.tag! 'email', options[:email]
xml.tag! 'driversLicenseNumber', options[:drivers_license_number] unless options[:drivers_license_number].blank?
xml.tag! 'driversLicenseState', options[:drivers_license_state] unless options[:drivers_license_state].blank?
end
end