activemerchant 1.113.0 → 1.119.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +114 -0
- data/README.md +1 -1
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/avs_result.rb +1 -1
- data/lib/active_merchant/billing/compatibility.rb +3 -3
- data/lib/active_merchant/billing/credit_card.rb +3 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +72 -13
- data/lib/active_merchant/billing/gateways/adyen.rb +24 -14
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +44 -12
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
- data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
- data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
- data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
- data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
- data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
- data/lib/active_merchant/billing/gateways/blue_snap.rb +37 -12
- data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
- data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
- data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +13 -10
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/cams.rb +8 -8
- 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 +2 -2
- data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
- data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
- data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
- data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
- data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
- data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
- data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
- data/lib/active_merchant/billing/gateways/credorax.rb +26 -15
- data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
- data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
- data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -36
- data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
- data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
- data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
- data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
- data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
- data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
- data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
- data/lib/active_merchant/billing/gateways/elavon.rb +286 -225
- data/lib/active_merchant/billing/gateways/element.rb +8 -8
- data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
- data/lib/active_merchant/billing/gateways/eway.rb +3 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
- data/lib/active_merchant/billing/gateways/exact.rb +8 -9
- data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
- data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
- data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +14 -8
- data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
- data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
- data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
- data/lib/active_merchant/billing/gateways/hps.rb +17 -8
- data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
- data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
- data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
- data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
- data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
- data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
- data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
- data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
- data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
- data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
- data/lib/active_merchant/billing/gateways/litle.rb +31 -15
- data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
- data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
- data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
- data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
- data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
- data/lib/active_merchant/billing/gateways/migs.rb +3 -4
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
- data/lib/active_merchant/billing/gateways/monei.rb +7 -7
- data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
- data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
- data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
- data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
- data/lib/active_merchant/billing/gateways/netbanx.rb +19 -8
- data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
- data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
- data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
- data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
- data/lib/active_merchant/billing/gateways/omise.rb +13 -13
- data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
- data/lib/active_merchant/billing/gateways/opp.rb +9 -9
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
- data/lib/active_merchant/billing/gateways/orbital.rb +196 -85
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
- data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
- data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
- data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
- data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
- data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
- data/lib/active_merchant/billing/gateways/payeezy.rb +32 -14
- data/lib/active_merchant/billing/gateways/payex.rb +6 -7
- data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
- data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
- data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
- data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
- data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
- data/lib/active_merchant/billing/gateways/payway.rb +8 -9
- data/lib/active_merchant/billing/gateways/pin.rb +11 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
- data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +86 -5
- data/lib/active_merchant/billing/gateways/s5.rb +7 -7
- data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
- data/lib/active_merchant/billing/gateways/sage.rb +3 -5
- data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
- data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
- data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
- data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +10 -10
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
- data/lib/active_merchant/billing/gateways/telr.rb +8 -8
- data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
- data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
- data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
- data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +19 -11
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
- data/lib/active_merchant/billing/response.rb +3 -2
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +2 -2
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +2 -2
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
|
|
204
204
|
perform_reference_credit(money, reference, options)
|
205
205
|
end
|
206
206
|
|
207
|
-
def verify(credit_card, options={})
|
207
|
+
def verify(credit_card, options = {})
|
208
208
|
MultiResponse.run(:use_first_response) do |r|
|
209
209
|
r.process { authorize(100, credit_card, options) }
|
210
210
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -432,9 +432,9 @@ module ActiveMerchant #:nodoc:
|
|
432
432
|
raise "Unknown signature algorithm #{algorithm}"
|
433
433
|
end
|
434
434
|
|
435
|
-
filtered_params = signed_parameters.select { |
|
435
|
+
filtered_params = signed_parameters.select { |_k, v| !v.blank? }
|
436
436
|
sha_encryptor.hexdigest(
|
437
|
-
filtered_params.sort_by { |k,
|
437
|
+
filtered_params.sort_by { |k, _v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
|
438
438
|
).upcase
|
439
439
|
end
|
440
440
|
|
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
46
46
|
# * <tt>:api_version</tt> -- Omise's API Version (OPTIONAL), default version is '2014-07-27'
|
47
47
|
# See version at page https://dashboard.omise.co/api-version/edit
|
48
48
|
|
49
|
-
def initialize(options={})
|
49
|
+
def initialize(options = {})
|
50
50
|
requires!(options, :public_key, :secret_key)
|
51
51
|
@public_key = options[:public_key]
|
52
52
|
@secret_key = options[:secret_key]
|
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
|
|
79
79
|
#
|
80
80
|
# purchase(money, nil, { :customer_id => customer_id })
|
81
81
|
|
82
|
-
def purchase(money, payment_method, options={})
|
82
|
+
def purchase(money, payment_method, options = {})
|
83
83
|
create_charge(money, payment_method, options)
|
84
84
|
end
|
85
85
|
|
@@ -91,7 +91,7 @@ module ActiveMerchant #:nodoc:
|
|
91
91
|
# * <tt>payment_method</tt> -- The CreditCard object
|
92
92
|
# * <tt>options</tt> -- An optional parameters, such as token or capture
|
93
93
|
|
94
|
-
def authorize(money, payment_method, options={})
|
94
|
+
def authorize(money, payment_method, options = {})
|
95
95
|
options[:capture] = 'false'
|
96
96
|
create_charge(money, payment_method, options)
|
97
97
|
end
|
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
|
|
104
104
|
# * <tt>charge_id</tt> -- The CreditCard object
|
105
105
|
# * <tt>options</tt> -- An optional parameters, such as token or capture
|
106
106
|
|
107
|
-
def capture(money, charge_id, options={})
|
107
|
+
def capture(money, charge_id, options = {})
|
108
108
|
post = {}
|
109
109
|
add_amount(post, money, options)
|
110
110
|
commit(:post, "charges/#{CGI.escape(charge_id)}/capture", post, options)
|
@@ -118,7 +118,7 @@ module ActiveMerchant #:nodoc:
|
|
118
118
|
# * <tt>charge_id</tt> -- The CreditCard object
|
119
119
|
# * <tt>options</tt> -- An optional parameters, such as token or capture
|
120
120
|
|
121
|
-
def refund(money, charge_id, options={})
|
121
|
+
def refund(money, charge_id, options = {})
|
122
122
|
options[:amount] = money if money
|
123
123
|
commit(:post, "charges/#{CGI.escape(charge_id)}/refunds", options)
|
124
124
|
end
|
@@ -132,7 +132,7 @@ module ActiveMerchant #:nodoc:
|
|
132
132
|
# 'email' (A customer email)
|
133
133
|
# 'description' (A customer description)
|
134
134
|
|
135
|
-
def store(payment_method, options={})
|
135
|
+
def store(payment_method, options = {})
|
136
136
|
post, card_params = {}, {}
|
137
137
|
add_customer_data(post, options)
|
138
138
|
add_token(card_params, payment_method, options)
|
@@ -145,7 +145,7 @@ module ActiveMerchant #:nodoc:
|
|
145
145
|
#
|
146
146
|
# * <tt>customer_id</tt> -- The Customer identifier (REQUIRED).
|
147
147
|
|
148
|
-
def unstore(customer_id, options={})
|
148
|
+
def unstore(customer_id, options = {})
|
149
149
|
commit(:delete, "customers/#{CGI.escape(customer_id)}")
|
150
150
|
end
|
151
151
|
|
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
|
|
178
178
|
commit(:post, 'charges', post, options)
|
179
179
|
end
|
180
180
|
|
181
|
-
def headers(options={})
|
181
|
+
def headers(options = {})
|
182
182
|
key = options[:key] || @secret_key
|
183
183
|
{
|
184
184
|
'Content-Type' => 'application/json;utf-8',
|
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
|
|
197
197
|
parameters.present? ? parameters.to_json : nil
|
198
198
|
end
|
199
199
|
|
200
|
-
def https_request(method, endpoint, parameters=nil, options={})
|
200
|
+
def https_request(method, endpoint, parameters = nil, options = {})
|
201
201
|
raw_response = response = nil
|
202
202
|
begin
|
203
203
|
raw_response = ssl_request(method, url_for(endpoint), post_data(parameters), headers(options))
|
@@ -221,7 +221,7 @@ module ActiveMerchant #:nodoc:
|
|
221
221
|
{ message: msg }
|
222
222
|
end
|
223
223
|
|
224
|
-
def commit(method, endpoint, params=nil, options={})
|
224
|
+
def commit(method, endpoint, params = nil, options = {})
|
225
225
|
response = https_request(method, endpoint, params, options)
|
226
226
|
Response.new(
|
227
227
|
successful?(response),
|
@@ -284,7 +284,7 @@ module ActiveMerchant #:nodoc:
|
|
284
284
|
commit(:post, 'tokens', post, { key: @public_key })
|
285
285
|
end
|
286
286
|
|
287
|
-
def add_token(post, credit_card, options={})
|
287
|
+
def add_token(post, credit_card, options = {})
|
288
288
|
if options[:token_id].present?
|
289
289
|
post[:card] = options[:token_id]
|
290
290
|
else
|
@@ -304,11 +304,11 @@ module ActiveMerchant #:nodoc:
|
|
304
304
|
post[:card] = card
|
305
305
|
end
|
306
306
|
|
307
|
-
def add_customer(post, options={})
|
307
|
+
def add_customer(post, options = {})
|
308
308
|
post[:customer] = options[:customer_id] if options[:customer_id]
|
309
309
|
end
|
310
310
|
|
311
|
-
def add_customer_data(post, options={})
|
311
|
+
def add_customer_data(post, options = {})
|
312
312
|
post[:description] = options[:description] if options[:description]
|
313
313
|
post[:email] = options[:email] if options[:email]
|
314
314
|
end
|
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
|
|
116
116
|
post[:device_session_id] = options[:device_session_id]
|
117
117
|
post[:currency] = (options[:currency] || currency(money)).upcase
|
118
118
|
post[:use_card_points] = options[:use_card_points] if options[:use_card_points]
|
119
|
-
post[:payment_plan] = {payments: options[:payments]} if options[:payments]
|
119
|
+
post[:payment_plan] = { payments: options[:payments] } if options[:payments]
|
120
120
|
add_creditcard(post, creditcard, options)
|
121
121
|
post
|
122
122
|
end
|
@@ -188,11 +188,10 @@ module ActiveMerchant #:nodoc:
|
|
188
188
|
(success ? response['error_code'] : response['description']),
|
189
189
|
response,
|
190
190
|
test: test?,
|
191
|
-
authorization: response['id']
|
192
|
-
)
|
191
|
+
authorization: response['id'])
|
193
192
|
end
|
194
193
|
|
195
|
-
def http_request(method, resource, parameters={}, options={})
|
194
|
+
def http_request(method, resource, parameters = {}, options = {})
|
196
195
|
url = (test? ? self.test_url : self.live_url) + @merchant_id + '/' + resource
|
197
196
|
raw_response = nil
|
198
197
|
begin
|
@@ -117,39 +117,39 @@ module ActiveMerchant #:nodoc:
|
|
117
117
|
self.homepage_url = 'https://docs.oppwa.com'
|
118
118
|
self.display_name = 'Open Payment Platform'
|
119
119
|
|
120
|
-
def initialize(options={})
|
120
|
+
def initialize(options = {})
|
121
121
|
requires!(options, :access_token, :entity_id)
|
122
122
|
super
|
123
123
|
end
|
124
124
|
|
125
|
-
def purchase(money, payment, options={})
|
125
|
+
def purchase(money, payment, options = {})
|
126
126
|
# debit
|
127
127
|
options[:registrationId] = payment if payment.is_a?(String)
|
128
128
|
execute_dbpa(options[:risk_workflow] ? 'PA.CP' : 'DB',
|
129
129
|
money, payment, options)
|
130
130
|
end
|
131
131
|
|
132
|
-
def authorize(money, payment, options={})
|
132
|
+
def authorize(money, payment, options = {})
|
133
133
|
# preauthorization PA
|
134
134
|
execute_dbpa('PA', money, payment, options)
|
135
135
|
end
|
136
136
|
|
137
|
-
def capture(money, authorization, options={})
|
137
|
+
def capture(money, authorization, options = {})
|
138
138
|
# capture CP
|
139
139
|
execute_referencing('CP', money, authorization, options)
|
140
140
|
end
|
141
141
|
|
142
|
-
def refund(money, authorization, options={})
|
142
|
+
def refund(money, authorization, options = {})
|
143
143
|
# refund RF
|
144
144
|
execute_referencing('RF', money, authorization, options)
|
145
145
|
end
|
146
146
|
|
147
|
-
def void(authorization, options={})
|
147
|
+
def void(authorization, options = {})
|
148
148
|
# reversal RV
|
149
149
|
execute_referencing('RV', nil, authorization, options)
|
150
150
|
end
|
151
151
|
|
152
|
-
def verify(credit_card, options={})
|
152
|
+
def verify(credit_card, options = {})
|
153
153
|
MultiResponse.run(:use_first_response) do |r|
|
154
154
|
r.process { authorize(100, credit_card, options) }
|
155
155
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -287,7 +287,7 @@ module ActiveMerchant #:nodoc:
|
|
287
287
|
def add_options(post, options)
|
288
288
|
post[:createRegistration] = options[:create_registration] if options[:create_registration] && !options[:registrationId]
|
289
289
|
post[:testMode] = options[:test_mode] if test? && options[:test_mode]
|
290
|
-
options.each { |key, value| post[key] = value if key.to_s
|
290
|
+
options.each { |key, value| post[key] = value if key.to_s =~ /'customParameters\[[a-zA-Z0-9\._]{3,64}\]'/ }
|
291
291
|
post['customParameters[SHOPPER_pluginId]'] = 'activemerchant'
|
292
292
|
post['customParameters[custom_disable3DSecure]'] = options[:disable_3d_secure] if options[:disable_3d_secure]
|
293
293
|
end
|
@@ -349,7 +349,7 @@ module ActiveMerchant #:nodoc:
|
|
349
349
|
|
350
350
|
def json_error(body)
|
351
351
|
message = "Invalid response received #{body.inspect}"
|
352
|
-
{ 'result' => {'description' => message, 'code' => 'unknown' } }
|
352
|
+
{ 'result' => { 'description' => message, 'code' => 'unknown' } }
|
353
353
|
end
|
354
354
|
|
355
355
|
def success_from(response)
|
@@ -125,8 +125,7 @@ module ActiveMerchant #:nodoc:
|
|
125
125
|
test: test?,
|
126
126
|
authorization: authorization_from(response),
|
127
127
|
avs_result: { code: avs_result_from(response) },
|
128
|
-
cvv_result: cvv_result_from(response)
|
129
|
-
)
|
128
|
+
cvv_result: cvv_result_from(response))
|
130
129
|
end
|
131
130
|
|
132
131
|
# The upstream is picky and so we can't use CGI.escape like we want to
|
@@ -257,7 +256,7 @@ module ActiveMerchant #:nodoc:
|
|
257
256
|
def schema
|
258
257
|
{ 'xmlns' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1',
|
259
258
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
260
|
-
'xsi:schemaLocation' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1'}
|
259
|
+
'xsi:schemaLocation' => 'http://www.optimalpayments.com/creditcard/xmlschema/v1' }
|
261
260
|
end
|
262
261
|
|
263
262
|
def build_merchant_account(xml)
|
@@ -30,11 +30,11 @@ module ActiveMerchant #:nodoc:
|
|
30
30
|
class OrbitalGateway < Gateway
|
31
31
|
include Empty
|
32
32
|
|
33
|
-
API_VERSION = '
|
33
|
+
API_VERSION = '8.1'
|
34
34
|
|
35
35
|
POST_HEADERS = {
|
36
36
|
'MIME-Version' => '1.1',
|
37
|
-
'Content-Type' => "application/PTI#{API_VERSION.
|
37
|
+
'Content-Type' => "application/PTI#{API_VERSION.delete('.')}",
|
38
38
|
'Content-transfer-encoding' => 'text',
|
39
39
|
'Request-number' => '1',
|
40
40
|
'Document-type' => 'Request',
|
@@ -60,7 +60,8 @@ module ActiveMerchant #:nodoc:
|
|
60
60
|
'93', # Approved high fraud
|
61
61
|
'94', # Approved fraud service unavailable
|
62
62
|
'E7', # Stored
|
63
|
-
'PA'
|
63
|
+
'PA', # Partial approval
|
64
|
+
'P1' # ECP - AVS - Account Status Verification and/or AOA data is in a positive status.
|
64
65
|
]
|
65
66
|
|
66
67
|
class_attribute :secondary_test_url, :secondary_live_url
|
@@ -183,6 +184,37 @@ module ActiveMerchant #:nodoc:
|
|
183
184
|
|
184
185
|
SENSITIVE_FIELDS = %i[account_num cc_account_num]
|
185
186
|
|
187
|
+
# Bank account types to be used for check processing
|
188
|
+
ACCOUNT_TYPE = {
|
189
|
+
'savings' => 'S',
|
190
|
+
'checking' => 'C'
|
191
|
+
}
|
192
|
+
|
193
|
+
# Fixed possible values for orbital ECP attributes
|
194
|
+
# Auth methods for electronic checks can be:
|
195
|
+
# Written, Internet, Telephonic, Account Receivable, Point of Purchase.
|
196
|
+
# Default auth method for ECP is Internet (I).
|
197
|
+
# Bank payment delivery can be either ACH (Automated Clearing House) or Best Possible.
|
198
|
+
# Default Bank Payment Delivery is Best Possible (B).
|
199
|
+
# Action codes to be used for Early Warning System and additional validations.
|
200
|
+
# Valid combinations of Message Type and Action Code to be used are:
|
201
|
+
# A W1
|
202
|
+
# AC W1
|
203
|
+
# FC W4
|
204
|
+
# R W6
|
205
|
+
# FC W8
|
206
|
+
# A W3
|
207
|
+
# AC W3
|
208
|
+
# FC W5
|
209
|
+
# R W7
|
210
|
+
# Default Action code for ECP is nil.
|
211
|
+
# Electronic check to be processed on same day (Y) or next day (N).
|
212
|
+
# Default ECP Same Day Index is Yes (Y).
|
213
|
+
ECP_AUTH_METHODS = %w[W I T A P]
|
214
|
+
ECP_BANK_PAYMENT = %w[A B]
|
215
|
+
ECP_ACTION_CODES = %w[LO ND NC W1 W3 W4 W5 W6 W7 W8 W9]
|
216
|
+
ECP_SAME_DAY = %w[Y N]
|
217
|
+
|
186
218
|
def initialize(options = {})
|
187
219
|
requires!(options, :merchant_id)
|
188
220
|
requires!(options, :login, :password) unless options[:ip_authentication]
|
@@ -191,12 +223,12 @@ module ActiveMerchant #:nodoc:
|
|
191
223
|
end
|
192
224
|
|
193
225
|
# A – Authorization request
|
194
|
-
def authorize(money,
|
195
|
-
order = build_new_order_xml(AUTH_ONLY, money,
|
196
|
-
|
197
|
-
add_address(xml,
|
226
|
+
def authorize(money, payment_source, options = {})
|
227
|
+
order = build_new_order_xml(AUTH_ONLY, money, payment_source, options) do |xml|
|
228
|
+
add_payment_source(xml, payment_source, options)
|
229
|
+
add_address(xml, payment_source, options)
|
198
230
|
if @options[:customer_profiles]
|
199
|
-
add_customer_data(xml,
|
231
|
+
add_customer_data(xml, payment_source, options)
|
200
232
|
add_managed_billing(xml, options)
|
201
233
|
end
|
202
234
|
end
|
@@ -211,12 +243,12 @@ module ActiveMerchant #:nodoc:
|
|
211
243
|
end
|
212
244
|
|
213
245
|
# AC – Authorization and Capture
|
214
|
-
def purchase(money,
|
215
|
-
order = build_new_order_xml(AUTH_AND_CAPTURE, money,
|
216
|
-
|
217
|
-
add_address(xml,
|
246
|
+
def purchase(money, payment_source, options = {})
|
247
|
+
order = build_new_order_xml(options[:force_capture] ? FORCE_AUTH_AND_CAPTURE : AUTH_AND_CAPTURE, money, payment_source, options) do |xml|
|
248
|
+
add_payment_source(xml, payment_source, options)
|
249
|
+
add_address(xml, payment_source, options)
|
218
250
|
if @options[:customer_profiles]
|
219
|
-
add_customer_data(xml,
|
251
|
+
add_customer_data(xml, payment_source, options)
|
220
252
|
add_managed_billing(xml, options)
|
221
253
|
end
|
222
254
|
end
|
@@ -237,7 +269,7 @@ module ActiveMerchant #:nodoc:
|
|
237
269
|
commit(order, :refund, options[:trace_number])
|
238
270
|
end
|
239
271
|
|
240
|
-
def credit(money, authorization, options= {})
|
272
|
+
def credit(money, authorization, options = {})
|
241
273
|
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
242
274
|
refund(money, authorization, options)
|
243
275
|
end
|
@@ -286,13 +318,13 @@ module ActiveMerchant #:nodoc:
|
|
286
318
|
end
|
287
319
|
|
288
320
|
def retrieve_customer_profile(customer_ref_num)
|
289
|
-
options = {customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num}
|
321
|
+
options = { customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num }
|
290
322
|
order = build_customer_request_xml(nil, options)
|
291
323
|
commit(order, :retrieve_customer_profile)
|
292
324
|
end
|
293
325
|
|
294
326
|
def delete_customer_profile(customer_ref_num)
|
295
|
-
options = {customer_profile_action: DELETE, customer_ref_num: customer_ref_num}
|
327
|
+
options = { customer_profile_action: DELETE, customer_ref_num: customer_ref_num }
|
296
328
|
order = build_customer_request_xml(nil, options)
|
297
329
|
commit(order, :delete_customer_profile)
|
298
330
|
end
|
@@ -310,7 +342,8 @@ module ActiveMerchant #:nodoc:
|
|
310
342
|
gsub(%r((<CCAccountNum>).+(</CC)), '\1[FILTERED]\2').
|
311
343
|
gsub(%r((<CardSecVal>).+(</CardSecVal>)), '\1[FILTERED]\2').
|
312
344
|
gsub(%r((<MerchantID>).+(</MerchantID>)), '\1[FILTERED]\2').
|
313
|
-
gsub(%r((<CustomerMerchantID>).+(</CustomerMerchantID>)), '\1[FILTERED]\2')
|
345
|
+
gsub(%r((<CustomerMerchantID>).+(</CustomerMerchantID>)), '\1[FILTERED]\2').
|
346
|
+
gsub(%r((<CustomerProfileMessage>).+(</CustomerProfileMessage>)), '\1[FILTERED]\2')
|
314
347
|
end
|
315
348
|
|
316
349
|
private
|
@@ -355,61 +388,61 @@ module ActiveMerchant #:nodoc:
|
|
355
388
|
xml.tag! :SDMerchantEmail, soft_desc[:merchant_email] || nil
|
356
389
|
end
|
357
390
|
|
358
|
-
def
|
359
|
-
if (
|
360
|
-
xml.tag! :TaxInd,
|
361
|
-
xml.tag! :Tax,
|
391
|
+
def add_level2_tax(xml, options = {})
|
392
|
+
if (level2 = options[:level_2_data])
|
393
|
+
xml.tag! :TaxInd, level2[:tax_indicator] if [TAX_NOT_PROVIDED, TAX_INCLUDED, NON_TAXABLE_TRANSACTION].include?(level2[:tax_indicator].to_i)
|
394
|
+
xml.tag! :Tax, level2[:tax].to_i if level2[:tax]
|
362
395
|
end
|
363
396
|
end
|
364
397
|
|
365
|
-
def
|
366
|
-
if (
|
367
|
-
xml.tag! :PC3VATtaxAmt, byte_limit(
|
368
|
-
xml.tag! :PC3AltTaxAmt, byte_limit(
|
369
|
-
xml.tag! :PC3VATtaxRate, byte_limit(
|
370
|
-
xml.tag! :PC3AltTaxInd, byte_limit(
|
398
|
+
def add_level3_tax(xml, options = {})
|
399
|
+
if (level3 = options[:level_3_data])
|
400
|
+
xml.tag! :PC3VATtaxAmt, byte_limit(level3[:vat_tax], 12) if level3[:vat_tax]
|
401
|
+
xml.tag! :PC3AltTaxAmt, byte_limit(level3[:alt_tax], 9) if level3[:alt_tax]
|
402
|
+
xml.tag! :PC3VATtaxRate, byte_limit(level3[:vat_rate], 4) if level3[:vat_rate]
|
403
|
+
xml.tag! :PC3AltTaxInd, byte_limit(level3[:alt_ind], 15) if level3[:alt_ind]
|
371
404
|
end
|
372
405
|
end
|
373
406
|
|
374
|
-
def
|
375
|
-
if (
|
376
|
-
xml.tag! :AMEXTranAdvAddn1, byte_limit(
|
377
|
-
xml.tag! :AMEXTranAdvAddn2, byte_limit(
|
378
|
-
xml.tag! :AMEXTranAdvAddn3, byte_limit(
|
379
|
-
xml.tag! :AMEXTranAdvAddn4, byte_limit(
|
407
|
+
def add_level2_advice_addendum(xml, options = {})
|
408
|
+
if (level2 = options[:level_2_data])
|
409
|
+
xml.tag! :AMEXTranAdvAddn1, byte_limit(level2[:advice_addendum_1], 40) if level2[:advice_addendum_1]
|
410
|
+
xml.tag! :AMEXTranAdvAddn2, byte_limit(level2[:advice_addendum_2], 40) if level2[:advice_addendum_2]
|
411
|
+
xml.tag! :AMEXTranAdvAddn3, byte_limit(level2[:advice_addendum_3], 40) if level2[:advice_addendum_3]
|
412
|
+
xml.tag! :AMEXTranAdvAddn4, byte_limit(level2[:advice_addendum_4], 40) if level2[:advice_addendum_4]
|
380
413
|
end
|
381
414
|
end
|
382
415
|
|
383
|
-
def
|
384
|
-
if (
|
385
|
-
xml.tag! :PCOrderNum, byte_limit(
|
386
|
-
xml.tag! :PCDestZip, byte_limit(format_address_field(
|
387
|
-
xml.tag! :PCDestName, byte_limit(format_address_field(
|
388
|
-
xml.tag! :PCDestAddress1, byte_limit(format_address_field(
|
389
|
-
xml.tag! :PCDestAddress2, byte_limit(format_address_field(
|
390
|
-
xml.tag! :PCDestCity, byte_limit(format_address_field(
|
391
|
-
xml.tag! :PCDestState, byte_limit(format_address_field(
|
416
|
+
def add_level2_purchase(xml, options = {})
|
417
|
+
if (level2 = options[:level_2_data])
|
418
|
+
xml.tag! :PCOrderNum, byte_limit(level2[:purchase_order], 17) if level2[:purchase_order]
|
419
|
+
xml.tag! :PCDestZip, byte_limit(format_address_field(level2[:zip]), 10) if level2[:zip]
|
420
|
+
xml.tag! :PCDestName, byte_limit(format_address_field(level2[:name]), 30) if level2[:name]
|
421
|
+
xml.tag! :PCDestAddress1, byte_limit(format_address_field(level2[:address1]), 30) if level2[:address1]
|
422
|
+
xml.tag! :PCDestAddress2, byte_limit(format_address_field(level2[:address2]), 30) if level2[:address2]
|
423
|
+
xml.tag! :PCDestCity, byte_limit(format_address_field(level2[:city]), 20) if level2[:city]
|
424
|
+
xml.tag! :PCDestState, byte_limit(format_address_field(level2[:state]), 2) if level2[:state]
|
392
425
|
end
|
393
426
|
end
|
394
427
|
|
395
|
-
def
|
396
|
-
if (
|
397
|
-
xml.tag! :PC3FreightAmt, byte_limit(
|
398
|
-
xml.tag! :PC3DutyAmt, byte_limit(
|
399
|
-
xml.tag! :PC3DestCountryCd, byte_limit(
|
400
|
-
xml.tag! :PC3ShipFromZip, byte_limit(
|
401
|
-
xml.tag! :PC3DiscAmt, byte_limit(
|
428
|
+
def add_level3_purchase(xml, options = {})
|
429
|
+
if (level3 = options[:level_3_data])
|
430
|
+
xml.tag! :PC3FreightAmt, byte_limit(level3[:freight_amount], 12) if level3[:freight_amount]
|
431
|
+
xml.tag! :PC3DutyAmt, byte_limit(level3[:duty_amount], 12) if level3[:duty_amount]
|
432
|
+
xml.tag! :PC3DestCountryCd, byte_limit(level3[:dest_country], 3) if level3[:dest_country]
|
433
|
+
xml.tag! :PC3ShipFromZip, byte_limit(level3[:ship_from_zip], 10) if level3[:ship_from_zip]
|
434
|
+
xml.tag! :PC3DiscAmt, byte_limit(level3[:discount_amount], 12) if level3[:discount_amount]
|
402
435
|
end
|
403
436
|
end
|
404
437
|
|
405
|
-
def add_line_items(xml, options={})
|
438
|
+
def add_line_items(xml, options = {})
|
406
439
|
xml.tag! :PC3LineItemCount, byte_limit(options[:line_items].count, 2)
|
407
440
|
xml.tag! :PC3LineItemArray do
|
408
441
|
options[:line_items].each_with_index do |line_item, index|
|
409
442
|
xml.tag! :PC3LineItem do
|
410
443
|
xml.tag! :PC3DtlIndex, byte_limit(index + 1, 2)
|
411
444
|
line_item.each do |key, value|
|
412
|
-
if
|
445
|
+
if [:line_tot, 'line_tot'].include? key
|
413
446
|
formatted_key = :PC3Dtllinetot
|
414
447
|
else
|
415
448
|
formatted_key = "PC3Dtl#{key.to_s.camelize}".to_sym
|
@@ -478,7 +511,32 @@ module ActiveMerchant #:nodoc:
|
|
478
511
|
end
|
479
512
|
end
|
480
513
|
|
481
|
-
|
514
|
+
# Payment can be done through either Credit Card or Electronic Check
|
515
|
+
def add_payment_source(xml, payment_source, options = {})
|
516
|
+
if payment_source.is_a?(Check)
|
517
|
+
add_echeck(xml, payment_source, options)
|
518
|
+
else
|
519
|
+
add_creditcard(xml, payment_source, options[:currency])
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
523
|
+
# Adds Electronic Check attributes
|
524
|
+
def add_echeck(xml, check, options = {})
|
525
|
+
xml.tag! :CardBrand, 'EC'
|
526
|
+
xml.tag! :CurrencyCode, currency_code(options[:currency])
|
527
|
+
xml.tag! :CurrencyExponent, currency_exponents(options[:currency])
|
528
|
+
unless check.nil?
|
529
|
+
|
530
|
+
xml.tag! :BCRtNum, check.routing_number
|
531
|
+
xml.tag! :CheckDDA, check.account_number if check.account_number
|
532
|
+
xml.tag! :BankAccountType, ACCOUNT_TYPE[check.account_type] if ACCOUNT_TYPE[check.account_type]
|
533
|
+
xml.tag! :ECPAuthMethod, options[:auth_method] if options[:auth_method] && ECP_AUTH_METHODS.include?(options[:auth_method])
|
534
|
+
xml.tag! :BankPmtDelv, options[:payment_delivery] if options[:payment_delivery] && ECP_BANK_PAYMENT.include?(options[:payment_delivery])
|
535
|
+
end
|
536
|
+
end
|
537
|
+
|
538
|
+
# Adds Credit Card attributes
|
539
|
+
def add_creditcard(xml, creditcard, currency = nil)
|
482
540
|
unless creditcard.nil?
|
483
541
|
xml.tag! :AccountNum, creditcard.number
|
484
542
|
xml.tag! :Exp, expiry_date(creditcard)
|
@@ -515,13 +573,9 @@ module ActiveMerchant #:nodoc:
|
|
515
573
|
end
|
516
574
|
|
517
575
|
def add_xid(xml, creditcard, three_d_secure)
|
518
|
-
|
519
|
-
three_d_secure[:xid]
|
520
|
-
elsif creditcard.is_a?(NetworkTokenizationCreditCard)
|
521
|
-
creditcard.transaction_id
|
522
|
-
end
|
576
|
+
return unless three_d_secure && creditcard.brand == 'visa'
|
523
577
|
|
524
|
-
xml.tag!(:XID, xid) if xid
|
578
|
+
xml.tag!(:XID, three_d_secure[:xid]) if three_d_secure[:xid]
|
525
579
|
end
|
526
580
|
|
527
581
|
def add_cavv(xml, creditcard, three_d_secure)
|
@@ -536,6 +590,24 @@ module ActiveMerchant #:nodoc:
|
|
536
590
|
xml.tag!(:AAV, three_d_secure[:cavv])
|
537
591
|
end
|
538
592
|
|
593
|
+
def add_mc_program_protocol(xml, creditcard, three_d_secure)
|
594
|
+
return unless three_d_secure && creditcard.brand == 'master'
|
595
|
+
|
596
|
+
xml.tag!(:MCProgramProtocol, three_d_secure[:version]) if three_d_secure[:version]
|
597
|
+
end
|
598
|
+
|
599
|
+
def add_mc_directory_trans_id(xml, creditcard, three_d_secure)
|
600
|
+
return unless three_d_secure && creditcard.brand == 'master'
|
601
|
+
|
602
|
+
xml.tag!(:MCDirectoryTransID, three_d_secure[:ds_transaction_id]) if three_d_secure[:ds_transaction_id]
|
603
|
+
end
|
604
|
+
|
605
|
+
def add_ucafind(xml, creditcard, three_d_secure)
|
606
|
+
return unless three_d_secure && creditcard.brand == 'master'
|
607
|
+
|
608
|
+
xml.tag! :UCAFInd, '4'
|
609
|
+
end
|
610
|
+
|
539
611
|
def add_dpanind(xml, creditcard)
|
540
612
|
return unless creditcard.is_a?(NetworkTokenizationCreditCard)
|
541
613
|
|
@@ -560,7 +632,7 @@ module ActiveMerchant #:nodoc:
|
|
560
632
|
xml.tag!(:PymtBrandProgramCode, 'ASK')
|
561
633
|
end
|
562
634
|
|
563
|
-
def add_refund(xml, currency=nil)
|
635
|
+
def add_refund(xml, currency = nil)
|
564
636
|
xml.tag! :AccountNum, nil
|
565
637
|
|
566
638
|
xml.tag! :CurrencyCode, currency_code(currency)
|
@@ -591,6 +663,40 @@ module ActiveMerchant #:nodoc:
|
|
591
663
|
end
|
592
664
|
end
|
593
665
|
|
666
|
+
def add_ews_details(xml, payment_source, parameters = {})
|
667
|
+
xml.tag! :EWSFirstName, payment_source.first_name
|
668
|
+
xml.tag! :EWSLastName, payment_source.last_name
|
669
|
+
xml.tag! :EWSBusinessName, parameters[:company] if payment_source.first_name.empty? && payment_source.last_name.empty?
|
670
|
+
|
671
|
+
if (address = (parameters[:billing_address] || parameters[:address]))
|
672
|
+
xml.tag! :EWSAddressLine1, byte_limit(format_address_field(address[:address1]), 30)
|
673
|
+
xml.tag! :EWSAddressLine2, byte_limit(format_address_field(address[:address2]), 30)
|
674
|
+
xml.tag! :EWSCity, byte_limit(format_address_field(address[:city]), 20)
|
675
|
+
xml.tag! :EWSState, byte_limit(format_address_field(address[:state]), 2)
|
676
|
+
xml.tag! :EWSZip, byte_limit(format_address_field(address[:zip]), 10)
|
677
|
+
end
|
678
|
+
|
679
|
+
xml.tag! :EWSPhoneType, parameters[:phone_type]
|
680
|
+
xml.tag! :EWSPhoneNumber, parameters[:phone_number]
|
681
|
+
xml.tag! :EWSCheckSerialNumber, payment_source.account_number unless parameters[:auth_method].eql?('I')
|
682
|
+
end
|
683
|
+
|
684
|
+
# Adds ECP conditional attributes depending on other attribute values
|
685
|
+
def add_ecp_details(xml, payment_source, parameters = {})
|
686
|
+
requires!(payment_source.account_number) if parameters[:auth_method]&.eql?('A') || parameters[:auth_method]&.eql?('P')
|
687
|
+
xml.tag! :ECPActionCode, parameters[:action_code] if parameters[:action_code] && ECP_ACTION_CODES.include?(parameters[:action_code])
|
688
|
+
xml.tag! :ECPCheckSerialNumber, payment_source.account_number if parameters[:auth_method]&.eql?('A') || parameters[:auth_method]&.eql?('P')
|
689
|
+
if parameters[:auth_method]&.eql?('P')
|
690
|
+
xml.tag! :ECPTerminalCity, parameters[:terminal_city] if parameters[:terminal_city]
|
691
|
+
xml.tag! :ECPTerminalState, parameters[:terminal_state] if parameters[:terminal_state]
|
692
|
+
xml.tag! :ECPImageReferenceNumber, parameters[:image_reference_number] if parameters[:image_reference_number]
|
693
|
+
end
|
694
|
+
if parameters[:action_code]&.eql?('W3') || parameters[:action_code]&.eql?('W5') ||
|
695
|
+
parameters[:action_code]&.eql?('W7') || parameters[:action_code]&.eql?('W9')
|
696
|
+
add_ews_details(xml, payment_source, parameters)
|
697
|
+
end
|
698
|
+
end
|
699
|
+
|
594
700
|
def add_stored_credentials(xml, parameters)
|
595
701
|
return unless parameters[:mit_stored_credential_ind] == 'Y' || parameters[:stored_credential] && !parameters[:stored_credential].values.all?(&:nil?)
|
596
702
|
|
@@ -647,7 +753,7 @@ module ActiveMerchant #:nodoc:
|
|
647
753
|
end
|
648
754
|
end
|
649
755
|
|
650
|
-
def commit(order, message_type, trace_number=nil)
|
756
|
+
def commit(order, message_type, trace_number = nil)
|
651
757
|
headers = POST_HEADERS.merge('Content-length' => order.size.to_s)
|
652
758
|
if @options[:retry_logic] && trace_number
|
653
759
|
headers['Trace-number'] = trace_number.to_s
|
@@ -669,11 +775,10 @@ module ActiveMerchant #:nodoc:
|
|
669
775
|
test: self.test?,
|
670
776
|
avs_result: OrbitalGateway::AVSResult.new(response[:avs_resp_code]),
|
671
777
|
cvv_result: OrbitalGateway::CVVResult.new(response[:cvv2_resp_code])
|
672
|
-
}
|
673
|
-
)
|
778
|
+
})
|
674
779
|
end
|
675
780
|
|
676
|
-
def remote_url(url
|
781
|
+
def remote_url(url = :primary)
|
677
782
|
if url == :primary
|
678
783
|
(self.test? ? self.test_url : self.live_url)
|
679
784
|
else
|
@@ -700,7 +805,7 @@ module ActiveMerchant #:nodoc:
|
|
700
805
|
@options[:ip_authentication] == true
|
701
806
|
end
|
702
807
|
|
703
|
-
def build_new_order_xml(action, money,
|
808
|
+
def build_new_order_xml(action, money, payment_source, parameters = {})
|
704
809
|
requires!(parameters, :order_id)
|
705
810
|
xml = xml_envelope
|
706
811
|
xml.tag! :Request do
|
@@ -725,30 +830,32 @@ module ActiveMerchant #:nodoc:
|
|
725
830
|
|
726
831
|
three_d_secure = parameters[:three_d_secure]
|
727
832
|
|
728
|
-
add_eci(xml,
|
729
|
-
add_cavv(xml,
|
730
|
-
add_xid(xml,
|
833
|
+
add_eci(xml, payment_source, three_d_secure)
|
834
|
+
add_cavv(xml, payment_source, three_d_secure)
|
835
|
+
add_xid(xml, payment_source, three_d_secure)
|
731
836
|
|
732
837
|
xml.tag! :OrderID, format_order_id(parameters[:order_id])
|
733
838
|
xml.tag! :Amount, amount(money)
|
734
839
|
xml.tag! :Comments, parameters[:comments] if parameters[:comments]
|
735
840
|
|
736
|
-
|
737
|
-
|
841
|
+
add_level2_tax(xml, parameters)
|
842
|
+
add_level2_advice_addendum(xml, parameters)
|
738
843
|
|
739
|
-
add_aav(xml,
|
844
|
+
add_aav(xml, payment_source, three_d_secure)
|
740
845
|
# CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
|
741
846
|
|
742
|
-
add_dpanind(xml, creditcard)
|
743
|
-
add_aevv(xml, creditcard, three_d_secure)
|
744
|
-
add_digital_token_cryptogram(xml, creditcard)
|
745
|
-
|
746
847
|
if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
|
747
848
|
add_soft_descriptors(xml, parameters[:soft_descriptors])
|
748
849
|
elsif parameters[:soft_descriptors].is_a?(Hash)
|
749
850
|
add_soft_descriptors_from_hash(xml, parameters[:soft_descriptors])
|
750
851
|
end
|
751
852
|
|
853
|
+
add_dpanind(xml, payment_source)
|
854
|
+
add_aevv(xml, payment_source, three_d_secure)
|
855
|
+
add_digital_token_cryptogram(xml, payment_source)
|
856
|
+
|
857
|
+
xml.tag! :ECPSameDayInd, parameters[:same_day] if parameters[:same_day] && ECP_SAME_DAY.include?(parameters[:same_day]) && payment_source.is_a?(Check)
|
858
|
+
|
752
859
|
set_recurring_ind(xml, parameters)
|
753
860
|
|
754
861
|
# Append Transaction Reference Number at the end for Refund transactions
|
@@ -757,13 +864,17 @@ module ActiveMerchant #:nodoc:
|
|
757
864
|
xml.tag! :TxRefNum, tx_ref_num
|
758
865
|
end
|
759
866
|
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
add_card_indicators(xml, parameters)
|
867
|
+
add_level2_purchase(xml, parameters)
|
868
|
+
add_level3_purchase(xml, parameters)
|
869
|
+
add_level3_tax(xml, parameters)
|
764
870
|
add_line_items(xml, parameters) if parameters[:line_items]
|
871
|
+
add_ecp_details(xml, payment_source, parameters) if payment_source.is_a?(Check)
|
872
|
+
add_card_indicators(xml, parameters)
|
765
873
|
add_stored_credentials(xml, parameters)
|
766
|
-
add_pymt_brand_program_code(xml,
|
874
|
+
add_pymt_brand_program_code(xml, payment_source, three_d_secure)
|
875
|
+
add_mc_program_protocol(xml, payment_source, three_d_secure)
|
876
|
+
add_mc_directory_trans_id(xml, payment_source, three_d_secure)
|
877
|
+
add_ucafind(xml, payment_source, three_d_secure)
|
767
878
|
end
|
768
879
|
end
|
769
880
|
xml.target!
|
@@ -788,13 +899,13 @@ module ActiveMerchant #:nodoc:
|
|
788
899
|
add_xml_credentials(xml)
|
789
900
|
xml.tag! :OrderID, format_order_id(order_id)
|
790
901
|
xml.tag! :Amount, amount(money)
|
791
|
-
|
902
|
+
add_level2_tax(xml, parameters)
|
792
903
|
add_bin_merchant_and_terminal(xml, parameters)
|
793
904
|
xml.tag! :TxRefNum, tx_ref_num
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
905
|
+
add_level2_purchase(xml, parameters)
|
906
|
+
add_level2_advice_addendum(xml, parameters)
|
907
|
+
add_level3_purchase(xml, parameters)
|
908
|
+
add_level3_tax(xml, parameters)
|
798
909
|
end
|
799
910
|
end
|
800
911
|
xml.target!
|
@@ -864,7 +975,7 @@ module ActiveMerchant #:nodoc:
|
|
864
975
|
# 3. PINless Debit transactions can only use uppercase and lowercase alpha (A-Z, a-z) and numeric (0-9)
|
865
976
|
def format_order_id(order_id)
|
866
977
|
illegal_characters = /[^,$@&\- \w]/
|
867
|
-
order_id = order_id.to_s.
|
978
|
+
order_id = order_id.to_s.tr('.', '-')
|
868
979
|
order_id.gsub!(illegal_characters, '')
|
869
980
|
order_id.lstrip!
|
870
981
|
order_id[0...22]
|