activemerchant 1.112.0 → 1.118.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +115 -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 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +58 -11
- data/lib/active_merchant/billing/gateway.rb +1 -1
- data/lib/active_merchant/billing/gateways/adyen.rb +26 -16
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
- data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -18
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -2
- data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
- data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
- data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
- 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 +85 -23
- data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
- data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
- 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 +20 -17
- 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 +8 -8
- 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 +11 -11
- data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +18 -21
- 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 +32 -15
- data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
- data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +61 -37
- 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 +24 -9
- data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
- data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
- data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
- data/lib/active_merchant/billing/gateways/elavon.rb +279 -227
- 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 +8 -8
- data/lib/active_merchant/billing/gateways/exact.rb +8 -9
- data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
- 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 +9 -9
- 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 +29 -10
- data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
- data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
- data/lib/active_merchant/billing/gateways/hps.rb +17 -14
- 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 +7 -7
- data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
- 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 +5 -6
- data/lib/active_merchant/billing/gateways/litle.rb +28 -12
- data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
- 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 +12 -10
- 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 +4 -5
- data/lib/active_merchant/billing/gateways/opp.rb +12 -12
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
- data/lib/active_merchant/billing/gateways/orbital.rb +175 -81
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
- data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
- 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 +4 -5
- 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 +35 -17
- data/lib/active_merchant/billing/gateways/payex.rb +11 -12
- data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
- data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
- data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
- 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 +2 -3
- data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
- 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 +9 -9
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +87 -7
- 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 +6 -7
- 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 +3 -4
- 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 +12 -12
- 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 +9 -9
- data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
- data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
- 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 +18 -10
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
- 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
@@ -23,12 +23,15 @@ module ActiveMerchant #:nodoc:
|
|
23
23
|
payment_method = add_payment_method_token(post, payment_method, options)
|
24
24
|
return payment_method if payment_method.is_a?(ActiveMerchant::Billing::Response)
|
25
25
|
|
26
|
+
add_external_three_d_secure_auth_data(post, options)
|
26
27
|
add_metadata(post, options)
|
27
28
|
add_return_url(post, options)
|
28
29
|
add_connected_account(post, options)
|
29
30
|
add_shipping_address(post, options)
|
30
31
|
setup_future_usage(post, options)
|
31
32
|
add_exemption(post, options)
|
33
|
+
add_error_on_requires_action(post, options)
|
34
|
+
request_three_d_secure(post, options)
|
32
35
|
|
33
36
|
CREATE_INTENT_ATTRIBUTES.each do |attribute|
|
34
37
|
add_whitelisted_attribute(post, options, attribute)
|
@@ -267,6 +270,33 @@ module ActiveMerchant #:nodoc:
|
|
267
270
|
post[:payment_method_options][:card][:moto] = true if options[:moto]
|
268
271
|
end
|
269
272
|
|
273
|
+
def add_error_on_requires_action(post, options = {})
|
274
|
+
return unless options[:confirm]
|
275
|
+
|
276
|
+
post[:error_on_requires_action] = true if options[:error_on_requires_action]
|
277
|
+
end
|
278
|
+
|
279
|
+
def request_three_d_secure(post, options = {})
|
280
|
+
return unless options[:request_three_d_secure] && %w(any automatic).include?(options[:request_three_d_secure])
|
281
|
+
|
282
|
+
post[:payment_method_options] ||= {}
|
283
|
+
post[:payment_method_options][:card] ||= {}
|
284
|
+
post[:payment_method_options][:card][:request_three_d_secure] = options[:request_three_d_secure]
|
285
|
+
end
|
286
|
+
|
287
|
+
def add_external_three_d_secure_auth_data(post, options = {})
|
288
|
+
return unless options[:three_d_secure]&.is_a?(Hash)
|
289
|
+
|
290
|
+
three_d_secure = options[:three_d_secure]
|
291
|
+
post[:payment_method_options] ||= {}
|
292
|
+
post[:payment_method_options][:card] ||= {}
|
293
|
+
post[:payment_method_options][:card][:three_d_secure] ||= {}
|
294
|
+
post[:payment_method_options][:card][:three_d_secure][:version] = three_d_secure[:version] || (three_d_secure[:ds_transaction_id] ? '2.2.0' : '1.0.2')
|
295
|
+
post[:payment_method_options][:card][:three_d_secure][:electronic_commerce_indicator] = three_d_secure[:eci] if three_d_secure[:eci]
|
296
|
+
post[:payment_method_options][:card][:three_d_secure][:cryptogram] = three_d_secure[:cavv] if three_d_secure[:cavv]
|
297
|
+
post[:payment_method_options][:card][:three_d_secure][:transaction_id] = three_d_secure[:ds_transaction_id] || three_d_secure[:xid]
|
298
|
+
end
|
299
|
+
|
270
300
|
def setup_future_usage(post, options = {})
|
271
301
|
post[:setup_future_usage] = options[:setup_future_usage] if %w(on_session off_session).include?(options[:setup_future_usage])
|
272
302
|
post[:off_session] = options[:off_session] if options[:off_session] && options[:confirm] == true
|
@@ -109,8 +109,7 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
TRANSACTION_APPROVED_MSG :
|
110
110
|
TRANSACTION_DECLINED_MSG,
|
111
111
|
response,
|
112
|
-
test: test?
|
113
|
-
)
|
112
|
+
test: test?)
|
114
113
|
else
|
115
114
|
build_error_response(message, response)
|
116
115
|
end
|
@@ -125,7 +124,7 @@ module ActiveMerchant #:nodoc:
|
|
125
124
|
end
|
126
125
|
end
|
127
126
|
|
128
|
-
def call_api(api, params=nil)
|
127
|
+
def call_api(api, params = nil)
|
129
128
|
params ||= {}
|
130
129
|
params[:merchant_id] = @options[:login]
|
131
130
|
params[:api_key] = @options[:api_key]
|
@@ -139,7 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
139
138
|
(test? ? self.test_url : self.live_url) + api
|
140
139
|
end
|
141
140
|
|
142
|
-
def build_error_response(message, params={})
|
141
|
+
def build_error_response(message, params = {})
|
143
142
|
Response.new(
|
144
143
|
false,
|
145
144
|
message,
|
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
'Y' => 'M',
|
18
18
|
'N' => 'N',
|
19
19
|
'X' => 'P',
|
20
|
-
'E' => 'U'
|
20
|
+
'E' => 'U'
|
21
21
|
}
|
22
22
|
|
23
23
|
AVS_CODE_TRANSLATOR = {
|
@@ -28,12 +28,12 @@ module ActiveMerchant #:nodoc:
|
|
28
28
|
'E' => 'R'
|
29
29
|
}
|
30
30
|
|
31
|
-
def initialize(options={})
|
31
|
+
def initialize(options = {})
|
32
32
|
requires!(options, :merchant_id, :api_key)
|
33
33
|
super
|
34
34
|
end
|
35
35
|
|
36
|
-
def purchase(amount, payment_method, options={})
|
36
|
+
def purchase(amount, payment_method, options = {})
|
37
37
|
commit(:purchase, amount, options[:currency]) do |doc|
|
38
38
|
add_invoice(doc, 'sale', amount, payment_method, options)
|
39
39
|
add_payment_method(doc, payment_method, options)
|
@@ -41,7 +41,7 @@ module ActiveMerchant #:nodoc:
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def authorize(amount, payment_method, options={})
|
44
|
+
def authorize(amount, payment_method, options = {})
|
45
45
|
commit(:authorize, amount, options[:currency]) do |doc|
|
46
46
|
add_invoice(doc, 'auth', amount, payment_method, options)
|
47
47
|
add_payment_method(doc, payment_method, options)
|
@@ -49,26 +49,26 @@ module ActiveMerchant #:nodoc:
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def capture(amount, authorization, options={})
|
52
|
+
def capture(amount, authorization, options = {})
|
53
53
|
commit(:capture) do |doc|
|
54
54
|
add_invoice(doc, 'capture', amount, authorization, options)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def void(authorization, options={})
|
58
|
+
def void(authorization, options = {})
|
59
59
|
_, amount, currency = split_authorization(authorization)
|
60
60
|
commit(:void) do |doc|
|
61
61
|
add_invoice(doc, 'void', amount.to_i, authorization, options.merge(currency: currency))
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
def refund(amount, authorization, options={})
|
65
|
+
def refund(amount, authorization, options = {})
|
66
66
|
commit(:refund) do |doc|
|
67
67
|
add_invoice(doc, 'refund', amount, authorization, options)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def verify(credit_card, options={})
|
71
|
+
def verify(credit_card, options = {})
|
72
72
|
commit(:verify) do |doc|
|
73
73
|
add_invoice(doc, 'verify', 100, credit_card, options)
|
74
74
|
add_payment_method(doc, credit_card, options)
|
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
162
162
|
country.code(:alpha2)
|
163
163
|
end
|
164
164
|
|
165
|
-
def commit(action, amount=nil, currency=nil)
|
165
|
+
def commit(action, amount = nil, currency = nil)
|
166
166
|
currency = default_currency if currency == nil
|
167
167
|
request = build_xml_request { |doc| yield(doc) }
|
168
168
|
response = ssl_post(live_url, request, headers)
|
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
|
|
18
18
|
purchase_echeck: 'ACHDebit',
|
19
19
|
refund: 'CreditCardCredit',
|
20
20
|
refund_echeck: 'ACHVoidTransaction',
|
21
|
-
void: 'CreditCardAutoRefundorVoid'
|
21
|
+
void: 'CreditCardAutoRefundorVoid'
|
22
22
|
}
|
23
23
|
|
24
24
|
ENDPOINTS = {
|
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
|
|
46
46
|
commit((payment.is_a?(Check) ? :purchase_echeck : :purchase), post)
|
47
47
|
end
|
48
48
|
|
49
|
-
def refund(money, authorization, options={})
|
49
|
+
def refund(money, authorization, options = {})
|
50
50
|
post = {}
|
51
51
|
|
52
52
|
transaction_id, payment_type = split_authorization(authorization)
|
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
|
|
57
57
|
commit((payment_type == 'check' ? :refund_echeck : :refund), post)
|
58
58
|
end
|
59
59
|
|
60
|
-
def void(authorization, options={})
|
60
|
+
def void(authorization, options = {})
|
61
61
|
post = {}
|
62
62
|
|
63
63
|
transaction_id, = split_authorization(authorization)
|
@@ -152,7 +152,7 @@ module ActiveMerchant #:nodoc:
|
|
152
152
|
'R1' => 'The transaction was declined or returned, because the cardholder requested that payment of all recurring or installment payment transactions for a specific merchant account be stopped/ Reserved for client-specific use (declined)',
|
153
153
|
'Q1' => 'Card Authentication failed/ Reserved for client-specific use (declined)',
|
154
154
|
'XA' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
|
155
|
-
'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)'
|
155
|
+
'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)'
|
156
156
|
}
|
157
157
|
|
158
158
|
EXTENDED_RESPONSE_MESSAGES = {
|
@@ -179,15 +179,15 @@ module ActiveMerchant #:nodoc:
|
|
179
179
|
refund_echeck: 16,
|
180
180
|
void_echeck: 16,
|
181
181
|
|
182
|
-
wallet_sale: 14
|
182
|
+
wallet_sale: 14
|
183
183
|
}
|
184
184
|
|
185
|
-
def initialize(options={})
|
185
|
+
def initialize(options = {})
|
186
186
|
requires!(options, :gateway_id, :reg_key)
|
187
187
|
super
|
188
188
|
end
|
189
189
|
|
190
|
-
def purchase(amount, payment_method, options={})
|
190
|
+
def purchase(amount, payment_method, options = {})
|
191
191
|
if credit_card?(payment_method)
|
192
192
|
action = :purchase
|
193
193
|
request = build_xml_transaction_request do |doc|
|
@@ -216,7 +216,7 @@ module ActiveMerchant #:nodoc:
|
|
216
216
|
commit(action, request)
|
217
217
|
end
|
218
218
|
|
219
|
-
def authorize(amount, payment_method, options={})
|
219
|
+
def authorize(amount, payment_method, options = {})
|
220
220
|
if credit_card?(payment_method)
|
221
221
|
request = build_xml_transaction_request do |doc|
|
222
222
|
add_credit_card(doc, payment_method)
|
@@ -234,7 +234,7 @@ module ActiveMerchant #:nodoc:
|
|
234
234
|
commit(:authorize, request)
|
235
235
|
end
|
236
236
|
|
237
|
-
def capture(amount, authorization, options={})
|
237
|
+
def capture(amount, authorization, options = {})
|
238
238
|
transaction_id = split_authorization(authorization)[1]
|
239
239
|
request = build_xml_transaction_request do |doc|
|
240
240
|
add_amount(doc, amount)
|
@@ -244,7 +244,7 @@ module ActiveMerchant #:nodoc:
|
|
244
244
|
commit(:capture, request)
|
245
245
|
end
|
246
246
|
|
247
|
-
def void(authorization, options={})
|
247
|
+
def void(authorization, options = {})
|
248
248
|
action, transaction_id = split_authorization(authorization)
|
249
249
|
|
250
250
|
request = build_xml_transaction_request do |doc|
|
@@ -254,7 +254,7 @@ module ActiveMerchant #:nodoc:
|
|
254
254
|
commit(void_type(action), request)
|
255
255
|
end
|
256
256
|
|
257
|
-
def refund(amount, authorization, options={})
|
257
|
+
def refund(amount, authorization, options = {})
|
258
258
|
action, transaction_id = split_authorization(authorization)
|
259
259
|
|
260
260
|
request = build_xml_transaction_request do |doc|
|
@@ -265,7 +265,7 @@ module ActiveMerchant #:nodoc:
|
|
265
265
|
commit(refund_type(action), request)
|
266
266
|
end
|
267
267
|
|
268
|
-
def credit(amount, payment_method, options={})
|
268
|
+
def credit(amount, payment_method, options = {})
|
269
269
|
request = build_xml_transaction_request do |doc|
|
270
270
|
add_pan(doc, payment_method)
|
271
271
|
add_amount(doc, amount)
|
@@ -274,7 +274,7 @@ module ActiveMerchant #:nodoc:
|
|
274
274
|
commit(:credit, request)
|
275
275
|
end
|
276
276
|
|
277
|
-
def verify(credit_card, options={})
|
277
|
+
def verify(credit_card, options = {})
|
278
278
|
request = build_xml_transaction_request do |doc|
|
279
279
|
add_credit_card(doc, credit_card)
|
280
280
|
add_contact(doc, credit_card.name, options)
|
@@ -283,7 +283,7 @@ module ActiveMerchant #:nodoc:
|
|
283
283
|
commit(:verify, request)
|
284
284
|
end
|
285
285
|
|
286
|
-
def store(payment_method, options={})
|
286
|
+
def store(payment_method, options = {})
|
287
287
|
store_customer_request = build_xml_payment_storage_request do |doc|
|
288
288
|
store_customer_details(doc, payment_method.name, options)
|
289
289
|
end
|
@@ -322,7 +322,7 @@ module ActiveMerchant #:nodoc:
|
|
322
322
|
|
323
323
|
private
|
324
324
|
|
325
|
-
CURRENCY_CODES = Hash.new { |
|
325
|
+
CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
|
326
326
|
CURRENCY_CODES['USD'] = '840'
|
327
327
|
|
328
328
|
def headers
|
@@ -462,7 +462,7 @@ module ActiveMerchant #:nodoc:
|
|
462
462
|
end
|
463
463
|
end
|
464
464
|
|
465
|
-
def build_xml_request(wrapper, merchant_product_type=nil)
|
465
|
+
def build_xml_request(wrapper, merchant_product_type = nil)
|
466
466
|
Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
467
467
|
xml['soapenv'].Envelope('xmlns:soapenv' => SOAPENV_NAMESPACE) do
|
468
468
|
xml['soapenv'].Body do
|
@@ -485,7 +485,7 @@ module ActiveMerchant #:nodoc:
|
|
485
485
|
doc.root.to_xml
|
486
486
|
end
|
487
487
|
|
488
|
-
def add_merchant(doc, product_type=nil)
|
488
|
+
def add_merchant(doc, product_type = nil)
|
489
489
|
doc['v1'].merc do
|
490
490
|
doc['v1'].id @options[:gateway_id]
|
491
491
|
doc['v1'].regKey @options[:reg_key]
|
@@ -17,12 +17,12 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
self.homepage_url = 'https://www.transactpro.lv/business/online-payments-acceptance'
|
18
18
|
self.display_name = 'Transact Pro'
|
19
19
|
|
20
|
-
def initialize(options={})
|
20
|
+
def initialize(options = {})
|
21
21
|
requires!(options, :guid, :password, :terminal)
|
22
22
|
super
|
23
23
|
end
|
24
24
|
|
25
|
-
def purchase(amount, payment, options={})
|
25
|
+
def purchase(amount, payment, options = {})
|
26
26
|
post = PostData.new
|
27
27
|
add_invoice(post, amount, options)
|
28
28
|
add_payment(post, payment)
|
@@ -44,7 +44,7 @@ module ActiveMerchant #:nodoc:
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
def authorize(amount, payment, options={})
|
47
|
+
def authorize(amount, payment, options = {})
|
48
48
|
post = PostData.new
|
49
49
|
add_invoice(post, amount, options)
|
50
50
|
add_payment(post, payment)
|
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
def capture(amount, authorization, options={})
|
69
|
+
def capture(amount, authorization, options = {})
|
70
70
|
identifier, original_amount = split_authorization(authorization)
|
71
71
|
raise ArgumentError.new("Partial capture is not supported, and #{amount.inspect} != #{original_amount.inspect}") if amount && (amount != original_amount)
|
72
72
|
|
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
|
|
78
78
|
commit('charge_hold', post, original_amount)
|
79
79
|
end
|
80
80
|
|
81
|
-
def refund(amount, authorization, options={})
|
81
|
+
def refund(amount, authorization, options = {})
|
82
82
|
identifier, original_amount = split_authorization(authorization)
|
83
83
|
|
84
84
|
post = PostData.new
|
@@ -89,7 +89,7 @@ module ActiveMerchant #:nodoc:
|
|
89
89
|
commit('refund', post)
|
90
90
|
end
|
91
91
|
|
92
|
-
def void(authorization, options={})
|
92
|
+
def void(authorization, options = {})
|
93
93
|
identifier, amount = split_authorization(authorization)
|
94
94
|
|
95
95
|
post = PostData.new
|
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
|
|
99
99
|
commit('cancel_dms', post)
|
100
100
|
end
|
101
101
|
|
102
|
-
def verify(credit_card, options={})
|
102
|
+
def verify(credit_card, options = {})
|
103
103
|
MultiResponse.run(:use_first_response) do |r|
|
104
104
|
r.process { authorize(100, credit_card, options) }
|
105
105
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -156,7 +156,7 @@ module ActiveMerchant #:nodoc:
|
|
156
156
|
post[:expire] = "#{month}/#{year[2..3]}"
|
157
157
|
end
|
158
158
|
|
159
|
-
def add_credentials(post, key
|
159
|
+
def add_credentials(post, key = :guid)
|
160
160
|
post[key] = @options[:guid]
|
161
161
|
post[:pwd] = Digest::SHA1.hexdigest(@options[:password])
|
162
162
|
end
|
@@ -176,7 +176,7 @@ module ActiveMerchant #:nodoc:
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
def commit(action, parameters, amount=nil)
|
179
|
+
def commit(action, parameters, amount = nil)
|
180
180
|
url = (test? ? test_url : live_url)
|
181
181
|
response = parse(ssl_post(url, post_data(action, parameters)))
|
182
182
|
|
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
|
|
151
151
|
|
152
152
|
def authorize(money, creditcard_or_billing_id, options = {})
|
153
153
|
parameters = {
|
154
|
-
amount: amount(money)
|
154
|
+
amount: amount(money)
|
155
155
|
}
|
156
156
|
|
157
157
|
add_order_id(parameters, options)
|
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
|
|
168
168
|
# to process a purchase are an amount in cents or a money object and a creditcard object or billingid string.
|
169
169
|
def purchase(money, creditcard_or_billing_id, options = {})
|
170
170
|
parameters = {
|
171
|
-
amount: amount(money)
|
171
|
+
amount: amount(money)
|
172
172
|
}
|
173
173
|
|
174
174
|
add_order_id(parameters, options)
|
@@ -188,7 +188,7 @@ module ActiveMerchant #:nodoc:
|
|
188
188
|
transaction_id, = split_authorization(authorization)
|
189
189
|
parameters = {
|
190
190
|
amount: amount(money),
|
191
|
-
transid: transaction_id
|
191
|
+
transid: transaction_id
|
192
192
|
}
|
193
193
|
add_aggregator(parameters, options)
|
194
194
|
add_custom_fields(parameters, options)
|
@@ -239,7 +239,7 @@ module ActiveMerchant #:nodoc:
|
|
239
239
|
action = (VOIDABLE_ACTIONS - ['preauth']).include?(original_action) ? 'void' : 'reversal'
|
240
240
|
|
241
241
|
parameters = {
|
242
|
-
transid: transaction_id
|
242
|
+
transid: transaction_id
|
243
243
|
}
|
244
244
|
|
245
245
|
add_aggregator(parameters, options)
|
@@ -285,7 +285,7 @@ module ActiveMerchant #:nodoc:
|
|
285
285
|
cycle: cycle,
|
286
286
|
verify: options[:verify] || 'y',
|
287
287
|
billingid: options[:billingid] || nil,
|
288
|
-
payments: options[:payments] || nil
|
288
|
+
payments: options[:payments] || nil
|
289
289
|
}
|
290
290
|
|
291
291
|
add_creditcard(parameters, creditcard)
|
@@ -300,7 +300,7 @@ module ActiveMerchant #:nodoc:
|
|
300
300
|
def store(creditcard, options = {})
|
301
301
|
parameters = {
|
302
302
|
verify: options[:verify] || 'y',
|
303
|
-
billingid: options[:billingid] || options[:billing_id] || nil
|
303
|
+
billingid: options[:billingid] || options[:billing_id] || nil
|
304
304
|
}
|
305
305
|
|
306
306
|
add_creditcard(parameters, creditcard)
|
@@ -314,7 +314,7 @@ module ActiveMerchant #:nodoc:
|
|
314
314
|
# unstore() the information will be removed and a Response object will be returned indicating the success of the action.
|
315
315
|
def unstore(identification, options = {})
|
316
316
|
parameters = {
|
317
|
-
billingid: identification
|
317
|
+
billingid: identification
|
318
318
|
}
|
319
319
|
|
320
320
|
add_custom_fields(parameters, options)
|
@@ -447,8 +447,7 @@ module ActiveMerchant #:nodoc:
|
|
447
447
|
test: test?,
|
448
448
|
authorization: authorization_from(action, data),
|
449
449
|
cvv_result: data['cvv'],
|
450
|
-
avs_result: { code: data['avs'] }
|
451
|
-
)
|
450
|
+
avs_result: { code: data['avs'] })
|
452
451
|
end
|
453
452
|
|
454
453
|
def parse(body)
|
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
# :software id or :live_url are passed in the options hash it will
|
13
13
|
# create an instance of UsaEpayAdvancedGateway.
|
14
14
|
#
|
15
|
-
def self.new(options={})
|
15
|
+
def self.new(options = {})
|
16
16
|
if options.has_key?(:software_id) || options.has_key?(:live_url)
|
17
17
|
UsaEpayAdvancedGateway.new(options)
|
18
18
|
else
|
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
|
|
126
126
|
COMMON_ADDRESS_OPTIONS,
|
127
127
|
{
|
128
128
|
address1: [:string, 'Street'],
|
129
|
-
address2: [:string, 'Street2']
|
129
|
+
address2: [:string, 'Street2']
|
130
130
|
}
|
131
131
|
].inject(:merge) #:nodoc
|
132
132
|
|
@@ -136,7 +136,7 @@ module ActiveMerchant #:nodoc:
|
|
136
136
|
COMMON_ADDRESS_OPTIONS,
|
137
137
|
{
|
138
138
|
address1: [:string, 'Address'],
|
139
|
-
address2: [:string, 'Address2']
|
139
|
+
address2: [:string, 'Address2']
|
140
140
|
},
|
141
141
|
{
|
142
142
|
card_number: [:string, 'CardNumber'],
|
@@ -144,7 +144,7 @@ module ActiveMerchant #:nodoc:
|
|
144
144
|
account: [:string, 'Account'],
|
145
145
|
routing: [:string, 'Routing'],
|
146
146
|
check_format: [:string, 'CheckFormat'],
|
147
|
-
record_type: [:string, 'RecordType']
|
147
|
+
record_type: [:string, 'RecordType']
|
148
148
|
}
|
149
149
|
].inject(:merge) #:nodoc
|
150
150
|
|
@@ -187,7 +187,7 @@ module ActiveMerchant #:nodoc:
|
|
187
187
|
comments: [:string, 'Comments'],
|
188
188
|
allow_partial_auth: [:boolean, 'AllowPartialAuth'],
|
189
189
|
currency: [:string, 'Currency'],
|
190
|
-
non_tax: [:boolean, 'NonTax']
|
190
|
+
non_tax: [:boolean, 'NonTax']
|
191
191
|
} #:nodoc:
|
192
192
|
|
193
193
|
TRANSACTION_DETAIL_MONEY_OPTIONS = {
|
@@ -289,7 +289,7 @@ module ActiveMerchant #:nodoc:
|
|
289
289
|
#
|
290
290
|
# Note: See run_transaction for additional options.
|
291
291
|
#
|
292
|
-
def purchase(money, creditcard, options={})
|
292
|
+
def purchase(money, creditcard, options = {})
|
293
293
|
run_sale(options.merge!(amount: money, payment_method: creditcard))
|
294
294
|
end
|
295
295
|
|
@@ -297,7 +297,7 @@ module ActiveMerchant #:nodoc:
|
|
297
297
|
#
|
298
298
|
# Note: See run_transaction for additional options.
|
299
299
|
#
|
300
|
-
def authorize(money, creditcard, options={})
|
300
|
+
def authorize(money, creditcard, options = {})
|
301
301
|
run_auth_only(options.merge!(amount: money, payment_method: creditcard))
|
302
302
|
end
|
303
303
|
|
@@ -305,7 +305,7 @@ module ActiveMerchant #:nodoc:
|
|
305
305
|
#
|
306
306
|
# Note: See run_transaction for additional options.
|
307
307
|
#
|
308
|
-
def capture(money, identification, options={})
|
308
|
+
def capture(money, identification, options = {})
|
309
309
|
capture_transaction(options.merge!(amount: money, reference_number: identification))
|
310
310
|
end
|
311
311
|
|
@@ -313,7 +313,7 @@ module ActiveMerchant #:nodoc:
|
|
313
313
|
#
|
314
314
|
# Note: See run_transaction for additional options.
|
315
315
|
#
|
316
|
-
def void(identification, options={})
|
316
|
+
def void(identification, options = {})
|
317
317
|
void_transaction(options.merge!(reference_number: identification))
|
318
318
|
end
|
319
319
|
|
@@ -321,11 +321,11 @@ module ActiveMerchant #:nodoc:
|
|
321
321
|
#
|
322
322
|
# Note: See run_transaction for additional options.
|
323
323
|
#
|
324
|
-
def refund(money, identification, options={})
|
324
|
+
def refund(money, identification, options = {})
|
325
325
|
refund_transaction(options.merge!(amount: money, reference_number: identification))
|
326
326
|
end
|
327
327
|
|
328
|
-
def credit(money, identification, options={})
|
328
|
+
def credit(money, identification, options = {})
|
329
329
|
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
330
330
|
refund(money, identification, options)
|
331
331
|
end
|
@@ -368,7 +368,7 @@ module ActiveMerchant #:nodoc:
|
|
368
368
|
# ==== Response
|
369
369
|
# * <tt>#message</tt> -- customer number assigned by gateway
|
370
370
|
#
|
371
|
-
def add_customer(options={})
|
371
|
+
def add_customer(options = {})
|
372
372
|
request = build_request(__method__, options)
|
373
373
|
commit(__method__, request)
|
374
374
|
end
|
@@ -381,7 +381,7 @@ module ActiveMerchant #:nodoc:
|
|
381
381
|
# ==== Options
|
382
382
|
# * Same as add_customer
|
383
383
|
#
|
384
|
-
def update_customer(options={})
|
384
|
+
def update_customer(options = {})
|
385
385
|
requires! options, :customer_number
|
386
386
|
|
387
387
|
request = build_request(__method__, options)
|
@@ -429,7 +429,7 @@ module ActiveMerchant #:nodoc:
|
|
429
429
|
# ==== Response
|
430
430
|
# * <tt>#message</tt> -- boolean; Returns true if successful. Exception thrown all failures.
|
431
431
|
#
|
432
|
-
def quick_update_customer(options={})
|
432
|
+
def quick_update_customer(options = {})
|
433
433
|
requires! options, :customer_number
|
434
434
|
requires! options, :update_data
|
435
435
|
|
@@ -444,7 +444,7 @@ module ActiveMerchant #:nodoc:
|
|
444
444
|
# ==== Required
|
445
445
|
# * <tt>:customer_number</tt>
|
446
446
|
#
|
447
|
-
def enable_customer(options={})
|
447
|
+
def enable_customer(options = {})
|
448
448
|
requires! options, :customer_number
|
449
449
|
|
450
450
|
request = build_request(__method__, options)
|
@@ -456,7 +456,7 @@ module ActiveMerchant #:nodoc:
|
|
456
456
|
# ==== Required
|
457
457
|
# * <tt>:customer_number</tt>
|
458
458
|
#
|
459
|
-
def disable_customer(options={})
|
459
|
+
def disable_customer(options = {})
|
460
460
|
requires! options, :customer_number
|
461
461
|
|
462
462
|
request = build_request(__method__, options)
|
@@ -479,7 +479,7 @@ module ActiveMerchant #:nodoc:
|
|
479
479
|
# ==== Response
|
480
480
|
# * <tt>#message</tt> -- method_id of new customer payment method
|
481
481
|
#
|
482
|
-
def add_customer_payment_method(options={})
|
482
|
+
def add_customer_payment_method(options = {})
|
483
483
|
requires! options, :customer_number
|
484
484
|
|
485
485
|
request = build_request(__method__, options)
|
@@ -494,7 +494,7 @@ module ActiveMerchant #:nodoc:
|
|
494
494
|
# ==== Response
|
495
495
|
# * <tt>#message</tt> -- either a single hash or an array of hashes of payment methods
|
496
496
|
#
|
497
|
-
def get_customer_payment_methods(options={})
|
497
|
+
def get_customer_payment_methods(options = {})
|
498
498
|
requires! options, :customer_number
|
499
499
|
|
500
500
|
request = build_request(__method__, options)
|
@@ -510,7 +510,7 @@ module ActiveMerchant #:nodoc:
|
|
510
510
|
# ==== Response
|
511
511
|
# * <tt>#message</tt> -- hash of payment method
|
512
512
|
#
|
513
|
-
def get_customer_payment_method(options={})
|
513
|
+
def get_customer_payment_method(options = {})
|
514
514
|
requires! options, :customer_number, :method_id
|
515
515
|
|
516
516
|
request = build_request(__method__, options)
|
@@ -531,7 +531,7 @@ module ActiveMerchant #:nodoc:
|
|
531
531
|
# ==== Response
|
532
532
|
# * <tt>#message</tt> -- hash of payment method
|
533
533
|
#
|
534
|
-
def update_customer_payment_method(options={})
|
534
|
+
def update_customer_payment_method(options = {})
|
535
535
|
requires! options, :method_id
|
536
536
|
|
537
537
|
request = build_request(__method__, options)
|
@@ -544,7 +544,7 @@ module ActiveMerchant #:nodoc:
|
|
544
544
|
# * <tt>:customer_number</tt>
|
545
545
|
# * <tt>:method_id</tt>
|
546
546
|
#
|
547
|
-
def delete_customer_payment_method(options={})
|
547
|
+
def delete_customer_payment_method(options = {})
|
548
548
|
requires! options, :customer_number, :method_id
|
549
549
|
|
550
550
|
request = build_request(__method__, options)
|
@@ -556,7 +556,7 @@ module ActiveMerchant #:nodoc:
|
|
556
556
|
# ==== Required
|
557
557
|
# * <tt>:customer_number</tt>
|
558
558
|
#
|
559
|
-
def delete_customer(options={})
|
559
|
+
def delete_customer(options = {})
|
560
560
|
requires! options, :customer_number
|
561
561
|
|
562
562
|
request = build_request(__method__, options)
|
@@ -607,7 +607,7 @@ module ActiveMerchant #:nodoc:
|
|
607
607
|
# ==== Response
|
608
608
|
# * <tt>#message</tt> -- transaction response hash
|
609
609
|
#
|
610
|
-
def run_customer_transaction(options={})
|
610
|
+
def run_customer_transaction(options = {})
|
611
611
|
requires! options, :customer_number, :command, :amount
|
612
612
|
|
613
613
|
request = build_request(__method__, options)
|
@@ -671,7 +671,7 @@ module ActiveMerchant #:nodoc:
|
|
671
671
|
# ==== Response
|
672
672
|
# * <tt>#message</tt> -- transaction response hash
|
673
673
|
#
|
674
|
-
def run_transaction(options={})
|
674
|
+
def run_transaction(options = {})
|
675
675
|
request = build_request(__method__, options)
|
676
676
|
commit(__method__, request)
|
677
677
|
end
|
@@ -699,7 +699,7 @@ module ActiveMerchant #:nodoc:
|
|
699
699
|
# ==== Response
|
700
700
|
# * <tt>#message</tt> -- transaction response hash
|
701
701
|
#
|
702
|
-
def post_auth(options={})
|
702
|
+
def post_auth(options = {})
|
703
703
|
requires! options, :authorization_code
|
704
704
|
|
705
705
|
request = build_request(__method__, options)
|
@@ -721,7 +721,7 @@ module ActiveMerchant #:nodoc:
|
|
721
721
|
# ==== Response
|
722
722
|
# * <tt>#message</tt> -- transaction response hash
|
723
723
|
#
|
724
|
-
def capture_transaction(options={})
|
724
|
+
def capture_transaction(options = {})
|
725
725
|
requires! options, :reference_number
|
726
726
|
|
727
727
|
request = build_request(__method__, options)
|
@@ -738,7 +738,7 @@ module ActiveMerchant #:nodoc:
|
|
738
738
|
# ==== Response
|
739
739
|
# * <tt>#message</tt> -- transaction response hash
|
740
740
|
#
|
741
|
-
def void_transaction(options={})
|
741
|
+
def void_transaction(options = {})
|
742
742
|
requires! options, :reference_number
|
743
743
|
|
744
744
|
request = build_request(__method__, options)
|
@@ -757,7 +757,7 @@ module ActiveMerchant #:nodoc:
|
|
757
757
|
# ==== Response
|
758
758
|
# * <tt>#message</tt> -- transaction response hash
|
759
759
|
#
|
760
|
-
def refund_transaction(options={})
|
760
|
+
def refund_transaction(options = {})
|
761
761
|
requires! options, :reference_number, :amount
|
762
762
|
|
763
763
|
request = build_request(__method__, options)
|
@@ -777,7 +777,7 @@ module ActiveMerchant #:nodoc:
|
|
777
777
|
# ==== Response
|
778
778
|
# * <tt>#message</tt> -- transaction response hash
|
779
779
|
#
|
780
|
-
def override_transaction(options={})
|
780
|
+
def override_transaction(options = {})
|
781
781
|
requires! options, :reference_number
|
782
782
|
|
783
783
|
request = build_request(__method__, options)
|
@@ -820,7 +820,7 @@ module ActiveMerchant #:nodoc:
|
|
820
820
|
# ==== Response
|
821
821
|
# * <tt>#message</tt> -- transaction response hash
|
822
822
|
#
|
823
|
-
def run_quick_sale(options={})
|
823
|
+
def run_quick_sale(options = {})
|
824
824
|
requires! options, :reference_number, :amount
|
825
825
|
|
826
826
|
request = build_request(__method__, options)
|
@@ -858,7 +858,7 @@ module ActiveMerchant #:nodoc:
|
|
858
858
|
# ==== Response
|
859
859
|
# * <tt>#message</tt> -- transaction response hash
|
860
860
|
#
|
861
|
-
def run_quick_credit(options={})
|
861
|
+
def run_quick_credit(options = {})
|
862
862
|
requires! options, :reference_number
|
863
863
|
|
864
864
|
request = build_request(__method__, options)
|
@@ -875,7 +875,7 @@ module ActiveMerchant #:nodoc:
|
|
875
875
|
# ==== Response
|
876
876
|
# * <tt>#message</tt> -- transaction hash
|
877
877
|
#
|
878
|
-
def get_transaction(options={})
|
878
|
+
def get_transaction(options = {})
|
879
879
|
requires! options, :reference_number
|
880
880
|
|
881
881
|
request = build_request(__method__, options)
|
@@ -892,7 +892,7 @@ module ActiveMerchant #:nodoc:
|
|
892
892
|
# * <tt>response.message</tt> -- message of the referenced transaction
|
893
893
|
# * <tt>response.authorization</tt> -- same as :reference_number in options
|
894
894
|
#
|
895
|
-
def get_transaction_status(options={})
|
895
|
+
def get_transaction_status(options = {})
|
896
896
|
requires! options, :reference_number
|
897
897
|
|
898
898
|
request = build_request(__method__, options)
|
@@ -990,7 +990,7 @@ module ActiveMerchant #:nodoc:
|
|
990
990
|
# ==== Response
|
991
991
|
# * <tt>#message</tt> -- hash; keys are the field values
|
992
992
|
#
|
993
|
-
def get_transaction_custom(options={})
|
993
|
+
def get_transaction_custom(options = {})
|
994
994
|
requires! options, :reference_number, :fields
|
995
995
|
|
996
996
|
request = build_request(__method__, options)
|
@@ -1005,7 +1005,7 @@ module ActiveMerchant #:nodoc:
|
|
1005
1005
|
# ==== Response
|
1006
1006
|
# * <tt>#message</tt> -- check trace hash
|
1007
1007
|
#
|
1008
|
-
def get_check_trace(options={})
|
1008
|
+
def get_check_trace(options = {})
|
1009
1009
|
requires! options, :reference_number
|
1010
1010
|
|
1011
1011
|
request = build_request(__method__, options)
|
@@ -1078,7 +1078,7 @@ module ActiveMerchant #:nodoc:
|
|
1078
1078
|
end
|
1079
1079
|
end
|
1080
1080
|
|
1081
|
-
def build_customer(soap, options, type, add_customer_data=false)
|
1081
|
+
def build_customer(soap, options, type, add_customer_data = false)
|
1082
1082
|
soap.tag! "ns1:#{type}" do
|
1083
1083
|
build_token soap, options
|
1084
1084
|
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
@@ -1378,7 +1378,7 @@ module ActiveMerchant #:nodoc:
|
|
1378
1378
|
|
1379
1379
|
# Transaction Helpers ===========================================
|
1380
1380
|
|
1381
|
-
def build_transaction_request_object(soap, options, name='Params')
|
1381
|
+
def build_transaction_request_object(soap, options, name = 'Params')
|
1382
1382
|
soap.tag! name, 'xsi:type' => 'ns1:TransactionRequestObject' do
|
1383
1383
|
TRANSACTION_REQUEST_OBJECT_OPTIONS.each do |k, v|
|
1384
1384
|
build_tag soap, v[0], v[1], options[k]
|