activemerchant 1.79.2 → 1.129.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +1391 -0
- data/README.md +29 -14
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +55 -22
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +82 -62
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +328 -58
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +61 -56
- data/lib/active_merchant/billing/gateways/adyen.rb +562 -87
- data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
- data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +35 -36
- data/lib/active_merchant/billing/gateways/authorize_net.rb +297 -196
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +94 -98
- data/lib/active_merchant/billing/gateways/axcessms.rb +64 -66
- data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
- data/lib/active_merchant/billing/gateways/banwire.rb +12 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +140 -69
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
- data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +115 -115
- data/lib/active_merchant/billing/gateways/beanstream.rb +39 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +87 -58
- data/lib/active_merchant/billing/gateways/blue_snap.rb +405 -104
- data/lib/active_merchant/billing/gateways/bogus.rb +34 -30
- data/lib/active_merchant/billing/gateways/borgun.rb +97 -47
- data/lib/active_merchant/billing/gateways/bpoint.rb +20 -20
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -3
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +561 -259
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +53 -54
- data/lib/active_merchant/billing/gateways/cams.rb +31 -31
- data/lib/active_merchant/billing/gateways/card_connect.rb +85 -33
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +187 -169
- data/lib/active_merchant/billing/gateways/cardknox.rb +24 -25
- data/lib/active_merchant/billing/gateways/cardprocess.rb +9 -7
- data/lib/active_merchant/billing/gateways/cashnet.rb +43 -27
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +62 -52
- data/lib/active_merchant/billing/gateways/cenpos.rb +63 -62
- data/lib/active_merchant/billing/gateways/checkout.rb +21 -23
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +391 -113
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -3
- data/lib/active_merchant/billing/gateways/clearhaus.rb +40 -41
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +361 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +35 -30
- data/lib/active_merchant/billing/gateways/creditcall.rb +59 -59
- data/lib/active_merchant/billing/gateways/credorax.rb +326 -145
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +53 -53
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +566 -208
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +456 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +342 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +40 -56
- data/lib/active_merchant/billing/gateways/decidir.rb +358 -0
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +34 -40
- data/lib/active_merchant/billing/gateways/digitzs.rb +48 -45
- data/lib/active_merchant/billing/gateways/ebanx.rb +110 -60
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +351 -189
- data/lib/active_merchant/billing/gateways/element.rb +106 -56
- data/lib/active_merchant/billing/gateways/epay.rb +74 -64
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +74 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +105 -60
- data/lib/active_merchant/billing/gateways/exact.rb +29 -37
- data/lib/active_merchant/billing/gateways/ezic.rb +21 -22
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +70 -48
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -4
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +33 -13
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +106 -105
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +36 -36
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +70 -40
- data/lib/active_merchant/billing/gateways/garanti.rb +24 -31
- data/lib/active_merchant/billing/gateways/global_collect.rb +378 -154
- data/lib/active_merchant/billing/gateways/global_transport.rb +12 -13
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +236 -69
- data/lib/active_merchant/billing/gateways/iats_payments.rb +61 -39
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +41 -47
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +25 -24
- data/lib/active_merchant/billing/gateways/iridium.rb +243 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +73 -34
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +145 -152
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +154 -159
- data/lib/active_merchant/billing/gateways/komoju.rb +16 -16
- data/lib/active_merchant/billing/gateways/kushki.rb +127 -57
- data/lib/active_merchant/billing/gateways/latitude19.rb +111 -115
- data/lib/active_merchant/billing/gateways/linkpoint.rb +82 -85
- data/lib/active_merchant/billing/gateways/litle.rb +247 -53
- data/lib/active_merchant/billing/gateways/mastercard.rb +41 -23
- data/lib/active_merchant/billing/gateways/maxipago.rb +5 -5
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +135 -49
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +62 -29
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +40 -40
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +42 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +52 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +47 -51
- data/lib/active_merchant/billing/gateways/metrics_global.rb +32 -42
- data/lib/active_merchant/billing/gateways/micropayment.rb +42 -45
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +45 -40
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +29 -31
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +255 -138
- data/lib/active_merchant/billing/gateways/moneris.rb +226 -88
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +117 -43
- data/lib/active_merchant/billing/gateways/nab_transact.rb +28 -31
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +13 -15
- data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
- data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
- data/lib/active_merchant/billing/gateways/netbanx.rb +167 -80
- data/lib/active_merchant/billing/gateways/netbilling.rb +27 -30
- data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
- data/lib/active_merchant/billing/gateways/nmi.rb +134 -48
- data/lib/active_merchant/billing/gateways/ogone.rb +88 -58
- data/lib/active_merchant/billing/gateways/omise.rb +30 -31
- data/lib/active_merchant/billing/gateways/openpay.rb +45 -26
- data/lib/active_merchant/billing/gateways/opp.rb +166 -144
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +67 -64
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +726 -382
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +26 -27
- data/lib/active_merchant/billing/gateways/pagarme.rb +47 -56
- data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +39 -40
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +65 -65
- data/lib/active_merchant/billing/gateways/pay_hub.rb +39 -39
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +70 -54
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +71 -47
- data/lib/active_merchant/billing/gateways/payeezy.rb +159 -32
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +41 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +178 -54
- data/lib/active_merchant/billing/gateways/payflow_express.rb +61 -65
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +0 -1
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +66 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +114 -25
- data/lib/active_merchant/billing/gateways/paymill.rb +134 -133
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +27 -14
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +5 -2
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +79 -82
- data/lib/active_merchant/billing/gateways/payu_in.rb +59 -58
- data/lib/active_merchant/billing/gateways/payu_latam.rb +139 -97
- data/lib/active_merchant/billing/gateways/payway.rb +27 -27
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +87 -34
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +139 -140
- data/lib/active_merchant/billing/gateways/psigate.rb +44 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +29 -37
- data/lib/active_merchant/billing/gateways/qbms.rb +75 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- data/lib/active_merchant/billing/gateways/quickbooks.rb +142 -55
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +103 -107
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +156 -158
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +7 -8
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +137 -68
- data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
- data/lib/active_merchant/billing/gateways/reach.rb +277 -0
- data/lib/active_merchant/billing/gateways/realex.rb +132 -50
- data/lib/active_merchant/billing/gateways/redsys.rb +382 -186
- data/lib/active_merchant/billing/gateways/s5.rb +16 -16
- data/lib/active_merchant/billing/gateways/safe_charge.rb +83 -47
- data/lib/active_merchant/billing/gateways/sage.rb +49 -48
- data/lib/active_merchant/billing/gateways/sage_pay.rb +76 -83
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +32 -40
- data/lib/active_merchant/billing/gateways/secure_pay.rb +30 -40
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +23 -26
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +69 -31
- data/lib/active_merchant/billing/gateways/shift4.rb +342 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -53
- data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +66 -47
- data/lib/active_merchant/billing/gateways/stripe.rb +309 -148
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +556 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +18 -23
- data/lib/active_merchant/billing/gateways/telr.rb +46 -48
- data/lib/active_merchant/billing/gateways/tns.rb +8 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +37 -37
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +249 -245
- data/lib/active_merchant/billing/gateways/transact_pro.rb +25 -27
- data/lib/active_merchant/billing/gateways/transax.rb +6 -8
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +22 -18
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +161 -88
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +231 -238
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +129 -55
- data/lib/active_merchant/billing/gateways/vanco.rb +42 -33
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +18 -22
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +115 -74
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +38 -41
- data/lib/active_merchant/billing/gateways/wirecard.rb +36 -37
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +39 -38
- data/lib/active_merchant/billing/gateways/worldpay.rb +756 -142
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +73 -83
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +31 -31
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +3 -3
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +32 -13
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +24 -38
- data/lib/active_merchant/country.rb +9 -5
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +2 -0
- data/lib/active_merchant/network_connection_retries.rb +28 -31
- data/lib/active_merchant/post_data.rb +5 -3
- data/lib/active_merchant/posts_data.rb +5 -7
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +3 -3
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +1592 -2329
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +9 -10
- metadata +98 -37
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -309
@@ -13,49 +13,47 @@ 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
|
-
:
|
36
|
-
:diners_club => "DC",
|
37
|
-
:jcb => "JCB"
|
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'
|
38
36
|
}
|
39
37
|
|
40
38
|
AVS_CODE = {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
'NOTPROVIDED' => nil,
|
40
|
+
'NOTCHECKED' => 'X',
|
41
|
+
'MATCHED' => 'Y',
|
42
|
+
'NOTMATCHED' => 'N'
|
45
43
|
}
|
46
44
|
|
47
45
|
CVV_CODE = {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
'NOTPROVIDED' => 'S',
|
47
|
+
'NOTCHECKED' => 'X',
|
48
|
+
'MATCHED' => 'M',
|
49
|
+
'NOTMATCHED' => 'N'
|
52
50
|
}
|
53
51
|
|
54
52
|
OPTIONAL_REQUEST_FIELDS = {
|
55
53
|
paypal_callback_url: :PayPalCallbackURL,
|
56
54
|
basket: :Basket,
|
57
|
-
gift_aid_payment: :GiftAidPayment
|
58
|
-
apply_avscv2: :ApplyAVSCV2
|
55
|
+
gift_aid_payment: :GiftAidPayment,
|
56
|
+
apply_avscv2: :ApplyAVSCV2,
|
59
57
|
apply_3d_secure: :Apply3DSecure,
|
60
58
|
account_type: :AccountType,
|
61
59
|
billing_agreement: :BillingAgreement,
|
@@ -65,14 +63,14 @@ module ActiveMerchant #:nodoc:
|
|
65
63
|
vendor_data: :VendorData,
|
66
64
|
language: :Language,
|
67
65
|
website: :Website,
|
68
|
-
recipient_account_number: :FIRecipientAcctNumber
|
69
|
-
recipient_surname: :FIRecipientSurname
|
70
|
-
recipient_postcode: :FIRecipientPostcode
|
66
|
+
recipient_account_number: :FIRecipientAcctNumber,
|
67
|
+
recipient_surname: :FIRecipientSurname,
|
68
|
+
recipient_postcode: :FIRecipientPostcode,
|
71
69
|
recipient_dob: :FIRecipientDoB
|
72
70
|
}
|
73
71
|
|
74
|
-
self.
|
75
|
-
self.
|
72
|
+
self.supported_countries = %w[GB IE]
|
73
|
+
self.supported_cardtypes = %i[visa master american_express discover jcb maestro diners_club]
|
76
74
|
self.default_currency = 'GBP'
|
77
75
|
|
78
76
|
self.homepage_url = 'http://www.sagepay.com'
|
@@ -164,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
164
162
|
commit(:unstore, post)
|
165
163
|
end
|
166
164
|
|
167
|
-
def verify(credit_card, options={})
|
165
|
+
def verify(credit_card, options = {})
|
168
166
|
MultiResponse.run(:use_first_response) do |r|
|
169
167
|
r.process { authorize(100, credit_card, options) }
|
170
168
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -183,6 +181,7 @@ module ActiveMerchant #:nodoc:
|
|
183
181
|
end
|
184
182
|
|
185
183
|
private
|
184
|
+
|
186
185
|
def truncate(value, max_size)
|
187
186
|
return nil unless value
|
188
187
|
return value.to_s if CGI.escape(value.to_s).length <= max_size
|
@@ -214,18 +213,18 @@ module ActiveMerchant #:nodoc:
|
|
214
213
|
|
215
214
|
def add_amount(post, money, options)
|
216
215
|
currency = options[:currency] || currency(money)
|
217
|
-
add_pair(post, :Amount, localized_amount(money, currency), :
|
218
|
-
add_pair(post, :Currency, currency, :
|
216
|
+
add_pair(post, :Amount, localized_amount(money, currency), required: true)
|
217
|
+
add_pair(post, :Currency, currency, required: true)
|
219
218
|
end
|
220
219
|
|
221
220
|
def add_currency(post, money, options)
|
222
221
|
currency = options[:currency] || currency(money)
|
223
|
-
add_pair(post, :Currency, currency, :
|
222
|
+
add_pair(post, :Currency, currency, required: true)
|
224
223
|
end
|
225
224
|
|
226
225
|
# doesn't actually use the currency -- dodgy!
|
227
226
|
def add_release_amount(post, money, options)
|
228
|
-
add_pair(post, :ReleaseAmount, amount(money), :
|
227
|
+
add_pair(post, :ReleaseAmount, amount(money), required: true)
|
229
228
|
end
|
230
229
|
|
231
230
|
def add_customer_data(post, options)
|
@@ -249,7 +248,7 @@ module ActiveMerchant #:nodoc:
|
|
249
248
|
add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
|
250
249
|
add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
|
251
250
|
add_pair(post, :BillingCity, truncate(billing_address[:city], 40))
|
252
|
-
add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if
|
251
|
+
add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if usa?(billing_address[:country])
|
253
252
|
add_pair(post, :BillingCountry, truncate(billing_address[:country], 2))
|
254
253
|
add_pair(post, :BillingPhone, sanitize_phone(billing_address[:phone]))
|
255
254
|
add_pair(post, :BillingPostCode, truncate(billing_address[:zip], 10))
|
@@ -262,7 +261,7 @@ module ActiveMerchant #:nodoc:
|
|
262
261
|
add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
|
263
262
|
add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
|
264
263
|
add_pair(post, :DeliveryCity, truncate(shipping_address[:city], 40))
|
265
|
-
add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if
|
264
|
+
add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if usa?(shipping_address[:country])
|
266
265
|
add_pair(post, :DeliveryCountry, truncate(shipping_address[:country], 2))
|
267
266
|
add_pair(post, :DeliveryPhone, sanitize_phone(shipping_address[:phone]))
|
268
267
|
add_pair(post, :DeliveryPostCode, truncate(shipping_address[:zip], 10))
|
@@ -270,7 +269,7 @@ module ActiveMerchant #:nodoc:
|
|
270
269
|
end
|
271
270
|
|
272
271
|
def add_invoice(post, options)
|
273
|
-
add_pair(post, :VendorTxCode, sanitize_order_id(options[:order_id]), :
|
272
|
+
add_pair(post, :VendorTxCode, sanitize_order_id(options[:order_id]), required: true)
|
274
273
|
add_pair(post, :Description, truncate(options[:description] || options[:order_id], 100))
|
275
274
|
end
|
276
275
|
|
@@ -287,15 +286,10 @@ module ActiveMerchant #:nodoc:
|
|
287
286
|
end
|
288
287
|
|
289
288
|
def add_credit_card(post, credit_card)
|
290
|
-
add_pair(post, :CardHolder, truncate(credit_card.name, 50), :
|
291
|
-
add_pair(post, :CardNumber, credit_card.number, :
|
292
|
-
|
293
|
-
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), :required => true)
|
289
|
+
add_pair(post, :CardHolder, truncate(credit_card.name, 50), required: true)
|
290
|
+
add_pair(post, :CardNumber, credit_card.number, required: true)
|
294
291
|
|
295
|
-
|
296
|
-
add_pair(post, :StartDate, format_date(credit_card.start_month, credit_card.start_year))
|
297
|
-
add_pair(post, :IssueNumber, credit_card.issue_number)
|
298
|
-
end
|
292
|
+
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), required: true)
|
299
293
|
add_pair(post, :CardType, map_card_type(credit_card))
|
300
294
|
|
301
295
|
add_pair(post, :CV2, credit_card.verification_value)
|
@@ -318,16 +312,17 @@ module ActiveMerchant #:nodoc:
|
|
318
312
|
|
319
313
|
def sanitize_phone(phone)
|
320
314
|
return nil unless phone
|
315
|
+
|
321
316
|
cleansed = phone.to_s.gsub(/[^0-9+]/, '')
|
322
317
|
truncate(cleansed, 20)
|
323
318
|
end
|
324
319
|
|
325
|
-
def
|
320
|
+
def usa?(country)
|
326
321
|
truncate(country, 2) == 'US'
|
327
322
|
end
|
328
323
|
|
329
324
|
def map_card_type(credit_card)
|
330
|
-
raise ArgumentError,
|
325
|
+
raise ArgumentError, 'The credit card type must be provided' if card_brand(credit_card).blank?
|
331
326
|
|
332
327
|
card_type = card_brand(credit_card).to_sym
|
333
328
|
|
@@ -342,24 +337,23 @@ module ActiveMerchant #:nodoc:
|
|
342
337
|
def format_date(month, year)
|
343
338
|
return nil if year.blank? || month.blank?
|
344
339
|
|
345
|
-
year = sprintf(
|
346
|
-
month = sprintf(
|
340
|
+
year = sprintf('%.4i', year)
|
341
|
+
month = sprintf('%.2i', month)
|
347
342
|
|
348
343
|
"#{month}#{year[-2..-1]}"
|
349
344
|
end
|
350
345
|
|
351
346
|
def commit(action, parameters)
|
352
|
-
response = parse(
|
353
|
-
|
354
|
-
Response.new(response[
|
355
|
-
:
|
356
|
-
:
|
357
|
-
:
|
358
|
-
:
|
359
|
-
:
|
347
|
+
response = parse(ssl_post(url_for(action), post_data(action, parameters)))
|
348
|
+
|
349
|
+
Response.new(response['Status'] == APPROVED, message_from(response), response,
|
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']]
|
360
355
|
},
|
361
|
-
:
|
362
|
-
)
|
356
|
+
cvv_result: CVV_CODE[response['CV2Result']])
|
363
357
|
end
|
364
358
|
|
365
359
|
def authorization_from(response, params, action)
|
@@ -367,11 +361,11 @@ module ActiveMerchant #:nodoc:
|
|
367
361
|
when :store
|
368
362
|
response['Token']
|
369
363
|
else
|
370
|
-
|
371
|
-
response[
|
372
|
-
response[
|
373
|
-
response[
|
374
|
-
action
|
364
|
+
[params[:VendorTxCode],
|
365
|
+
response['VPSTxId'] || params[:VPSTxId],
|
366
|
+
response['TxAuthNo'],
|
367
|
+
response['SecurityKey'] || params[:SecurityKey],
|
368
|
+
action].join(';')
|
375
369
|
end
|
376
370
|
end
|
377
371
|
|
@@ -385,35 +379,34 @@ module ActiveMerchant #:nodoc:
|
|
385
379
|
end
|
386
380
|
|
387
381
|
def build_url(action)
|
388
|
-
endpoint =
|
389
|
-
|
382
|
+
endpoint =
|
383
|
+
case action
|
384
|
+
when :purchase, :authorization then 'vspdirect-register'
|
390
385
|
when :store then 'directtoken'
|
391
386
|
else TRANSACTIONS[action].downcase
|
392
|
-
|
387
|
+
end
|
393
388
|
"#{test? ? self.test_url : self.live_url}/#{endpoint}.vsp"
|
394
389
|
end
|
395
390
|
|
396
391
|
def build_simulator_url(action)
|
397
|
-
endpoint = [
|
392
|
+
endpoint = %i[purchase authorization].include?(action) ? 'VSPDirectGateway.asp' : "VSPServerGateway.asp?Service=Vendor#{TRANSACTIONS[action].capitalize}Tx"
|
398
393
|
"#{self.simulator_url}/#{endpoint}"
|
399
394
|
end
|
400
395
|
|
401
396
|
def message_from(response)
|
402
|
-
response['Status'] == APPROVED ? 'Success' : (response['StatusDetail'] || 'Unspecified error')
|
397
|
+
response['Status'] == APPROVED ? 'Success' : (response['StatusDetail'] || 'Unspecified error') # simonr 20080207 can't actually get non-nil blanks, so this is shorter
|
403
398
|
end
|
404
399
|
|
405
400
|
def post_data(action, parameters = {})
|
406
401
|
parameters.update(
|
407
|
-
:
|
408
|
-
:
|
409
|
-
:
|
402
|
+
Vendor: @options[:login],
|
403
|
+
TxType: TRANSACTIONS[action],
|
404
|
+
VPSProtocol: @options.fetch(:protocol_version, '3.00')
|
410
405
|
)
|
411
406
|
|
412
|
-
|
413
|
-
parameters.update(:ReferrerID => application_id)
|
414
|
-
end
|
407
|
+
parameters.update(ReferrerID: application_id) if application_id && (application_id != Gateway.application_id)
|
415
408
|
|
416
|
-
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
409
|
+
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
417
410
|
end
|
418
411
|
|
419
412
|
# SagePay returns data in the following format
|
@@ -433,9 +426,9 @@ module ActiveMerchant #:nodoc:
|
|
433
426
|
|
434
427
|
def past_purchase_reference?(payment_method)
|
435
428
|
return false unless payment_method.is_a?(String)
|
436
|
-
|
429
|
+
|
430
|
+
%w(purchase repeat).include?(payment_method.split(';').last)
|
437
431
|
end
|
438
432
|
end
|
439
|
-
|
440
433
|
end
|
441
434
|
end
|
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.supported_countries = ['US']
|
8
8
|
|
9
9
|
# The card types supported by the payment gateway
|
10
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
11
11
|
|
12
12
|
# The homepage URL of the gateway
|
13
13
|
self.homepage_url = 'http://www.salliemae.com/'
|
@@ -21,7 +21,7 @@ module ActiveMerchant #:nodoc:
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test?
|
24
|
-
@options[:login] ==
|
24
|
+
@options[:login] == 'TEST0'
|
25
25
|
end
|
26
26
|
|
27
27
|
def authorize(money, creditcard, options = {})
|
@@ -94,11 +94,11 @@ module ActiveMerchant #:nodoc:
|
|
94
94
|
|
95
95
|
def parse(body)
|
96
96
|
h = {}
|
97
|
-
body.gsub!(
|
97
|
+
body.gsub!('<html><body><plaintext>', '')
|
98
98
|
body.
|
99
99
|
split("\r\n").
|
100
100
|
map do |i|
|
101
|
-
a = i.split(
|
101
|
+
a = i.split('=')
|
102
102
|
h[a.first] = a.last unless a.first.nil?
|
103
103
|
end
|
104
104
|
h
|
@@ -111,33 +111,31 @@ module ActiveMerchant #:nodoc:
|
|
111
111
|
|
112
112
|
case action
|
113
113
|
when :sale
|
114
|
-
parameters[:action] =
|
114
|
+
parameters[:action] = 'ns_quicksale_cc'
|
115
115
|
when :authonly
|
116
|
-
parameters[:action] =
|
116
|
+
parameters[:action] = 'ns_quicksale_cc'
|
117
117
|
parameters[:authonly] = 1
|
118
118
|
when :capture
|
119
|
-
parameters[:action] =
|
119
|
+
parameters[:action] = 'ns_quicksale_cc'
|
120
120
|
end
|
121
121
|
|
122
|
-
response = parse(ssl_post(self.live_url, parameters.to_post_data) ||
|
122
|
+
response = parse(ssl_post(self.live_url, parameters.to_post_data) || '')
|
123
123
|
Response.new(successful?(response), message_from(response), response,
|
124
|
-
:
|
125
|
-
:
|
126
|
-
)
|
124
|
+
test: test?,
|
125
|
+
authorization: response['refcode'])
|
127
126
|
end
|
128
127
|
|
129
128
|
def successful?(response)
|
130
|
-
response[
|
129
|
+
response['Status'] == 'Accepted'
|
131
130
|
end
|
132
131
|
|
133
132
|
def message_from(response)
|
134
133
|
if successful?(response)
|
135
|
-
|
134
|
+
'Accepted'
|
136
135
|
else
|
137
|
-
response[
|
136
|
+
response['Reason'].split(':')[2].capitalize unless response['Reason'].nil?
|
138
137
|
end
|
139
138
|
end
|
140
139
|
end
|
141
140
|
end
|
142
141
|
end
|
143
|
-
|
@@ -1,25 +1,24 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class SecureNetGateway < Gateway
|
4
|
-
|
5
|
-
API_VERSION = "4.0"
|
4
|
+
API_VERSION = '4.0'
|
6
5
|
|
7
6
|
TRANSACTIONS = {
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
7
|
+
auth_only: '0000',
|
8
|
+
auth_capture: '0100',
|
9
|
+
prior_auth_capture: '0200',
|
10
|
+
void: '0400',
|
11
|
+
credit: '0500'
|
13
12
|
}
|
14
13
|
|
15
14
|
XML_ATTRIBUTES = {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
NIL_ATTRIBUTE = { 'i:nil' =>
|
15
|
+
'xmlns' => 'http://gateway.securenet.com/API/Contracts',
|
16
|
+
'xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance'
|
17
|
+
}
|
18
|
+
NIL_ATTRIBUTE = { 'i:nil' => 'true' }
|
20
19
|
|
21
20
|
self.supported_countries = ['US']
|
22
|
-
self.supported_cardtypes = [
|
21
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
23
22
|
self.homepage_url = 'http://www.securenet.com/'
|
24
23
|
self.display_name = 'SecureNet'
|
25
24
|
|
@@ -28,8 +27,8 @@ module ActiveMerchant #:nodoc:
|
|
28
27
|
|
29
28
|
APPROVED, DECLINED = 1, 2
|
30
29
|
|
31
|
-
CARD_CODE_ERRORS = %w(
|
32
|
-
AVS_ERRORS = %w(
|
30
|
+
CARD_CODE_ERRORS = %w(N S)
|
31
|
+
AVS_ERRORS = %w(A E N R W Z)
|
33
32
|
|
34
33
|
def initialize(options = {})
|
35
34
|
requires!(options, :login, :password)
|
@@ -77,22 +76,21 @@ module ActiveMerchant #:nodoc:
|
|
77
76
|
def commit(request)
|
78
77
|
xml = build_request(request)
|
79
78
|
url = test? ? self.test_url : self.live_url
|
80
|
-
data = ssl_post(url, xml,
|
79
|
+
data = ssl_post(url, xml, 'Content-Type' => 'text/xml')
|
81
80
|
response = parse(data)
|
82
81
|
|
83
82
|
Response.new(success?(response), message_from(response), response,
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
)
|
83
|
+
test: test?,
|
84
|
+
authorization: build_authorization(response),
|
85
|
+
avs_result: { code: response[:avs_result_code] },
|
86
|
+
cvv_result: response[:card_code_response_code])
|
89
87
|
end
|
90
88
|
|
91
89
|
def build_request(request)
|
92
90
|
xml = Builder::XmlMarkup.new
|
93
91
|
|
94
92
|
xml.instruct!
|
95
|
-
xml.tag!(
|
93
|
+
xml.tag!('TRANSACTION', XML_ATTRIBUTES) do
|
96
94
|
xml << request
|
97
95
|
end
|
98
96
|
|
@@ -116,7 +114,7 @@ module ActiveMerchant #:nodoc:
|
|
116
114
|
transaction_id, amount_in_ref, last_four = split_authorization(authorization)
|
117
115
|
|
118
116
|
xml.tag! 'AMOUNT', amount(money) || amount_in_ref
|
119
|
-
xml.tag!(
|
117
|
+
xml.tag!('CARD') do
|
120
118
|
xml.tag! 'CARDNUMBER', last_four
|
121
119
|
end
|
122
120
|
|
@@ -128,7 +126,7 @@ module ActiveMerchant #:nodoc:
|
|
128
126
|
end
|
129
127
|
|
130
128
|
def add_credit_card(xml, creditcard)
|
131
|
-
xml.tag!(
|
129
|
+
xml.tag!('CARD') do
|
132
130
|
xml.tag! 'CARDCODE', creditcard.verification_value if creditcard.verification_value?
|
133
131
|
xml.tag! 'CARDNUMBER', creditcard.number
|
134
132
|
xml.tag! 'EXPDATE', expdate(creditcard)
|
@@ -136,20 +134,16 @@ module ActiveMerchant #:nodoc:
|
|
136
134
|
end
|
137
135
|
|
138
136
|
def add_customer_data(xml, options)
|
139
|
-
if options.has_key? :customer
|
140
|
-
xml.tag! 'CUSTOMERID', options[:customer]
|
141
|
-
end
|
137
|
+
xml.tag! 'CUSTOMERID', options[:customer] if options.has_key? :customer
|
142
138
|
|
143
|
-
if options.has_key? :ip
|
144
|
-
xml.tag! 'CUSTOMERIP', options[:ip]
|
145
|
-
end
|
139
|
+
xml.tag! 'CUSTOMERIP', options[:ip] if options.has_key? :ip
|
146
140
|
end
|
147
141
|
|
148
142
|
def add_address(xml, creditcard, options)
|
149
143
|
return unless creditcard
|
150
144
|
|
151
145
|
if address = options[:billing_address] || options[:address]
|
152
|
-
xml.tag!(
|
146
|
+
xml.tag!('CUSTOMER_BILL') do
|
153
147
|
xml.tag! 'ADDRESS', address[:address1].to_s
|
154
148
|
xml.tag! 'CITY', address[:city].to_s
|
155
149
|
xml.tag! 'COMPANY', address[:company].to_s
|
@@ -161,13 +155,13 @@ module ActiveMerchant #:nodoc:
|
|
161
155
|
xml.tag! 'FIRSTNAME', creditcard.first_name
|
162
156
|
xml.tag! 'LASTNAME', creditcard.last_name
|
163
157
|
xml.tag! 'PHONE', address[:phone].to_s
|
164
|
-
xml.tag! 'STATE', address[:state].blank?
|
158
|
+
xml.tag! 'STATE', address[:state].blank? ? 'n/a' : address[:state]
|
165
159
|
xml.tag! 'ZIP', address[:zip].to_s
|
166
160
|
end
|
167
161
|
end
|
168
162
|
|
169
163
|
if address = options[:shipping_address]
|
170
|
-
xml.tag!(
|
164
|
+
xml.tag!('CUSTOMER_SHIP') do
|
171
165
|
xml.tag! 'ADDRESS', address[:address1].to_s
|
172
166
|
xml.tag! 'CITY', address[:city].to_s
|
173
167
|
xml.tag! 'COMPANY', address[:company].to_s
|
@@ -182,18 +176,17 @@ module ActiveMerchant #:nodoc:
|
|
182
176
|
xml.tag! 'LASTNAME', address[:last_name].to_s
|
183
177
|
end
|
184
178
|
|
185
|
-
xml.tag! 'STATE', address[:state].blank?
|
179
|
+
xml.tag! 'STATE', address[:state].blank? ? 'n/a' : address[:state]
|
186
180
|
xml.tag! 'ZIP', address[:zip].to_s
|
187
181
|
end
|
188
182
|
else
|
189
183
|
xml.tag!('CUSTOMER_SHIP', NIL_ATTRIBUTE) do
|
190
184
|
end
|
191
185
|
end
|
192
|
-
|
193
186
|
end
|
194
187
|
|
195
188
|
def add_merchant_key(xml, options)
|
196
|
-
xml.tag!(
|
189
|
+
xml.tag!('MERCHANT_KEY') do
|
197
190
|
xml.tag! 'GROUPID', 0
|
198
191
|
xml.tag! 'SECUREKEY', @options[:password]
|
199
192
|
xml.tag! 'SECURENETID', @options[:login]
|
@@ -236,7 +229,7 @@ module ActiveMerchant #:nodoc:
|
|
236
229
|
def parse(xml)
|
237
230
|
response = {}
|
238
231
|
xml = REXML::Document.new(xml)
|
239
|
-
root = REXML::XPath.first(xml,
|
232
|
+
root = REXML::XPath.first(xml, '//GATEWAYRESPONSE')
|
240
233
|
if root
|
241
234
|
root.elements.to_a.each do |node|
|
242
235
|
recurring_parse_element(response, node)
|
@@ -248,21 +241,20 @@ module ActiveMerchant #:nodoc:
|
|
248
241
|
|
249
242
|
def recurring_parse_element(response, node)
|
250
243
|
if node.has_elements?
|
251
|
-
node.elements.each{|e| recurring_parse_element(response, e) }
|
244
|
+
node.elements.each { |e| recurring_parse_element(response, e) }
|
252
245
|
else
|
253
246
|
response[node.name.underscore.to_sym] = node.text
|
254
247
|
end
|
255
248
|
end
|
256
249
|
|
257
250
|
def split_authorization(authorization)
|
258
|
-
transaction_id, amount, last_four = authorization.split(
|
251
|
+
transaction_id, amount, last_four = authorization.split('|')
|
259
252
|
[transaction_id, amount, last_four]
|
260
253
|
end
|
261
254
|
|
262
255
|
def build_authorization(response)
|
263
|
-
[response[:transactionid], response[:transactionamount], response[:last4_digits]].join(
|
256
|
+
[response[:transactionid], response[:transactionamount], response[:last4_digits]].join('|')
|
264
257
|
end
|
265
|
-
|
266
258
|
end
|
267
259
|
end
|
268
260
|
end
|