activemerchant 1.107.2 → 1.110.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +73 -0
- data/README.md +3 -3
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +2 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
- data/lib/active_merchant/billing/gateways/adyen.rb +18 -12
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +8 -8
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
- data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
- data/lib/active_merchant/billing/gateways/blue_pay.rb +4 -4
- data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
- data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +84 -35
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/cams.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
- data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
- data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
- data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +4 -4
- data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
- data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
- data/lib/active_merchant/billing/gateways/credorax.rb +7 -3
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
- data/lib/active_merchant/billing/gateways/cyber_source.rb +72 -23
- data/lib/active_merchant/billing/gateways/d_local.rb +24 -8
- data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
- data/lib/active_merchant/billing/gateways/decidir.rb +24 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +6 -4
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
- data/lib/active_merchant/billing/gateways/elavon.rb +56 -9
- data/lib/active_merchant/billing/gateways/element.rb +16 -8
- data/lib/active_merchant/billing/gateways/epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
- data/lib/active_merchant/billing/gateways/exact.rb +3 -3
- data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +5 -5
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +12 -4
- data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
- data/lib/active_merchant/billing/gateways/forte.rb +9 -8
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
- data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +3 -3
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
- data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
- data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
- data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
- data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
- data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/litle.rb +10 -5
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +12 -6
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
- data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/monei.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +3 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +51 -23
- data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
- data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
- data/lib/active_merchant/billing/gateways/omise.rb +1 -1
- data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/opp.rb +2 -2
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +49 -7
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
- data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
- data/lib/active_merchant/billing/gateways/payex.rb +13 -13
- data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -8
- data/lib/active_merchant/billing/gateways/payway.rb +1 -1
- data/lib/active_merchant/billing/gateways/pin.rb +2 -2
- data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
- data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
- data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
- data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +11 -4
- data/lib/active_merchant/billing/gateways/redsys.rb +5 -5
- data/lib/active_merchant/billing/gateways/s5.rb +1 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
- data/lib/active_merchant/billing/gateways/sage.rb +3 -3
- data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +13 -8
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +46 -3
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/telr.rb +4 -4
- data/lib/active_merchant/billing/gateways/tns.rb +1 -1
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
- data/lib/active_merchant/billing/gateways/transax.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
- data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
- data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
- data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
- data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
- data/lib/active_merchant/connection.rb +40 -42
- data/lib/active_merchant/network_connection_retries.rb +10 -12
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/gateway_support.rb +1 -1
- metadata +36 -36
@@ -4,9 +4,9 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
self.test_url = 'https://sandbox.dlocal.com'
|
5
5
|
self.live_url = 'https://api.dlocal.com'
|
6
6
|
|
7
|
-
self.supported_countries = [
|
7
|
+
self.supported_countries = %w[AR BR CL CO MX PE UY TR]
|
8
8
|
self.default_currency = 'USD'
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro naranja cabal]
|
10
10
|
|
11
11
|
self.homepage_url = 'https://dlocal.com/'
|
12
12
|
self.display_name = 'dLocal'
|
@@ -93,8 +93,10 @@ module ActiveMerchant #:nodoc:
|
|
93
93
|
post[:country] = lookup_country_code(address[:country])
|
94
94
|
end
|
95
95
|
|
96
|
-
def lookup_country_code(
|
97
|
-
Country.find(
|
96
|
+
def lookup_country_code(country_field)
|
97
|
+
Country.find(country_field).code(:alpha2).value
|
98
|
+
rescue InvalidCountryCodeError
|
99
|
+
nil
|
98
100
|
end
|
99
101
|
|
100
102
|
def add_payer(post, card, options)
|
@@ -116,12 +118,26 @@ module ActiveMerchant #:nodoc:
|
|
116
118
|
address_object = {}
|
117
119
|
address_object[:state] = address[:state] if address[:state]
|
118
120
|
address_object[:city] = address[:city] if address[:city]
|
119
|
-
address_object[:zip_code] = address[:
|
120
|
-
address_object[:street] = address[:street] if address
|
121
|
-
address_object[:number] = address[:number] if address
|
121
|
+
address_object[:zip_code] = address[:zip] if address[:zip]
|
122
|
+
address_object[:street] = address[:street] || parse_street(address) if parse_street(address)
|
123
|
+
address_object[:number] = address[:number] || parse_house_number(address) if parse_house_number(address)
|
122
124
|
address_object
|
123
125
|
end
|
124
126
|
|
127
|
+
def parse_street(address)
|
128
|
+
return unless address[:address1]
|
129
|
+
|
130
|
+
street = address[:address1].split(/\s+/).keep_if { |x| x !~ /\d/ }.join(' ')
|
131
|
+
street.empty? ? nil : street
|
132
|
+
end
|
133
|
+
|
134
|
+
def parse_house_number(address)
|
135
|
+
return unless address[:address1]
|
136
|
+
|
137
|
+
house = address[:address1].split(/\s+/).keep_if { |x| x =~ /\d/ }.join(' ')
|
138
|
+
house.empty? ? nil : house
|
139
|
+
end
|
140
|
+
|
125
141
|
def add_card(post, card, action, options={})
|
126
142
|
post[:card] = {}
|
127
143
|
post[:card][:holder_name] = card.name
|
@@ -168,7 +184,7 @@ module ActiveMerchant #:nodoc:
|
|
168
184
|
def success_from(action, response)
|
169
185
|
return false unless response['status_code']
|
170
186
|
|
171
|
-
[
|
187
|
+
%w[100 200 400 600].include? response['status_code'].to_s
|
172
188
|
end
|
173
189
|
|
174
190
|
def message_from(action, response)
|
@@ -6,7 +6,7 @@ module ActiveMerchant
|
|
6
6
|
self.default_currency = 'GBP'
|
7
7
|
self.supported_countries = ['GB']
|
8
8
|
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
|
10
10
|
|
11
11
|
self.homepage_url = 'http://www.datacash.com/'
|
12
12
|
self.display_name = 'DataCash'
|
@@ -121,6 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
|
122
122
|
add_invoice(post, money, options)
|
123
123
|
add_payment(post, credit_card, options)
|
124
|
+
add_aggregate_data(post, options) if options[:aggregate_data]
|
124
125
|
end
|
125
126
|
|
126
127
|
def add_payment_method_id(credit_card, options)
|
@@ -180,6 +181,29 @@ module ActiveMerchant #:nodoc:
|
|
180
181
|
post[:card_data] = card_data
|
181
182
|
end
|
182
183
|
|
184
|
+
def add_aggregate_data(post, options)
|
185
|
+
aggregate_data = {}
|
186
|
+
data = options[:aggregate_data]
|
187
|
+
aggregate_data[:indicator] = data[:indicator] if data[:indicator]
|
188
|
+
aggregate_data[:identification_number] = data[:identification_number] if data[:identification_number]
|
189
|
+
aggregate_data[:bill_to_pay] = data[:bill_to_pay] if data[:bill_to_pay]
|
190
|
+
aggregate_data[:bill_to_refund] = data[:bill_to_refund] if data[:bill_to_refund]
|
191
|
+
aggregate_data[:merchant_name] = data[:merchant_name] if data[:merchant_name]
|
192
|
+
aggregate_data[:street] = data[:street] if data[:street]
|
193
|
+
aggregate_data[:number] = data[:number] if data[:number]
|
194
|
+
aggregate_data[:postal_code] = data[:postal_code] if data[:postal_code]
|
195
|
+
aggregate_data[:category] = data[:category] if data[:category]
|
196
|
+
aggregate_data[:channel] = data[:channel] if data[:channel]
|
197
|
+
aggregate_data[:geographic_code] = data[:geographic_code] if data[:geographic_code]
|
198
|
+
aggregate_data[:city] = data[:city] if data[:city]
|
199
|
+
aggregate_data[:merchant_id] = data[:merchant_id] if data[:merchant_id]
|
200
|
+
aggregate_data[:province] = data[:province] if data[:province]
|
201
|
+
aggregate_data[:country] = data[:country] if data[:country]
|
202
|
+
aggregate_data[:merchant_email] = data[:merchant_email] if data[:merchant_email]
|
203
|
+
aggregate_data[:merchant_phone] = data[:merchant_phone] if data[:merchant_phone]
|
204
|
+
post[:aggregate_data] = aggregate_data
|
205
|
+
end
|
206
|
+
|
183
207
|
def add_fraud_detection(options = {})
|
184
208
|
{}.tap do |hsh|
|
185
209
|
hsh[:send_to_cs] = options[:send_to_cs] if valid_fraud_detection_option?(options[:send_to_cs]) # true/false
|
@@ -6,10 +6,10 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.live_url = 'https://api.dibspayment.com/merchant/v1/JSON/Transaction/'
|
8
8
|
|
9
|
-
self.supported_countries = [
|
9
|
+
self.supported_countries = %w[US FI NO SE GB]
|
10
10
|
self.default_currency = 'USD'
|
11
11
|
self.money_format = :cents
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
13
13
|
|
14
14
|
def initialize(options={})
|
15
15
|
requires!(options, :merchant_id, :secret_key)
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
self.supported_countries = ['US']
|
10
10
|
self.default_currency = 'USD'
|
11
|
-
self.supported_cardtypes = [
|
11
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
12
12
|
self.money_format = :cents
|
13
13
|
|
14
14
|
self.homepage_url = 'https://digitzs.com'
|
@@ -235,7 +235,7 @@ module ActiveMerchant #:nodoc:
|
|
235
235
|
|
236
236
|
def authorization_from(response)
|
237
237
|
if customer_id = response.try(:[], 'data').try(:[], 'attributes').try(:[], 'customerId')
|
238
|
-
"#{customer_id}|#{response.try(:[],
|
238
|
+
"#{customer_id}|#{response.try(:[], 'data').try(:[], 'id')}"
|
239
239
|
else
|
240
240
|
response.try(:[], 'data').try(:[], 'id')
|
241
241
|
end
|
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.supported_countries = %w(BR MX CO CL AR PE)
|
8
8
|
self.default_currency = 'USD'
|
9
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club]
|
10
10
|
|
11
11
|
self.homepage_url = 'http://www.ebanx.com/'
|
12
12
|
self.display_name = 'EBANX'
|
@@ -212,6 +212,8 @@ module ActiveMerchant #:nodoc:
|
|
212
212
|
def add_additional_data(post, options)
|
213
213
|
post[:device_id] = options[:device_id] if options[:device_id]
|
214
214
|
post[:metadata] = options[:metadata] if options[:metadata]
|
215
|
+
post[:metadata] = {} if post[:metadata].nil?
|
216
|
+
post[:metadata][:merchant_payment_code] = options[:order_id] if options[:order_id]
|
215
217
|
end
|
216
218
|
|
217
219
|
def parse(body)
|
@@ -235,7 +237,7 @@ module ActiveMerchant #:nodoc:
|
|
235
237
|
end
|
236
238
|
|
237
239
|
def success_from(action, response)
|
238
|
-
if [
|
240
|
+
if %i[purchase capture refund].include?(action)
|
239
241
|
response.try(:[], 'payment').try(:[], 'status') == 'CO'
|
240
242
|
elsif action == :authorize
|
241
243
|
response.try(:[], 'payment').try(:[], 'status') == 'PE'
|
@@ -256,7 +258,7 @@ module ActiveMerchant #:nodoc:
|
|
256
258
|
|
257
259
|
def authorization_from(action, parameters, response)
|
258
260
|
if action == :store
|
259
|
-
"#{response.try(:[],
|
261
|
+
"#{response.try(:[], 'token')}|#{CARD_BRAND[parameters[:payment_type_code].to_sym]}"
|
260
262
|
else
|
261
263
|
response.try(:[], 'payment').try(:[], 'hash')
|
262
264
|
end
|
@@ -276,7 +278,7 @@ module ActiveMerchant #:nodoc:
|
|
276
278
|
end
|
277
279
|
|
278
280
|
def requires_http_get(action)
|
279
|
-
return true if [
|
281
|
+
return true if %i[capture void].include?(action)
|
280
282
|
|
281
283
|
false
|
282
284
|
end
|
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
5
5
|
class EfsnetGateway < Gateway
|
6
6
|
self.supported_countries = ['US']
|
7
|
-
self.supported_cardtypes = [
|
7
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
8
8
|
self.homepage_url = 'http://www.concordefsnet.com/'
|
9
9
|
self.display_name = 'Efsnet'
|
10
10
|
|
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
|
|
53
53
|
|
54
54
|
def void(identification, options = {})
|
55
55
|
requires!(options, :order_id)
|
56
|
-
original_transaction_id,
|
56
|
+
original_transaction_id, = identification.split(';')
|
57
57
|
commit(:void_transaction, {reference_number: format_reference_number(options[:order_id]), transaction_id: original_transaction_id})
|
58
58
|
end
|
59
59
|
|
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
|
13
13
|
self.display_name = 'Elavon MyVirtualMerchant'
|
14
14
|
self.supported_countries = %w(US CA PR DE IE NO PL LU BE NL MX)
|
15
|
-
self.supported_cardtypes = [
|
15
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
16
16
|
self.homepage_url = 'http://www.elavon.com/'
|
17
17
|
|
18
18
|
self.delimiter = "\n"
|
@@ -26,6 +26,7 @@ module ActiveMerchant #:nodoc:
|
|
26
26
|
void: 'CCDELETE',
|
27
27
|
store: 'CCGETTOKEN',
|
28
28
|
update: 'CCUPDATETOKEN',
|
29
|
+
verify: 'CCVERIFY'
|
29
30
|
}
|
30
31
|
|
31
32
|
def initialize(options = {})
|
@@ -47,7 +48,8 @@ module ActiveMerchant #:nodoc:
|
|
47
48
|
add_customer_data(form, options)
|
48
49
|
add_test_mode(form, options)
|
49
50
|
add_ip(form, options)
|
50
|
-
|
51
|
+
add_auth_purchase_params(form, options)
|
52
|
+
add_level_3_fields(form, options) if options[:level_3_data]
|
51
53
|
commit(:purchase, money, form, options)
|
52
54
|
end
|
53
55
|
|
@@ -61,7 +63,8 @@ module ActiveMerchant #:nodoc:
|
|
61
63
|
add_customer_data(form, options)
|
62
64
|
add_test_mode(form, options)
|
63
65
|
add_ip(form, options)
|
64
|
-
|
66
|
+
add_auth_purchase_params(form, options)
|
67
|
+
add_level_3_fields(form, options) if options[:level_3_data]
|
65
68
|
commit(:authorize, money, form, options)
|
66
69
|
end
|
67
70
|
|
@@ -74,6 +77,7 @@ module ActiveMerchant #:nodoc:
|
|
74
77
|
add_invoice(form, options)
|
75
78
|
add_creditcard(form, options[:credit_card])
|
76
79
|
add_currency(form, money, options)
|
80
|
+
add_address(form, options)
|
77
81
|
add_customer_data(form, options)
|
78
82
|
add_test_mode(form, options)
|
79
83
|
else
|
@@ -113,10 +117,12 @@ module ActiveMerchant #:nodoc:
|
|
113
117
|
end
|
114
118
|
|
115
119
|
def verify(credit_card, options = {})
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
+
form = {}
|
121
|
+
add_creditcard(form, credit_card)
|
122
|
+
add_address(form, options)
|
123
|
+
add_test_mode(form, options)
|
124
|
+
add_ip(form, options)
|
125
|
+
commit(:verify, 0, form, options)
|
120
126
|
end
|
121
127
|
|
122
128
|
def store(creditcard, options = {})
|
@@ -251,8 +257,49 @@ module ActiveMerchant #:nodoc:
|
|
251
257
|
form[:cardholder_ip] = options[:ip] if options.has_key?(:ip)
|
252
258
|
end
|
253
259
|
|
254
|
-
def
|
260
|
+
def add_auth_purchase_params(form, options)
|
255
261
|
form[:dynamic_dba] = options[:dba] if options.has_key?(:dba)
|
262
|
+
form[:merchant_initiated_unscheduled] = options[:merchant_initiated_unscheduled] if options.has_key?(:merchant_initiated_unscheduled)
|
263
|
+
end
|
264
|
+
|
265
|
+
def add_level_3_fields(form, options)
|
266
|
+
level_3_data = options[:level_3_data]
|
267
|
+
form[:customer_code] = level_3_data[:customer_code] if level_3_data[:customer_code]
|
268
|
+
form[:salestax] = level_3_data[:salestax] if level_3_data[:salestax]
|
269
|
+
form[:salestax_indicator] = level_3_data[:salestax_indicator] if level_3_data[:salestax_indicator]
|
270
|
+
form[:level3_indicator] = level_3_data[:level3_indicator] if level_3_data[:level3_indicator]
|
271
|
+
form[:ship_to_zip] = level_3_data[:ship_to_zip] if level_3_data[:ship_to_zip]
|
272
|
+
form[:ship_to_country] = level_3_data[:ship_to_country] if level_3_data[:ship_to_country]
|
273
|
+
form[:shipping_amount] = level_3_data[:shipping_amount] if level_3_data[:shipping_amount]
|
274
|
+
form[:ship_from_postal_code] = level_3_data[:ship_from_postal_code] if level_3_data[:ship_from_postal_code]
|
275
|
+
form[:discount_amount] = level_3_data[:discount_amount] if level_3_data[:discount_amount]
|
276
|
+
form[:duty_amount] = level_3_data[:duty_amount] if level_3_data[:duty_amount]
|
277
|
+
form[:national_tax_indicator] = level_3_data[:national_tax_indicator] if level_3_data[:national_tax_indicator]
|
278
|
+
form[:national_tax_amount] = level_3_data[:national_tax_amount] if level_3_data[:national_tax_amount]
|
279
|
+
form[:order_date] = level_3_data[:order_date] if level_3_data[:order_date]
|
280
|
+
form[:other_tax] = level_3_data[:other_tax] if level_3_data[:other_tax]
|
281
|
+
form[:summary_commodity_code] = level_3_data[:summary_commodity_code] if level_3_data[:summary_commodity_code]
|
282
|
+
form[:merchant_vat_number] = level_3_data[:merchant_vat_number] if level_3_data[:merchant_vat_number]
|
283
|
+
form[:customer_vat_number] = level_3_data[:customer_vat_number] if level_3_data[:customer_vat_number]
|
284
|
+
form[:freight_tax_amount] = level_3_data[:freight_tax_amount] if level_3_data[:freight_tax_amount]
|
285
|
+
form[:vat_invoice_number] = level_3_data[:vat_invoice_number] if level_3_data[:vat_invoice_number]
|
286
|
+
form[:tracking_number] = level_3_data[:tracking_number] if level_3_data[:tracking_number]
|
287
|
+
form[:shipping_company] = level_3_data[:shipping_company] if level_3_data[:shipping_company]
|
288
|
+
form[:other_fees] = level_3_data[:other_fees] if level_3_data[:other_fees]
|
289
|
+
add_line_items(form, level_3_data) if level_3_data[:line_items]
|
290
|
+
end
|
291
|
+
|
292
|
+
def add_line_items(form, level_3_data)
|
293
|
+
items = []
|
294
|
+
level_3_data[:line_items].each do |line_item|
|
295
|
+
item = {}
|
296
|
+
line_item.each do |key, value|
|
297
|
+
prefixed_key = "ssl_line_Item_#{key}"
|
298
|
+
item[prefixed_key.to_sym] = value
|
299
|
+
end
|
300
|
+
items << item
|
301
|
+
end
|
302
|
+
form[:LineItemProducts] = { product: items }
|
256
303
|
end
|
257
304
|
|
258
305
|
def message_from(response)
|
@@ -284,7 +331,7 @@ module ActiveMerchant #:nodoc:
|
|
284
331
|
end
|
285
332
|
|
286
333
|
def post_data_string(key, value, options)
|
287
|
-
if custom_field?(key, options)
|
334
|
+
if custom_field?(key, options) || key == :LineItemProducts
|
288
335
|
"#{key}=#{CGI.escape(value.to_s)}"
|
289
336
|
else
|
290
337
|
"ssl_#{key}=#{CGI.escape(value.to_s)}"
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.supported_countries = ['US']
|
11
11
|
self.default_currency = 'USD'
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
13
13
|
|
14
14
|
self.homepage_url = 'http://www.elementps.com'
|
15
15
|
self.display_name = 'Element'
|
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def capture(money, authorization, options={})
|
56
|
-
trans_id,
|
56
|
+
trans_id, = split_authorization(authorization)
|
57
57
|
options[:trans_id] = trans_id
|
58
58
|
|
59
59
|
request = build_soap_request do |xml|
|
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def refund(money, authorization, options={})
|
71
|
-
trans_id,
|
71
|
+
trans_id, = split_authorization(authorization)
|
72
72
|
options[:trans_id] = trans_id
|
73
73
|
|
74
74
|
request = build_soap_request do |xml|
|
@@ -111,10 +111,18 @@ module ActiveMerchant #:nodoc:
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def verify(credit_card, options={})
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
request = build_soap_request do |xml|
|
115
|
+
xml.CreditCardAVSOnly(xmlns: 'https://transaction.elementexpress.com') do
|
116
|
+
add_credentials(xml)
|
117
|
+
add_payment_method(xml, credit_card)
|
118
|
+
add_transaction(xml, 0, options)
|
119
|
+
add_terminal(xml, options)
|
120
|
+
add_address(xml, options)
|
121
|
+
end
|
117
122
|
end
|
123
|
+
|
124
|
+
# send request with the transaction amount set to 0
|
125
|
+
commit('CreditCardAVSOnly', request, 0)
|
118
126
|
end
|
119
127
|
|
120
128
|
def supports_scrubbing?
|
@@ -185,8 +193,8 @@ module ActiveMerchant #:nodoc:
|
|
185
193
|
|
186
194
|
def add_terminal(xml, options)
|
187
195
|
xml.terminal do
|
188
|
-
xml.TerminalID '01'
|
189
|
-
xml.CardPresentCode 'UseDefault'
|
196
|
+
xml.TerminalID options[:terminal_id] || '01'
|
197
|
+
xml.CardPresentCode options[:card_present_code] || 'UseDefault'
|
190
198
|
xml.CardholderPresentCode 'UseDefault'
|
191
199
|
xml.CardInputCode 'UseDefault'
|
192
200
|
xml.CVVPresenceCode 'UseDefault'
|
@@ -5,9 +5,9 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
|
6
6
|
self.default_currency = 'DKK'
|
7
7
|
self.money_format = :cents
|
8
|
-
self.
|
9
|
-
|
10
|
-
|
8
|
+
self.supported_countries = %w[DK SE NO]
|
9
|
+
self.supported_cardtypes = %i[dankort forbrugsforeningen visa master
|
10
|
+
american_express diners_club jcb maestro]
|
11
11
|
self.homepage_url = 'http://epay.dk/'
|
12
12
|
self.display_name = 'ePay'
|
13
13
|
|
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
self.live_url = 'https://secure.evoepay.com/api/transact.php'
|
37
37
|
|
38
38
|
self.supported_countries = ['CA']
|
39
|
-
self.supported_cardtypes = [
|
39
|
+
self.supported_cardtypes = %i[visa master american_express jcb discover]
|
40
40
|
self.money_format = :dollars
|
41
41
|
self.homepage_url = 'http://www.evocanada.com/'
|
42
42
|
self.display_name = 'EVO Canada'
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.money_format = :cents
|
11
11
|
self.supported_countries = ['AU']
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express diners_club]
|
13
13
|
self.homepage_url = 'http://www.eway.com.au/'
|
14
14
|
self.display_name = 'eWAY'
|
15
15
|
|
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.live_url = 'https://api.ewaypayments.com/'
|
8
8
|
|
9
9
|
self.money_format = :cents
|
10
|
-
self.supported_countries = [
|
11
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_countries = %w[AU NZ GB SG MY HK]
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club jcb]
|
12
12
|
self.homepage_url = 'http://www.eway.com.au/'
|
13
13
|
self.display_name = 'eWAY Rapid 3.1'
|
14
14
|
self.default_currency = 'AUD'
|
@@ -28,10 +28,10 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
|
29
29
|
SUCCESS = 'true'
|
30
30
|
|
31
|
-
SENSITIVE_FIELDS = [
|
31
|
+
SENSITIVE_FIELDS = %i[verification_str2 expiry_date card_number]
|
32
32
|
|
33
|
-
self.
|
34
|
-
self.
|
33
|
+
self.supported_countries = %w[CA US]
|
34
|
+
self.supported_cardtypes = %i[visa master american_express jcb discover]
|
35
35
|
self.homepage_url = 'http://www.e-xact.com'
|
36
36
|
self.display_name = 'E-xact'
|
37
37
|
|