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
@@ -1,108 +1,108 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
3
|
class CardStreamGateway < Gateway
|
4
|
-
|
5
|
-
THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = "Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead."
|
4
|
+
THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = 'Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead.'
|
6
5
|
|
7
6
|
self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/'
|
8
7
|
self.money_format = :cents
|
9
8
|
self.default_currency = 'GBP'
|
10
|
-
self.
|
11
|
-
self.
|
9
|
+
self.currencies_without_fractions = %w(CVE ISK JPY UGX)
|
10
|
+
self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU]
|
11
|
+
self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
|
12
12
|
self.homepage_url = 'http://www.cardstream.com/'
|
13
13
|
self.display_name = 'CardStream'
|
14
14
|
|
15
15
|
CURRENCY_CODES = {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
16
|
+
'AED' => '784',
|
17
|
+
'ALL' => '008',
|
18
|
+
'AMD' => '051',
|
19
|
+
'ANG' => '532',
|
20
|
+
'ARS' => '032',
|
21
|
+
'AUD' => '036',
|
22
|
+
'AWG' => '533',
|
23
|
+
'BAM' => '977',
|
24
|
+
'BBD' => '052',
|
25
|
+
'BGN' => '975',
|
26
|
+
'BMD' => '060',
|
27
|
+
'BOB' => '068',
|
28
|
+
'BRL' => '986',
|
29
|
+
'BSD' => '044',
|
30
|
+
'BWP' => '072',
|
31
|
+
'BZD' => '084',
|
32
|
+
'CAD' => '124',
|
33
|
+
'CHF' => '756',
|
34
|
+
'CLP' => '152',
|
35
|
+
'CNY' => '156',
|
36
|
+
'COP' => '170',
|
37
|
+
'CRC' => '188',
|
38
|
+
'CZK' => '203',
|
39
|
+
'DKK' => '208',
|
40
|
+
'DOP' => '214',
|
41
|
+
'EGP' => '818',
|
42
|
+
'EUR' => '978',
|
43
|
+
'GBP' => '826',
|
44
|
+
'GEL' => '981',
|
45
|
+
'GIP' => '292',
|
46
|
+
'GTQ' => '320',
|
47
|
+
'GYD' => '328',
|
48
|
+
'HKD' => '344',
|
49
|
+
'HNL' => '340',
|
50
|
+
'HRK' => '191',
|
51
|
+
'HUF' => '348',
|
52
|
+
'ISK' => '352',
|
53
|
+
'IDR' => '360',
|
54
|
+
'ILS' => '376',
|
55
|
+
'INR' => '356',
|
56
|
+
'JPY' => '392',
|
57
|
+
'JMD' => '388',
|
58
|
+
'KES' => '404',
|
59
|
+
'KRW' => '410',
|
60
|
+
'KYD' => '136',
|
61
|
+
'LBP' => '422',
|
62
|
+
'LKR' => '144',
|
63
|
+
'MAD' => '504',
|
64
|
+
'MVR' => '462',
|
65
|
+
'MWK' => '454',
|
66
|
+
'MXN' => '484',
|
67
|
+
'MYR' => '458',
|
68
|
+
'NAD' => '516',
|
69
|
+
'NGN' => '566',
|
70
|
+
'NIO' => '558',
|
71
|
+
'NOK' => '578',
|
72
|
+
'NPR' => '524',
|
73
|
+
'NZD' => '554',
|
74
|
+
'PAB' => '590',
|
75
|
+
'PEN' => '604',
|
76
|
+
'PGK' => '598',
|
77
|
+
'PHP' => '608',
|
78
|
+
'PKR' => '586',
|
79
|
+
'PLN' => '985',
|
80
|
+
'PYG' => '600',
|
81
|
+
'QAR' => '634',
|
82
|
+
'RON' => '946',
|
83
|
+
'RSD' => '941',
|
84
|
+
'RUB' => '643',
|
85
|
+
'RWF' => '646',
|
86
|
+
'SAR' => '682',
|
87
|
+
'SEK' => '752',
|
88
|
+
'SGD' => '702',
|
89
|
+
'SRD' => '968',
|
90
|
+
'THB' => '764',
|
91
|
+
'TND' => '788',
|
92
|
+
'TRY' => '949',
|
93
|
+
'TTD' => '780',
|
94
|
+
'TWD' => '901',
|
95
|
+
'TZS' => '834',
|
96
|
+
'UAH' => '980',
|
97
|
+
'UGX' => '800',
|
98
|
+
'USD' => '840',
|
99
|
+
'UYU' => '858',
|
100
|
+
'VND' => '704',
|
101
|
+
'WST' => '882',
|
102
|
+
'XAF' => '950',
|
103
|
+
'XCD' => '951',
|
104
|
+
'XOF' => '952',
|
105
|
+
'ZAR' => '710'
|
106
106
|
}
|
107
107
|
|
108
108
|
CVV_CODE = {
|
@@ -118,11 +118,11 @@ module ActiveMerchant #:nodoc:
|
|
118
118
|
# 4 - Postcode not matched.
|
119
119
|
# 8 - Postcode partially matched.
|
120
120
|
AVS_POSTAL_MATCH = {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
121
|
+
'0' => nil,
|
122
|
+
'1' => nil,
|
123
|
+
'2' => 'Y',
|
124
|
+
'4' => 'N',
|
125
|
+
'8' => 'N'
|
126
126
|
}
|
127
127
|
|
128
128
|
# 0 - No additional information available.
|
@@ -131,17 +131,17 @@ module ActiveMerchant #:nodoc:
|
|
131
131
|
# 4 - Address numeric not matched.
|
132
132
|
# 8 - Address numeric partially matched.
|
133
133
|
AVS_STREET_MATCH = {
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
134
|
+
'0' => nil,
|
135
|
+
'1' => nil,
|
136
|
+
'2' => 'Y',
|
137
|
+
'4' => 'N',
|
138
|
+
'8' => 'N'
|
139
139
|
}
|
140
140
|
|
141
141
|
def initialize(options = {})
|
142
142
|
requires!(options, :login, :shared_secret)
|
143
143
|
@threeds_required = false
|
144
|
-
if
|
144
|
+
if options[:threeDSRequired]
|
145
145
|
ActiveMerchant.deprecated(THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE)
|
146
146
|
@threeds_required = options[:threeDSRequired]
|
147
147
|
end
|
@@ -150,30 +150,20 @@ module ActiveMerchant #:nodoc:
|
|
150
150
|
|
151
151
|
def authorize(money, credit_card_or_reference, options = {})
|
152
152
|
post = {}
|
153
|
-
|
154
|
-
add_amount(post, money, options)
|
155
|
-
add_invoice(post, credit_card_or_reference, money, options)
|
156
|
-
add_credit_card_or_reference(post, credit_card_or_reference)
|
157
|
-
add_customer_data(post, options)
|
158
|
-
add_remote_address(post, options)
|
153
|
+
add_auth_purchase(post, -1, money, credit_card_or_reference, options)
|
159
154
|
commit('SALE', post)
|
160
155
|
end
|
161
156
|
|
162
157
|
def purchase(money, credit_card_or_reference, options = {})
|
163
158
|
post = {}
|
164
|
-
|
165
|
-
add_amount(post, money, options)
|
166
|
-
add_invoice(post, credit_card_or_reference, money, options)
|
167
|
-
add_credit_card_or_reference(post, credit_card_or_reference)
|
168
|
-
add_customer_data(post, options)
|
169
|
-
add_remote_address(post, options)
|
159
|
+
add_auth_purchase(post, 0, money, credit_card_or_reference, options)
|
170
160
|
commit('SALE', post)
|
171
161
|
end
|
172
162
|
|
173
163
|
def capture(money, authorization, options = {})
|
174
164
|
post = {}
|
175
165
|
add_pair(post, :xref, authorization)
|
176
|
-
add_pair(post, :amount,
|
166
|
+
add_pair(post, :amount, localized_amount(money, options[:currency] || currency(money)), required: true)
|
177
167
|
add_remote_address(post, options)
|
178
168
|
|
179
169
|
commit('CAPTURE', post)
|
@@ -184,12 +174,13 @@ module ActiveMerchant #:nodoc:
|
|
184
174
|
add_pair(post, :xref, authorization)
|
185
175
|
add_amount(post, money, options)
|
186
176
|
add_remote_address(post, options)
|
177
|
+
add_country_code(post, options)
|
187
178
|
response = commit('REFUND_SALE', post)
|
188
179
|
|
189
180
|
return response if response.success?
|
190
181
|
return response unless options[:force_full_refund_if_unsettled]
|
191
182
|
|
192
|
-
if response.params[
|
183
|
+
if response.params['responseCode'] == '65541'
|
193
184
|
void(authorization, options)
|
194
185
|
else
|
195
186
|
response
|
@@ -203,7 +194,7 @@ module ActiveMerchant #:nodoc:
|
|
203
194
|
commit('CANCEL', post)
|
204
195
|
end
|
205
196
|
|
206
|
-
def verify(creditcard, options={})
|
197
|
+
def verify(creditcard, options = {})
|
207
198
|
MultiResponse.run(:use_first_response) do |r|
|
208
199
|
r.process { authorize(100, creditcard, options) }
|
209
200
|
r.process(:ignore_result) { void(r.authorization, options) }
|
@@ -223,9 +214,21 @@ module ActiveMerchant #:nodoc:
|
|
223
214
|
|
224
215
|
private
|
225
216
|
|
217
|
+
def add_auth_purchase(post, pair_value, money, credit_card_or_reference, options)
|
218
|
+
add_pair(post, :captureDelay, pair_value)
|
219
|
+
add_amount(post, money, options)
|
220
|
+
add_invoice(post, credit_card_or_reference, money, options)
|
221
|
+
add_credit_card_or_reference(post, credit_card_or_reference)
|
222
|
+
add_customer_data(post, options)
|
223
|
+
add_remote_address(post, options)
|
224
|
+
add_country_code(post, options)
|
225
|
+
add_threeds_fields(post, options)
|
226
|
+
end
|
227
|
+
|
226
228
|
def add_amount(post, money, options)
|
227
|
-
|
228
|
-
add_pair(post, :
|
229
|
+
currency = options[:currency] || currency(money)
|
230
|
+
add_pair(post, :amount, localized_amount(money, currency), required: true)
|
231
|
+
add_pair(post, :currencyCode, currency_code(currency))
|
229
232
|
end
|
230
233
|
|
231
234
|
def add_customer_data(post, options)
|
@@ -241,15 +244,15 @@ module ActiveMerchant #:nodoc:
|
|
241
244
|
end
|
242
245
|
|
243
246
|
def add_invoice(post, credit_card_or_reference, money, options)
|
244
|
-
add_pair(post, :transactionUnique, options[:order_id], :
|
245
|
-
add_pair(post, :orderRef, options[:description] || options[:order_id], :
|
247
|
+
add_pair(post, :transactionUnique, options[:order_id], required: true)
|
248
|
+
add_pair(post, :orderRef, options[:description] || options[:order_id], required: true)
|
246
249
|
add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name]
|
247
250
|
add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor]
|
248
251
|
if credit_card_or_reference.respond_to?(:number)
|
249
|
-
if [
|
252
|
+
if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s)
|
250
253
|
add_pair(post, :item1Quantity, 1)
|
251
254
|
add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
|
252
|
-
add_pair(post, :item1GrossValue,
|
255
|
+
add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money)))
|
253
256
|
end
|
254
257
|
end
|
255
258
|
|
@@ -266,40 +269,49 @@ module ActiveMerchant #:nodoc:
|
|
266
269
|
end
|
267
270
|
|
268
271
|
def add_reference(post, reference)
|
269
|
-
add_pair(post, :xref, reference, :
|
272
|
+
add_pair(post, :xref, reference, required: true)
|
270
273
|
end
|
271
274
|
|
272
275
|
def add_credit_card(post, credit_card)
|
273
|
-
add_pair(post, :customerName, credit_card.name, :
|
274
|
-
add_pair(post, :cardNumber, credit_card.number, :
|
276
|
+
add_pair(post, :customerName, credit_card.name, required: true)
|
277
|
+
add_pair(post, :cardNumber, credit_card.number, required: true)
|
278
|
+
add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), required: true)
|
279
|
+
add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), required: true)
|
280
|
+
add_pair(post, :cardCVV, credit_card.verification_value)
|
281
|
+
end
|
275
282
|
|
276
|
-
|
277
|
-
add_pair(post, :
|
283
|
+
def add_threeds_required(post, options)
|
284
|
+
add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N')
|
285
|
+
end
|
278
286
|
|
279
|
-
|
280
|
-
|
281
|
-
add_pair(post, :cardStartYear, format(credit_card.start_year, :two_digits))
|
287
|
+
def add_threeds_fields(post, options)
|
288
|
+
return unless three_d_secure = options[:three_d_secure]
|
282
289
|
|
283
|
-
|
290
|
+
add_pair(post, :threeDSEnrolled, formatted_enrollment(three_d_secure[:enrolled]))
|
291
|
+
if three_d_secure[:enrolled] == 'true'
|
292
|
+
add_pair(post, :threeDSAuthenticated, three_d_secure[:authentication_response_status])
|
293
|
+
if three_d_secure[:authentication_response_status] == 'Y'
|
294
|
+
post[:threeDSECI] = three_d_secure[:eci]
|
295
|
+
post[:threeDSCAVV] = three_d_secure[:cavv]
|
296
|
+
post[:threeDSXID] = three_d_secure[:xid] || three_d_secure[:ds_transaction_id]
|
297
|
+
end
|
284
298
|
end
|
285
|
-
|
286
|
-
add_pair(post, :cardCVV, credit_card.verification_value)
|
287
299
|
end
|
288
300
|
|
289
|
-
def
|
290
|
-
add_pair(post, :
|
301
|
+
def add_remote_address(post, options = {})
|
302
|
+
add_pair(post, :remoteAddress, options[:ip] || '1.1.1.1')
|
291
303
|
end
|
292
304
|
|
293
|
-
def
|
294
|
-
|
305
|
+
def add_country_code(post, options)
|
306
|
+
post[:countryCode] = options[:country_code] || self.supported_countries[0]
|
295
307
|
end
|
296
308
|
|
297
309
|
def normalize_line_endings(str)
|
298
|
-
str.gsub(/%0D%0A|%0A%0D|%0D/,
|
310
|
+
str.gsub(/%0D%0A|%0A%0D|%0D/, '%0A')
|
299
311
|
end
|
300
312
|
|
301
313
|
def add_hmac(post)
|
302
|
-
result = post.sort.collect { |key, value| "#{key}=#{normalize_line_endings(CGI.escape(value.to_s))}" }.join(
|
314
|
+
result = post.sort.collect { |key, value| "#{key}=#{normalize_line_endings(CGI.escape(value.to_s))}" }.join('&')
|
303
315
|
result = Digest::SHA512.hexdigest("#{result}#{@options[:shared_secret]}")
|
304
316
|
|
305
317
|
add_pair(post, :signature, result)
|
@@ -307,9 +319,9 @@ module ActiveMerchant #:nodoc:
|
|
307
319
|
|
308
320
|
def parse(body)
|
309
321
|
result = {}
|
310
|
-
pairs = body.split(
|
322
|
+
pairs = body.split('&')
|
311
323
|
pairs.each do |pair|
|
312
|
-
a = pair.split(
|
324
|
+
a = pair.split('=')
|
313
325
|
# because some value pairs don't have a value
|
314
326
|
result[a[0].to_sym] = a[1] == nil ? '' : CGI.unescape(a[1])
|
315
327
|
end
|
@@ -317,23 +329,23 @@ module ActiveMerchant #:nodoc:
|
|
317
329
|
end
|
318
330
|
|
319
331
|
def commit(action, parameters)
|
320
|
-
parameters.update(:countryCode => self.supported_countries[0]) unless ['CAPTURE', 'CANCEL'].include?(action)
|
321
332
|
parameters.update(
|
322
|
-
:
|
323
|
-
:
|
333
|
+
merchantID: @options[:login],
|
334
|
+
action: action
|
324
335
|
)
|
325
336
|
# adds a signature to the post hash/array
|
326
337
|
add_hmac(parameters)
|
327
338
|
|
328
339
|
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
329
340
|
|
330
|
-
Response.new(
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
341
|
+
Response.new(
|
342
|
+
response[:responseCode] == '0',
|
343
|
+
response[:responseCode] == '0' ? 'APPROVED' : response[:responseMessage],
|
344
|
+
response,
|
345
|
+
test: test?,
|
346
|
+
authorization: response[:xref],
|
347
|
+
cvv_result: CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]],
|
348
|
+
avs_result: avs_from(response)
|
337
349
|
)
|
338
350
|
end
|
339
351
|
|
@@ -341,36 +353,42 @@ module ActiveMerchant #:nodoc:
|
|
341
353
|
postal_match = AVS_POSTAL_MATCH[response[:avscv2ResponseCode].to_s[1, 1]]
|
342
354
|
street_match = AVS_STREET_MATCH[response[:avscv2ResponseCode].to_s[2, 1]]
|
343
355
|
|
344
|
-
code = if postal_match ==
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
356
|
+
code = if postal_match == 'Y' && street_match == 'Y'
|
357
|
+
'M'
|
358
|
+
elsif postal_match == 'Y'
|
359
|
+
'P'
|
360
|
+
elsif street_match == 'Y'
|
361
|
+
'A'
|
362
|
+
else
|
363
|
+
'I'
|
364
|
+
end
|
353
365
|
|
354
366
|
AVSResult.new({
|
355
|
-
:
|
356
|
-
:
|
357
|
-
:
|
367
|
+
code: code,
|
368
|
+
postal_match: postal_match,
|
369
|
+
street_match: street_match
|
358
370
|
})
|
359
371
|
end
|
360
372
|
|
361
|
-
|
362
373
|
def currency_code(currency)
|
363
374
|
CURRENCY_CODES[currency]
|
364
375
|
end
|
365
376
|
|
366
377
|
def post_data(action, parameters = {})
|
367
|
-
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join(
|
378
|
+
parameters.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
368
379
|
end
|
369
380
|
|
370
381
|
def add_pair(post, key, value, options = {})
|
371
382
|
post[key] = value if !value.blank? || options[:required]
|
372
383
|
end
|
373
384
|
|
385
|
+
def formatted_enrollment(val)
|
386
|
+
case val
|
387
|
+
when 'Y', 'N', 'U' then val
|
388
|
+
when true, 'true' then 'Y'
|
389
|
+
when false, 'false' then 'N'
|
390
|
+
end
|
391
|
+
end
|
374
392
|
end
|
375
393
|
end
|
376
394
|
end
|