activemerchant 1.105.0 → 1.107.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +99 -1
- data/README.md +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +12 -3
- data/lib/active_merchant/billing/gateway.rb +22 -22
- data/lib/active_merchant/billing/gateways/adyen.rb +18 -7
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -19
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +11 -11
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +35 -35
- data/lib/active_merchant/billing/gateways/axcessms.rb +3 -3
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
- data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
- data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/be2bill.rb +4 -4
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +27 -27
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +8 -8
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -2
- data/lib/active_merchant/billing/gateways/bogus.rb +20 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +17 -6
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +81 -77
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
- data/lib/active_merchant/billing/gateways/card_stream.rb +19 -19
- data/lib/active_merchant/billing/gateways/cc5.rb +7 -7
- data/lib/active_merchant/billing/gateways/cecabank.rb +3 -3
- data/lib/active_merchant/billing/gateways/cenpos.rb +3 -3
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +20 -9
- data/lib/active_merchant/billing/gateways/clearhaus.rb +1 -1
- data/lib/active_merchant/billing/gateways/commercegate.rb +2 -2
- data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
- data/lib/active_merchant/billing/gateways/creditcall.rb +4 -4
- data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +154 -91
- data/lib/active_merchant/billing/gateways/d_local.rb +4 -2
- data/lib/active_merchant/billing/gateways/data_cash.rb +33 -33
- data/lib/active_merchant/billing/gateways/decidir.rb +7 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +14 -2
- data/lib/active_merchant/billing/gateways/efsnet.rb +23 -23
- data/lib/active_merchant/billing/gateways/elavon.rb +70 -18
- data/lib/active_merchant/billing/gateways/element.rb +12 -4
- data/lib/active_merchant/billing/gateways/epay.rb +40 -40
- data/lib/active_merchant/billing/gateways/evo_ca.rb +11 -11
- data/lib/active_merchant/billing/gateways/eway.rb +3 -3
- data/lib/active_merchant/billing/gateways/eway_managed.rb +40 -40
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +7 -7
- data/lib/active_merchant/billing/gateways/exact.rb +11 -11
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +3 -2
- data/lib/active_merchant/billing/gateways/federated_canada.rb +5 -5
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +21 -21
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +20 -20
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/forte.rb +8 -7
- data/lib/active_merchant/billing/gateways/garanti.rb +8 -8
- data/lib/active_merchant/billing/gateways/global_collect.rb +30 -24
- data/lib/active_merchant/billing/gateways/hdfc.rb +3 -3
- data/lib/active_merchant/billing/gateways/hps.rb +5 -3
- data/lib/active_merchant/billing/gateways/iats_payments.rb +32 -15
- data/lib/active_merchant/billing/gateways/inspire.rb +7 -7
- data/lib/active_merchant/billing/gateways/instapay.rb +3 -3
- data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
- data/lib/active_merchant/billing/gateways/iridium.rb +12 -10
- data/lib/active_merchant/billing/gateways/itransact.rb +7 -7
- data/lib/active_merchant/billing/gateways/iveri.rb +6 -3
- data/lib/active_merchant/billing/gateways/ixopay.rb +22 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +5 -5
- data/lib/active_merchant/billing/gateways/kushki.rb +34 -5
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +62 -62
- data/lib/active_merchant/billing/gateways/litle.rb +8 -3
- data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +5 -5
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +4 -4
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -12
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -11
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +12 -2
- data/lib/active_merchant/billing/gateways/mercury.rb +9 -9
- data/lib/active_merchant/billing/gateways/metrics_global.rb +15 -15
- data/lib/active_merchant/billing/gateways/migs.rb +13 -13
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +7 -7
- data/lib/active_merchant/billing/gateways/monei.rb +19 -19
- data/lib/active_merchant/billing/gateways/moneris.rb +10 -10
- data/lib/active_merchant/billing/gateways/money_movers.rb +5 -5
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +15 -15
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/net_registry.rb +6 -6
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +14 -14
- data/lib/active_merchant/billing/gateways/netbilling.rb +12 -12
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +5 -5
- data/lib/active_merchant/billing/gateways/ogone.rb +7 -7
- data/lib/active_merchant/billing/gateways/openpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/opp.rb +13 -7
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +13 -9
- data/lib/active_merchant/billing/gateways/orbital.rb +54 -12
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +16 -16
- data/lib/active_merchant/billing/gateways/pay_junction.rb +16 -16
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +18 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -6
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +36 -36
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -12
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payment_express.rb +9 -9
- data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +5 -5
- data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +3 -3
- data/lib/active_merchant/billing/gateways/payway.rb +12 -12
- data/lib/active_merchant/billing/gateways/pin.rb +16 -16
- data/lib/active_merchant/billing/gateways/plugnpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/psigate.rb +26 -26
- data/lib/active_merchant/billing/gateways/psl_card.rb +4 -4
- data/lib/active_merchant/billing/gateways/qbms.rb +23 -23
- data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +95 -95
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +9 -9
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +2 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +17 -10
- data/lib/active_merchant/billing/gateways/redsys.rb +24 -16
- data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage.rb +10 -10
- data/lib/active_merchant/billing/gateways/sage_pay.rb +35 -35
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_net.rb +9 -9
- data/lib/active_merchant/billing/gateways/secure_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +16 -16
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
- data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -8
- data/lib/active_merchant/billing/gateways/smart_ps.rb +16 -16
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -4
- data/lib/active_merchant/billing/gateways/stripe.rb +15 -10
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +50 -9
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +2 -2
- data/lib/active_merchant/billing/gateways/trans_first.rb +4 -4
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +19 -19
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +110 -110
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +29 -29
- data/lib/active_merchant/billing/gateways/verifi.rb +10 -10
- data/lib/active_merchant/billing/gateways/viaklix.rb +6 -6
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +6 -6
- data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/wirecard.rb +6 -6
- data/lib/active_merchant/billing/gateways/worldpay.rb +22 -20
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +32 -32
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/connection.rb +1 -1
- data/lib/active_merchant/network_connection_retries.rb +3 -3
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +75 -0
- data/lib/support/ssl_verify.rb +2 -2
- data/lib/support/ssl_version.rb +2 -2
- metadata +4 -4
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
self.test_url = 'https://process.sandbox.safecharge.com/service.asmx/Process'
|
7
7
|
self.live_url = 'https://process.safecharge.com/service.asmx/Process'
|
8
8
|
|
9
|
-
self.supported_countries = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'GR', 'ES', 'FI', 'FR', 'HR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'GB', 'US']
|
9
|
+
self.supported_countries = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'GR', 'ES', 'FI', 'FR', 'GI', 'HK', 'HR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SG', 'SI', 'SK', 'GB', 'US']
|
10
10
|
self.default_currency = 'USD'
|
11
11
|
self.supported_cardtypes = [:visa, :master]
|
12
12
|
|
@@ -11,12 +11,12 @@ module ActiveMerchant #:nodoc:
|
|
11
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
|
12
12
|
|
13
13
|
TRANSACTIONS = {
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
14
|
+
purchase: '01',
|
15
|
+
authorization: '02',
|
16
|
+
capture: '11',
|
17
|
+
void: '04',
|
18
|
+
credit: '06',
|
19
|
+
refund: '10'
|
20
20
|
}
|
21
21
|
|
22
22
|
SOURCE_CARD = 'bankcard'
|
@@ -261,10 +261,10 @@ module ActiveMerchant #:nodoc:
|
|
261
261
|
response = parse(ssl_post(url, post_data(action, params)), source)
|
262
262
|
|
263
263
|
Response.new(success?(response), response[:message], response,
|
264
|
-
:
|
265
|
-
:
|
266
|
-
:
|
267
|
-
:
|
264
|
+
test: test?,
|
265
|
+
authorization: authorization_from(response, source),
|
266
|
+
avs_result: { code: response[:avs_result] },
|
267
|
+
cvv_result: response[:cvv_result]
|
268
268
|
)
|
269
269
|
end
|
270
270
|
|
@@ -13,26 +13,26 @@ module ActiveMerchant #:nodoc:
|
|
13
13
|
APPROVED = 'OK'
|
14
14
|
|
15
15
|
TRANSACTIONS = {
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
16
|
+
purchase: 'PAYMENT',
|
17
|
+
credit: 'REFUND',
|
18
|
+
authorization: 'DEFERRED',
|
19
|
+
capture: 'RELEASE',
|
20
|
+
void: 'VOID',
|
21
|
+
abort: 'ABORT',
|
22
|
+
store: 'TOKEN',
|
23
|
+
unstore: 'REMOVETOKEN',
|
24
|
+
repeat: 'REPEAT'
|
25
25
|
}
|
26
26
|
|
27
27
|
CREDIT_CARDS = {
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
28
|
+
visa: 'VISA',
|
29
|
+
master: 'MC',
|
30
|
+
delta: 'DELTA',
|
31
|
+
maestro: 'MAESTRO',
|
32
|
+
american_express: 'AMEX',
|
33
|
+
electron: 'UKE',
|
34
|
+
diners_club: 'DC',
|
35
|
+
jcb: 'JCB'
|
36
36
|
}
|
37
37
|
|
38
38
|
AVS_CODE = {
|
@@ -213,18 +213,18 @@ module ActiveMerchant #:nodoc:
|
|
213
213
|
|
214
214
|
def add_amount(post, money, options)
|
215
215
|
currency = options[:currency] || currency(money)
|
216
|
-
add_pair(post, :Amount, localized_amount(money, currency), :
|
217
|
-
add_pair(post, :Currency, currency, :
|
216
|
+
add_pair(post, :Amount, localized_amount(money, currency), required: true)
|
217
|
+
add_pair(post, :Currency, currency, required: true)
|
218
218
|
end
|
219
219
|
|
220
220
|
def add_currency(post, money, options)
|
221
221
|
currency = options[:currency] || currency(money)
|
222
|
-
add_pair(post, :Currency, currency, :
|
222
|
+
add_pair(post, :Currency, currency, required: true)
|
223
223
|
end
|
224
224
|
|
225
225
|
# doesn't actually use the currency -- dodgy!
|
226
226
|
def add_release_amount(post, money, options)
|
227
|
-
add_pair(post, :ReleaseAmount, amount(money), :
|
227
|
+
add_pair(post, :ReleaseAmount, amount(money), required: true)
|
228
228
|
end
|
229
229
|
|
230
230
|
def add_customer_data(post, options)
|
@@ -269,7 +269,7 @@ module ActiveMerchant #:nodoc:
|
|
269
269
|
end
|
270
270
|
|
271
271
|
def add_invoice(post, options)
|
272
|
-
add_pair(post, :VendorTxCode, sanitize_order_id(options[:order_id]), :
|
272
|
+
add_pair(post, :VendorTxCode, sanitize_order_id(options[:order_id]), required: true)
|
273
273
|
add_pair(post, :Description, truncate(options[:description] || options[:order_id], 100))
|
274
274
|
end
|
275
275
|
|
@@ -286,10 +286,10 @@ module ActiveMerchant #:nodoc:
|
|
286
286
|
end
|
287
287
|
|
288
288
|
def add_credit_card(post, credit_card)
|
289
|
-
add_pair(post, :CardHolder, truncate(credit_card.name, 50), :
|
290
|
-
add_pair(post, :CardNumber, credit_card.number, :
|
289
|
+
add_pair(post, :CardHolder, truncate(credit_card.name, 50), required: true)
|
290
|
+
add_pair(post, :CardNumber, credit_card.number, required: true)
|
291
291
|
|
292
|
-
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), :
|
292
|
+
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), required: true)
|
293
293
|
add_pair(post, :CardType, map_card_type(credit_card))
|
294
294
|
|
295
295
|
add_pair(post, :CV2, credit_card.verification_value)
|
@@ -347,13 +347,13 @@ module ActiveMerchant #:nodoc:
|
|
347
347
|
response = parse(ssl_post(url_for(action), post_data(action, parameters)))
|
348
348
|
|
349
349
|
Response.new(response['Status'] == APPROVED, message_from(response), response,
|
350
|
-
:
|
351
|
-
:
|
352
|
-
:
|
353
|
-
:
|
354
|
-
:
|
350
|
+
test: test?,
|
351
|
+
authorization: authorization_from(response, parameters, action),
|
352
|
+
avs_result: {
|
353
|
+
street_match: AVS_CODE[response['AddressResult']],
|
354
|
+
postal_match: AVS_CODE[response['PostCodeResult']],
|
355
355
|
},
|
356
|
-
:
|
356
|
+
cvv_result: CVV_CODE[response['CV2Result']]
|
357
357
|
)
|
358
358
|
end
|
359
359
|
|
@@ -400,12 +400,12 @@ module ActiveMerchant #:nodoc:
|
|
400
400
|
|
401
401
|
def post_data(action, parameters = {})
|
402
402
|
parameters.update(
|
403
|
-
:
|
404
|
-
:
|
405
|
-
:
|
403
|
+
Vendor: @options[:login],
|
404
|
+
TxType: TRANSACTIONS[action],
|
405
|
+
VPSProtocol: @options.fetch(:protocol_version, '3.00')
|
406
406
|
)
|
407
407
|
|
408
|
-
parameters.update(:
|
408
|
+
parameters.update(ReferrerID: application_id) if application_id && (application_id != Gateway.application_id)
|
409
409
|
|
410
410
|
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
411
411
|
end
|
@@ -121,8 +121,8 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
|
122
122
|
response = parse(ssl_post(self.live_url, parameters.to_post_data) || '')
|
123
123
|
Response.new(successful?(response), message_from(response), response,
|
124
|
-
:
|
125
|
-
:
|
124
|
+
test: test?,
|
125
|
+
authorization: response['refcode']
|
126
126
|
)
|
127
127
|
end
|
128
128
|
|
@@ -4,11 +4,11 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
API_VERSION = '4.0'
|
5
5
|
|
6
6
|
TRANSACTIONS = {
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
7
|
+
auth_only: '0000',
|
8
|
+
auth_capture: '0100',
|
9
|
+
prior_auth_capture: '0200',
|
10
|
+
void: '0400',
|
11
|
+
credit: '0500'
|
12
12
|
}
|
13
13
|
|
14
14
|
XML_ATTRIBUTES = {
|
@@ -80,10 +80,10 @@ module ActiveMerchant #:nodoc:
|
|
80
80
|
response = parse(data)
|
81
81
|
|
82
82
|
Response.new(success?(response), message_from(response), response,
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
83
|
+
test: test?,
|
84
|
+
authorization: build_authorization(response),
|
85
|
+
avs_result: { code: response[:avs_result_code] },
|
86
|
+
cvv_result: response[:card_code_response_code]
|
87
87
|
)
|
88
88
|
end
|
89
89
|
|
@@ -57,11 +57,11 @@ module ActiveMerchant #:nodoc:
|
|
57
57
|
message = message_from(response)
|
58
58
|
|
59
59
|
Response.new(success?(response), message, response,
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
60
|
+
test: test?,
|
61
|
+
authorization: response[:transaction_id],
|
62
|
+
fraud_review: fraud_review?(response),
|
63
|
+
avs_result: { code: response[:avs_result_code] },
|
64
|
+
cvv_result: response[:card_code]
|
65
65
|
)
|
66
66
|
end
|
67
67
|
|
@@ -77,14 +77,14 @@ module ActiveMerchant #:nodoc:
|
|
77
77
|
fields = split(body)
|
78
78
|
|
79
79
|
results = {
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
80
|
+
response_code: fields[RESPONSE_CODE].to_i,
|
81
|
+
response_reason_code: fields[RESPONSE_REASON_CODE],
|
82
|
+
response_reason_text: fields[RESPONSE_REASON_TEXT],
|
83
|
+
avs_result_code: fields[AVS_RESULT_CODE],
|
84
|
+
transaction_id: fields[TRANSACTION_ID],
|
85
|
+
card_code: fields[CARD_CODE_RESPONSE_CODE],
|
86
|
+
authorization_code: fields[AUTHORIZATION_CODE],
|
87
|
+
cardholder_authentication_code: fields[CARDHOLDER_AUTH_CODE]
|
88
88
|
}
|
89
89
|
results
|
90
90
|
end
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
|
9
9
|
class_attribute :test_periodic_url, :live_periodic_url
|
10
10
|
|
11
|
-
self.test_url = 'https://api.securepay.com.au/
|
11
|
+
self.test_url = 'https://test.api.securepay.com.au/xmlapi/payment'
|
12
12
|
self.live_url = 'https://api.securepay.com.au/xmlapi/payment'
|
13
13
|
|
14
14
|
self.test_periodic_url = 'https://test.securepay.com.au/xmlapi/periodic'
|
@@ -35,23 +35,23 @@ module ActiveMerchant #:nodoc:
|
|
35
35
|
# 10 Preauthorise
|
36
36
|
# 11 Preauth Complete (Advice)
|
37
37
|
TRANSACTIONS = {
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
38
|
+
purchase: 0,
|
39
|
+
authorization: 10,
|
40
|
+
capture: 11,
|
41
|
+
void: 6,
|
42
|
+
refund: 4
|
43
43
|
}
|
44
44
|
|
45
45
|
PERIODIC_ACTIONS = {
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
46
|
+
add_triggered: 'add',
|
47
|
+
remove_triggered: 'delete',
|
48
|
+
trigger: 'trigger'
|
49
49
|
}
|
50
50
|
|
51
51
|
PERIODIC_TYPES = {
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
52
|
+
add_triggered: 4,
|
53
|
+
remove_triggered: nil,
|
54
|
+
trigger: nil
|
55
55
|
}
|
56
56
|
|
57
57
|
SUCCESS_CODES = ['00', '08', '11', '16', '77']
|
@@ -184,8 +184,8 @@ module ActiveMerchant #:nodoc:
|
|
184
184
|
response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(action, request)))
|
185
185
|
|
186
186
|
Response.new(success?(response), message_from(response), response,
|
187
|
-
:
|
188
|
-
:
|
187
|
+
test: test?,
|
188
|
+
authorization: authorization_from(response)
|
189
189
|
)
|
190
190
|
end
|
191
191
|
|
@@ -241,8 +241,8 @@ module ActiveMerchant #:nodoc:
|
|
241
241
|
response = parse(ssl_post(test? ? self.test_periodic_url : self.live_periodic_url, my_request))
|
242
242
|
|
243
243
|
Response.new(success?(response), message_from(response), response,
|
244
|
-
:
|
245
|
-
:
|
244
|
+
test: test?,
|
245
|
+
authorization: authorization_from(response)
|
246
246
|
)
|
247
247
|
end
|
248
248
|
|
@@ -85,8 +85,8 @@ module ActiveMerchant #:nodoc:
|
|
85
85
|
response = parse(ssl_post(self.live_url, post_data(action, post)))
|
86
86
|
|
87
87
|
Response.new(response[:result_code] == 1, message_from(response), response,
|
88
|
-
:
|
89
|
-
:
|
88
|
+
test: test?,
|
89
|
+
authorization: response[:merchant_transaction_reference]
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
@@ -12,9 +12,9 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
ADVANCED_PATH = '/evolvcc/evolvcc.aspx'
|
13
13
|
|
14
14
|
ACTIONS = {
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
15
|
+
authorization: 'AuthorizeAPI',
|
16
|
+
change_status: 'SJAPI_TransactionChangeStatusRequest',
|
17
|
+
get_status: 'SJAPI_TransactionStatusRequest'
|
18
18
|
}
|
19
19
|
|
20
20
|
SUCCESS_MESSAGE = 'The transaction was successful.'
|
@@ -242,7 +242,7 @@ module ActiveMerchant #:nodoc:
|
|
242
242
|
end
|
243
243
|
|
244
244
|
def status(order_id)
|
245
|
-
commit(:get_status, nil, :
|
245
|
+
commit(:get_status, nil, szOrderNumber: order_id)
|
246
246
|
end
|
247
247
|
|
248
248
|
private
|
@@ -264,10 +264,10 @@ module ActiveMerchant #:nodoc:
|
|
264
264
|
|
265
265
|
# Pass along the original transaction id in the case an update transaction
|
266
266
|
Response.new(response[:success], message_from(response, action), response,
|
267
|
-
:
|
268
|
-
:
|
269
|
-
:
|
270
|
-
:
|
267
|
+
test: test?,
|
268
|
+
authorization: response[:szTransactionFileName] || parameters[:szTransactionId],
|
269
|
+
avs_result: { code: response[:szAVSResponseCode] },
|
270
|
+
cvv_result: response[:szCVV2ResponseCode]
|
271
271
|
)
|
272
272
|
end
|
273
273
|
|
@@ -47,13 +47,13 @@ module ActiveMerchant #:nodoc:
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def capture(money, authorization, options = {})
|
50
|
-
post ={}
|
50
|
+
post = {}
|
51
51
|
post[:transactionid] = authorization
|
52
52
|
commit('capture', money, post)
|
53
53
|
end
|
54
54
|
|
55
55
|
def void(authorization, options = {})
|
56
|
-
post ={}
|
56
|
+
post = {}
|
57
57
|
post[:transactionid] = authorization
|
58
58
|
commit('void', nil, post)
|
59
59
|
end
|
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
|
|
117
117
|
def store(payment_source, options = {})
|
118
118
|
post = {}
|
119
119
|
billing_id = options.delete(:billing_id).to_s || true
|
120
|
-
add_payment_source(post, payment_source, :
|
120
|
+
add_payment_source(post, payment_source, store: billing_id)
|
121
121
|
add_address(post, options[:billing_address] || options[:address])
|
122
122
|
add_customer_data(post, options)
|
123
123
|
commit(nil, nil, post)
|
@@ -134,16 +134,16 @@ module ActiveMerchant #:nodoc:
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def add_address(post, address, prefix='')
|
137
|
-
prefix +='_' unless prefix.blank?
|
137
|
+
prefix += '_' unless prefix.blank?
|
138
138
|
unless address.blank? or address.values.blank?
|
139
|
-
post[prefix+'address1'] = address[:address1].to_s
|
140
|
-
post[prefix+'address2'] = address[:address2].to_s unless address[:address2].blank?
|
141
|
-
post[prefix+'company'] = address[:company].to_s
|
142
|
-
post[prefix+'phone'] = address[:phone].to_s
|
143
|
-
post[prefix+'zip'] = address[:zip].to_s
|
144
|
-
post[prefix+'city'] = address[:city].to_s
|
145
|
-
post[prefix+'country'] = address[:country].to_s
|
146
|
-
post[prefix+'state'] = address[:state].blank? ? 'n/a' : address[:state]
|
139
|
+
post[prefix + 'address1'] = address[:address1].to_s
|
140
|
+
post[prefix + 'address2'] = address[:address2].to_s unless address[:address2].blank?
|
141
|
+
post[prefix + 'company'] = address[:company].to_s
|
142
|
+
post[prefix + 'phone'] = address[:phone].to_s
|
143
|
+
post[prefix + 'zip'] = address[:zip].to_s
|
144
|
+
post[prefix + 'city'] = address[:city].to_s
|
145
|
+
post[prefix + 'country'] = address[:country].to_s
|
146
|
+
post[prefix + 'state'] = address[:state].blank? ? 'n/a' : address[:state]
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -227,10 +227,10 @@ module ActiveMerchant #:nodoc:
|
|
227
227
|
parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
|
228
228
|
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
229
229
|
Response.new(response['response'] == '1', message_from(response), response,
|
230
|
-
:
|
231
|
-
:
|
232
|
-
:
|
233
|
-
:
|
230
|
+
authorization: (response['transactionid'] || response['customer_vault_id']),
|
231
|
+
test: test?,
|
232
|
+
cvv_result: response['cvvresponse'],
|
233
|
+
avs_result: { code: response['avsresponse'] }
|
234
234
|
)
|
235
235
|
end
|
236
236
|
|
@@ -164,13 +164,13 @@ module ActiveMerchant #:nodoc:
|
|
164
164
|
return Response.new(response['errorcode'] == '000',
|
165
165
|
response['errormessage'],
|
166
166
|
response,
|
167
|
-
:
|
168
|
-
:
|
167
|
+
test: test?,
|
168
|
+
authorization: response['transaction_id'])
|
169
169
|
end
|
170
170
|
|
171
171
|
def build_soap(request)
|
172
|
-
retval = Builder::XmlMarkup.new(:
|
173
|
-
retval.instruct!(:xml, :
|
172
|
+
retval = Builder::XmlMarkup.new(indent: 2)
|
173
|
+
retval.instruct!(:xml, version: '1.0', encoding: 'utf-8')
|
174
174
|
retval.tag!('soap:Envelope', {
|
175
175
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
176
176
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
@@ -179,9 +179,9 @@ module ActiveMerchant #:nodoc:
|
|
179
179
|
'xmlns:types' => 'urn:Interface/encodedTypes',
|
180
180
|
'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'
|
181
181
|
}) do
|
182
|
-
retval.tag!('soap:Body', {'soap:encodingStyle'=>'http://schemas.xmlsoap.org/soap/encoding/'}) do
|
182
|
+
retval.tag!('soap:Body', {'soap:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'}) do
|
183
183
|
retval.tag!("tns:#{request}") do
|
184
|
-
retval.tag!("#{request}Request", {'xsi:type'=>"tns:#{request}Request"}) do
|
184
|
+
retval.tag!("#{request}Request", {'xsi:type' => "tns:#{request}Request"}) do
|
185
185
|
yield retval
|
186
186
|
end
|
187
187
|
end
|