lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.108.0 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.109.0
- old
+ new
@@ -34,12 +34,12 @@
jcb: 'js',
discover: 'pb',
}.freeze
DEFAULT_COLLECTION_INDICATOR = 2
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :dankort, :maestro, :elo]
- self.supported_countries = %w(US BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB PK)
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb dankort maestro elo]
+ self.supported_countries = %w(US AE BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB PK)
self.default_currency = 'USD'
self.currencies_without_fractions = %w(JPY)
self.homepage_url = 'http://www.cybersource.com'
@@ -602,10 +602,11 @@
add_normalized_threeds_2_data(xml, payment_method, options)
else
indicator = options[:commerce_indicator] || stored_credential_commerce_indicator(options)
xml.tag!('commerceIndicator', indicator) if indicator
end
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
end
end
end
def add_normalized_threeds_2_data(xml, payment_method, options)
@@ -658,25 +659,28 @@
when :visa
xml.tag! 'ccAuthService', {'run' => 'true'} do
xml.tag!('cavv', payment_method.payment_cryptogram)
xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
xml.tag!('xid', payment_method.payment_cryptogram)
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
end
when :master
xml.tag! 'ucaf' do
xml.tag!('authenticationData', payment_method.payment_cryptogram)
xml.tag!('collectionIndicator', DEFAULT_COLLECTION_INDICATOR)
end
xml.tag! 'ccAuthService', {'run' => 'true'} do
xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
end
when :american_express
cryptogram = Base64.decode64(payment_method.payment_cryptogram)
xml.tag! 'ccAuthService', {'run' => 'true'} do
xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
end
end
end
def add_payment_network_token(xml)
@@ -687,18 +691,23 @@
def add_capture_service(xml, request_id, request_token)
xml.tag! 'ccCaptureService', {'run' => 'true'} do
xml.tag! 'authRequestID', request_id
xml.tag! 'authRequestToken', request_token
+ xml.tag! 'reconciliationID', options[:reconciliation_id] if options[:reconciliation_id]
end
end
def add_purchase_service(xml, payment_method, options)
if options[:pinless_debit_card]
- xml.tag! 'pinlessDebitService', {'run' => 'true'}
+ xml.tag! 'pinlessDebitService', {'run' => 'true'} do
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
+ end
else
add_auth_service(xml, payment_method, options)
- xml.tag! 'ccCaptureService', {'run' => 'true'}
+ xml.tag! 'ccCaptureService', {'run' => 'true'} do
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
+ end
end
end
def add_void_service(xml, request_id, request_token)
xml.tag! 'voidService', {'run' => 'true'} do