activemerchant 1.100.0 → 1.133.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1057 -0
- data/README.md +11 -9
- data/lib/active_merchant/billing/avs_result.rb +9 -9
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +49 -17
- data/lib/active_merchant/billing/compatibility.rb +5 -4
- data/lib/active_merchant/billing/credit_card.rb +55 -8
- data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +38 -36
- data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
- 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 +14 -14
- data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
- data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
- data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
- data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
- data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
- data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
- data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
- data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
- data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
- 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 +387 -175
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/cams.rb +10 -10
- data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
- data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
- data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
- data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
- data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
- data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
- data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
- data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
- data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
- data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
- data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
- data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
- data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
- data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
- data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
- data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
- data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
- data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
- data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
- data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
- data/lib/active_merchant/billing/gateways/element.rb +71 -21
- data/lib/active_merchant/billing/gateways/epay.rb +43 -43
- data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
- data/lib/active_merchant/billing/gateways/eway.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
- data/lib/active_merchant/billing/gateways/exact.rb +19 -20
- data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
- data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +38 -22
- data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
- data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
- data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
- data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
- data/lib/active_merchant/billing/gateways/hps.rb +171 -50
- data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
- data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
- data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
- data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
- data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
- data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
- data/lib/active_merchant/billing/gateways/litle.rb +181 -45
- data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
- data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
- data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
- data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
- data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +18 -21
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +236 -150
- data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
- data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
- data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
- data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
- data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
- data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
- data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
- data/lib/active_merchant/billing/gateways/omise.rb +15 -16
- data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
- data/lib/active_merchant/billing/gateways/opp.rb +39 -33
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
- data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
- data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
- data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
- data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
- data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
- data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
- data/lib/active_merchant/billing/gateways/payex.rb +24 -25
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
- data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
- data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
- 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 +13 -5
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
- 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 +8 -9
- data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
- data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
- data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
- data/lib/active_merchant/billing/gateways/payway.rb +22 -22
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +60 -21
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
- data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
- data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
- data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
- data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
- data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
- 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 +42 -16
- data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
- data/lib/active_merchant/billing/gateways/s5.rb +10 -9
- data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
- data/lib/active_merchant/billing/gateways/sage.rb +19 -21
- data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
- data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
- data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
- data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +19 -19
- data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
- data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
- data/lib/active_merchant/billing/gateways/telr.rb +17 -18
- data/lib/active_merchant/billing/gateways/tns.rb +3 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
- data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
- data/lib/active_merchant/billing/gateways/transax.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
- data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
- data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
- data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
- data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
- data/lib/active_merchant/billing/response.rb +25 -6
- 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 +14 -15
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +15 -17
- data/lib/active_merchant/post_data.rb +3 -2
- data/lib/active_merchant/posts_data.rb +2 -2
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +2 -2
- data/lib/certs/cacert.pem +1587 -2361
- data/lib/support/gateway_support.rb +1 -1
- data/lib/support/ssl_verify.rb +3 -7
- data/lib/support/ssl_version.rb +2 -3
- metadata +86 -34
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.supported_countries = ['US']
|
11
11
|
self.default_currency = 'USD'
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
13
13
|
|
14
14
|
self.homepage_url = 'http://www.elementps.com'
|
15
15
|
self.display_name = 'Element'
|
@@ -17,12 +17,17 @@ module ActiveMerchant #:nodoc:
|
|
17
17
|
SERVICE_TEST_URL = 'https://certservices.elementexpress.com/express.asmx'
|
18
18
|
SERVICE_LIVE_URL = 'https://services.elementexpress.com/express.asmx'
|
19
19
|
|
20
|
-
|
20
|
+
NETWORK_TOKEN_TYPE = {
|
21
|
+
apple_pay: '2',
|
22
|
+
google_pay: '1'
|
23
|
+
}
|
24
|
+
|
25
|
+
def initialize(options = {})
|
21
26
|
requires!(options, :account_id, :account_token, :application_id, :acceptor_id, :application_name, :application_version)
|
22
27
|
super
|
23
28
|
end
|
24
29
|
|
25
|
-
def purchase(money, payment, options={})
|
30
|
+
def purchase(money, payment, options = {})
|
26
31
|
action = payment.is_a?(Check) ? 'CheckSale' : 'CreditCardSale'
|
27
32
|
|
28
33
|
request = build_soap_request do |xml|
|
@@ -38,7 +43,7 @@ module ActiveMerchant #:nodoc:
|
|
38
43
|
commit(action, request, money)
|
39
44
|
end
|
40
45
|
|
41
|
-
def authorize(money, payment, options={})
|
46
|
+
def authorize(money, payment, options = {})
|
42
47
|
request = build_soap_request do |xml|
|
43
48
|
xml.CreditCardAuthorization(xmlns: 'https://transaction.elementexpress.com') do
|
44
49
|
add_credentials(xml)
|
@@ -52,8 +57,8 @@ module ActiveMerchant #:nodoc:
|
|
52
57
|
commit('CreditCardAuthorization', request, money)
|
53
58
|
end
|
54
59
|
|
55
|
-
def capture(money, authorization, options={})
|
56
|
-
trans_id,
|
60
|
+
def capture(money, authorization, options = {})
|
61
|
+
trans_id, = split_authorization(authorization)
|
57
62
|
options[:trans_id] = trans_id
|
58
63
|
|
59
64
|
request = build_soap_request do |xml|
|
@@ -67,8 +72,8 @@ module ActiveMerchant #:nodoc:
|
|
67
72
|
commit('CreditCardAuthorizationCompletion', request, money)
|
68
73
|
end
|
69
74
|
|
70
|
-
def refund(money, authorization, options={})
|
71
|
-
trans_id,
|
75
|
+
def refund(money, authorization, options = {})
|
76
|
+
trans_id, = split_authorization(authorization)
|
72
77
|
options[:trans_id] = trans_id
|
73
78
|
|
74
79
|
request = build_soap_request do |xml|
|
@@ -82,9 +87,22 @@ module ActiveMerchant #:nodoc:
|
|
82
87
|
commit('CreditCardReturn', request, money)
|
83
88
|
end
|
84
89
|
|
85
|
-
def
|
90
|
+
def credit(money, payment, options = {})
|
91
|
+
request = build_soap_request do |xml|
|
92
|
+
xml.CreditCardCredit(xmlns: 'https://transaction.elementexpress.com') do
|
93
|
+
add_credentials(xml)
|
94
|
+
add_payment_method(xml, payment)
|
95
|
+
add_transaction(xml, money, options)
|
96
|
+
add_terminal(xml, options)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
commit('CreditCardCredit', request, money)
|
101
|
+
end
|
102
|
+
|
103
|
+
def void(authorization, options = {})
|
86
104
|
trans_id, trans_amount = split_authorization(authorization)
|
87
|
-
options.merge!({trans_id: trans_id, trans_amount: trans_amount, reversal_type: 'Full'})
|
105
|
+
options.merge!({ trans_id: trans_id, trans_amount: trans_amount, reversal_type: 'Full' })
|
88
106
|
|
89
107
|
request = build_soap_request do |xml|
|
90
108
|
xml.CreditCardReversal(xmlns: 'https://transaction.elementexpress.com') do
|
@@ -110,11 +128,19 @@ module ActiveMerchant #:nodoc:
|
|
110
128
|
commit('PaymentAccountCreate', request, nil)
|
111
129
|
end
|
112
130
|
|
113
|
-
def verify(credit_card, options={})
|
114
|
-
|
115
|
-
|
116
|
-
|
131
|
+
def verify(credit_card, options = {})
|
132
|
+
request = build_soap_request do |xml|
|
133
|
+
xml.CreditCardAVSOnly(xmlns: 'https://transaction.elementexpress.com') do
|
134
|
+
add_credentials(xml)
|
135
|
+
add_payment_method(xml, credit_card)
|
136
|
+
add_transaction(xml, 0, options)
|
137
|
+
add_terminal(xml, options)
|
138
|
+
add_address(xml, options)
|
139
|
+
end
|
117
140
|
end
|
141
|
+
|
142
|
+
# send request with the transaction amount set to 0
|
143
|
+
commit('CreditCardAVSOnly', request, 0)
|
118
144
|
end
|
119
145
|
|
120
146
|
def supports_scrubbing?
|
@@ -150,6 +176,8 @@ module ActiveMerchant #:nodoc:
|
|
150
176
|
add_payment_account_id(xml, payment)
|
151
177
|
elsif payment.is_a?(Check)
|
152
178
|
add_echeck(xml, payment)
|
179
|
+
elsif payment.is_a?(NetworkTokenizationCreditCard)
|
180
|
+
add_network_tokenization_card(xml, payment)
|
153
181
|
else
|
154
182
|
add_credit_card(xml, payment)
|
155
183
|
end
|
@@ -178,15 +206,26 @@ module ActiveMerchant #:nodoc:
|
|
178
206
|
xml.ReversalType options[:reversal_type] if options[:reversal_type]
|
179
207
|
xml.TransactionID options[:trans_id] if options[:trans_id]
|
180
208
|
xml.TransactionAmount amount(money.to_i) if money
|
181
|
-
xml.MarketCode
|
182
|
-
xml.ReferenceNumber options[:order_id]
|
209
|
+
xml.MarketCode market_code(money, options) if options[:market_code] || money
|
210
|
+
xml.ReferenceNumber options[:order_id].present? ? options[:order_id][0, 50] : SecureRandom.hex(20)
|
211
|
+
xml.TicketNumber options[:ticket_number] if options[:ticket_number]
|
212
|
+
xml.MerchantSuppliedTransactionId options[:merchant_supplied_transaction_id] if options[:merchant_supplied_transaction_id]
|
213
|
+
xml.PaymentType options[:payment_type] if options[:payment_type]
|
214
|
+
xml.SubmissionType options[:submission_type] if options[:submission_type]
|
215
|
+
xml.DuplicateCheckDisableFlag options[:duplicate_check_disable_flag].to_s == 'true' ? 'True' : 'False' unless options[:duplicate_check_disable_flag].nil?
|
216
|
+
xml.DuplicateOverrideFlag options[:duplicate_override_flag].to_s == 'true' ? 'True' : 'False' unless options[:duplicate_override_flag].nil?
|
217
|
+
xml.MerchantDescriptor options[:merchant_descriptor] if options[:merchant_descriptor]
|
183
218
|
end
|
184
219
|
end
|
185
220
|
|
221
|
+
def market_code(money, options)
|
222
|
+
options[:market_code] || 'Default'
|
223
|
+
end
|
224
|
+
|
186
225
|
def add_terminal(xml, options)
|
187
226
|
xml.terminal do
|
188
|
-
xml.TerminalID '01'
|
189
|
-
xml.CardPresentCode 'UseDefault'
|
227
|
+
xml.TerminalID options[:terminal_id] || '01'
|
228
|
+
xml.CardPresentCode options[:card_present_code] || 'UseDefault'
|
190
229
|
xml.CardholderPresentCode 'UseDefault'
|
191
230
|
xml.CardInputCode 'UseDefault'
|
192
231
|
xml.CVVPresenceCode 'UseDefault'
|
@@ -214,8 +253,21 @@ module ActiveMerchant #:nodoc:
|
|
214
253
|
end
|
215
254
|
end
|
216
255
|
|
256
|
+
def add_network_tokenization_card(xml, payment)
|
257
|
+
xml.card do
|
258
|
+
xml.CardNumber payment.number
|
259
|
+
xml.ExpirationMonth format(payment.month, :two_digits)
|
260
|
+
xml.ExpirationYear format(payment.year, :two_digits)
|
261
|
+
xml.CardholderName "#{payment.first_name} #{payment.last_name}"
|
262
|
+
xml.Cryptogram payment.payment_cryptogram
|
263
|
+
xml.ElectronicCommerceIndicator payment.eci if payment.eci.present?
|
264
|
+
xml.WalletType NETWORK_TOKEN_TYPE.fetch(payment.source, '0')
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
217
268
|
def add_address(xml, options)
|
218
269
|
if address = options[:billing_address] || options[:address]
|
270
|
+
address[:email] ||= options[:email]
|
219
271
|
xml.address do
|
220
272
|
xml.BillingAddress1 address[:address1] if address[:address1]
|
221
273
|
xml.BillingAddress2 address[:address2] if address[:address2]
|
@@ -246,9 +298,7 @@ module ActiveMerchant #:nodoc:
|
|
246
298
|
doc.remove_namespaces!
|
247
299
|
root = doc.root.xpath('//response/*')
|
248
300
|
|
249
|
-
if root.empty?
|
250
|
-
root = doc.root.xpath('//Response/*')
|
251
|
-
end
|
301
|
+
root = doc.root.xpath('//Response/*') if root.empty?
|
252
302
|
|
253
303
|
root.each do |node|
|
254
304
|
if node.elements.empty?
|
@@ -5,48 +5,48 @@ module ActiveMerchant #:nodoc:
|
|
5
5
|
|
6
6
|
self.default_currency = 'DKK'
|
7
7
|
self.money_format = :cents
|
8
|
-
self.
|
9
|
-
|
10
|
-
|
8
|
+
self.supported_countries = %w[DK SE NO]
|
9
|
+
self.supported_cardtypes = %i[dankort forbrugsforeningen visa master
|
10
|
+
american_express diners_club jcb maestro]
|
11
11
|
self.homepage_url = 'http://epay.dk/'
|
12
12
|
self.display_name = 'ePay'
|
13
13
|
|
14
14
|
CURRENCY_CODES = {
|
15
|
-
:
|
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
|
-
:
|
15
|
+
ADP: '020', AED: '784', AFA: '004', ALL: '008', AMD: '051',
|
16
|
+
ANG: '532', AOA: '973', ARS: '032', AUD: '036', AWG: '533',
|
17
|
+
AZM: '031', BAM: '977', BBD: '052', BDT: '050', BGL: '100',
|
18
|
+
BGN: '975', BHD: '048', BIF: '108', BMD: '060', BND: '096',
|
19
|
+
BOB: '068', BOV: '984', BRL: '986', BSD: '044', BTN: '064',
|
20
|
+
BWP: '072', BYR: '974', BZD: '084', CAD: '124', CDF: '976',
|
21
|
+
CHF: '756', CLF: '990', CLP: '152', CNY: '156', COP: '170',
|
22
|
+
CRC: '188', CUP: '192', CVE: '132', CYP: '196', CZK: '203',
|
23
|
+
DJF: '262', DKK: '208', DOP: '214', DZD: '012', ECS: '218',
|
24
|
+
ECV: '983', EEK: '233', EGP: '818', ERN: '232', ETB: '230',
|
25
|
+
EUR: '978', FJD: '242', FKP: '238', GBP: '826', GEL: '981',
|
26
|
+
GHC: '288', GIP: '292', GMD: '270', GNF: '324', GTQ: '320',
|
27
|
+
GWP: '624', GYD: '328', HKD: '344', HNL: '340', HRK: '191',
|
28
|
+
HTG: '332', HUF: '348', IDR: '360', ILS: '376', INR: '356',
|
29
|
+
IQD: '368', IRR: '364', ISK: '352', JMD: '388', JOD: '400',
|
30
|
+
JPY: '392', KES: '404', KGS: '417', KHR: '116', KMF: '174',
|
31
|
+
KPW: '408', KRW: '410', KWD: '414', KYD: '136', KZT: '398',
|
32
|
+
LAK: '418', LBP: '422', LKR: '144', LRD: '430', LSL: '426',
|
33
|
+
LTL: '440', LVL: '428', LYD: '434', MAD: '504', MDL: '498',
|
34
|
+
MGF: '450', MKD: '807', MMK: '104', MNT: '496', MOP: '446',
|
35
|
+
MRO: '478', MTL: '470', MUR: '480', MVR: '462', MWK: '454',
|
36
|
+
MXN: '484', MXV: '979', MYR: '458', MZM: '508', NAD: '516',
|
37
|
+
NGN: '566', NIO: '558', NOK: '578', NPR: '524', NZD: '554',
|
38
|
+
OMR: '512', PAB: '590', PEN: '604', PGK: '598', PHP: '608',
|
39
|
+
PKR: '586', PLN: '985', PYG: '600', QAR: '634', ROL: '642',
|
40
|
+
RUB: '643', RUR: '810', RWF: '646', SAR: '682', SBD: '090',
|
41
|
+
SCR: '690', SDD: '736', SEK: '752', SGD: '702', SHP: '654',
|
42
|
+
SIT: '705', SKK: '703', SLL: '694', SOS: '706', SRG: '740',
|
43
|
+
STD: '678', SVC: '222', SYP: '760', SZL: '748', THB: '764',
|
44
|
+
TJS: '972', TMM: '795', TND: '788', TOP: '776', TPE: '626',
|
45
|
+
TRL: '792', TRY: '949', TTD: '780', TWD: '901', TZS: '834',
|
46
|
+
UAH: '980', UGX: '800', USD: '840', UYU: '858', UZS: '860',
|
47
|
+
VEB: '862', VND: '704', VUV: '548', XAF: '950', XCD: '951',
|
48
|
+
XOF: '952', XPF: '953', YER: '886', YUM: '891', ZAR: '710',
|
49
|
+
ZMK: '894', ZWD: '716'
|
50
50
|
}
|
51
51
|
|
52
52
|
# login: merchant number
|
@@ -177,14 +177,14 @@ module ActiveMerchant #:nodoc:
|
|
177
177
|
Response.new response['accept'].to_i == 1,
|
178
178
|
response['errortext'],
|
179
179
|
response,
|
180
|
-
:
|
181
|
-
:
|
180
|
+
test: test?,
|
181
|
+
authorization: response['tid']
|
182
182
|
else
|
183
183
|
Response.new response['result'] == 'true',
|
184
184
|
messages(response['epay'], response['pbs']),
|
185
185
|
response,
|
186
|
-
:
|
187
|
-
:
|
186
|
+
test: test?,
|
187
|
+
authorization: params[:transaction]
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def xml_builder(params, soap_call)
|
264
|
-
xml = Builder::XmlMarkup.new(:
|
264
|
+
xml = Builder::XmlMarkup.new(indent: 2)
|
265
265
|
xml.instruct!
|
266
266
|
xml.tag! 'soap:Envelope', { 'xmlns:xsi' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
267
267
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
self.live_url = 'https://secure.evoepay.com/api/transact.php'
|
37
37
|
|
38
38
|
self.supported_countries = ['CA']
|
39
|
-
self.supported_cardtypes = [
|
39
|
+
self.supported_cardtypes = %i[visa master american_express jcb discover]
|
40
40
|
self.money_format = :dollars
|
41
41
|
self.homepage_url = 'http://www.evocanada.com/'
|
42
42
|
self.display_name = 'EVO Canada'
|
@@ -139,8 +139,8 @@ module ActiveMerchant #:nodoc:
|
|
139
139
|
# <tt>options</tt>.
|
140
140
|
def capture(money, authorization, options = {})
|
141
141
|
post = {
|
142
|
-
:
|
143
|
-
:
|
142
|
+
amount: amount(money),
|
143
|
+
transactionid: authorization
|
144
144
|
}
|
145
145
|
add_order(post, options)
|
146
146
|
commit('capture', money, post)
|
@@ -153,7 +153,7 @@ module ActiveMerchant #:nodoc:
|
|
153
153
|
# The <tt>identification</tt> parameter is the transaction ID, retrieved
|
154
154
|
# from {Response#authorization}.
|
155
155
|
def refund(money, identification)
|
156
|
-
post = {:
|
156
|
+
post = { transactionid: identification }
|
157
157
|
commit('refund', money, post)
|
158
158
|
end
|
159
159
|
|
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
|
|
181
181
|
# The <tt>identification</tt> parameter is the transaction ID, retrieved
|
182
182
|
# from {Response#authorization}.
|
183
183
|
def void(identification)
|
184
|
-
post = {:
|
184
|
+
post = { transactionid: identification }
|
185
185
|
commit('void', nil, post)
|
186
186
|
end
|
187
187
|
|
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
|
|
192
192
|
# The <tt>identification</tt> parameter is the transaction ID, retrieved
|
193
193
|
# from {Response#authorization}.
|
194
194
|
def update(identification, options)
|
195
|
-
post = {:
|
195
|
+
post = { transactionid: identification }
|
196
196
|
add_order(post, options)
|
197
197
|
commit('update', nil, post)
|
198
198
|
end
|
@@ -245,7 +245,7 @@ module ActiveMerchant #:nodoc:
|
|
245
245
|
end
|
246
246
|
|
247
247
|
def add_paymentmethod(post, payment)
|
248
|
-
if card_brand(payment)=='check'
|
248
|
+
if card_brand(payment) == 'check'
|
249
249
|
post[:payment] = 'check'
|
250
250
|
post[:checkname] = payment.name
|
251
251
|
post[:checkaba] = payment.routing_number
|
@@ -280,11 +280,10 @@ module ActiveMerchant #:nodoc:
|
|
280
280
|
message = message_from(response)
|
281
281
|
|
282
282
|
Response.new(success?(response), message, response,
|
283
|
-
:
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
)
|
283
|
+
test: test?,
|
284
|
+
authorization: response['transactionid'],
|
285
|
+
avs_result: { code: response['avsresponse'] },
|
286
|
+
cvv_result: response['cvvresponse'])
|
288
287
|
end
|
289
288
|
|
290
289
|
def message_from(response)
|
@@ -292,7 +291,7 @@ module ActiveMerchant #:nodoc:
|
|
292
291
|
end
|
293
292
|
|
294
293
|
def post_data(action, parameters = {})
|
295
|
-
post = {:
|
294
|
+
post = { type: action }
|
296
295
|
|
297
296
|
if test?
|
298
297
|
post[:username] = 'demo'
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
|
10
10
|
self.money_format = :cents
|
11
11
|
self.supported_countries = ['AU']
|
12
|
-
self.supported_cardtypes = [
|
12
|
+
self.supported_cardtypes = %i[visa master american_express diners_club]
|
13
13
|
self.homepage_url = 'http://www.eway.com.au/'
|
14
14
|
self.display_name = 'eWAY'
|
15
15
|
|
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
|
|
38
38
|
commit(purchase_url(post[:CVN]), money, post)
|
39
39
|
end
|
40
40
|
|
41
|
-
def refund(money, authorization, options={})
|
41
|
+
def refund(money, authorization, options = {})
|
42
42
|
post = {}
|
43
43
|
|
44
44
|
add_customer_id(post)
|
@@ -66,12 +66,12 @@ module ActiveMerchant #:nodoc:
|
|
66
66
|
private
|
67
67
|
|
68
68
|
def requires_address!(options)
|
69
|
-
raise ArgumentError.new('Missing eWay required parameters: address or billing_address') unless options.has_key?(:address)
|
69
|
+
raise ArgumentError.new('Missing eWay required parameters: address or billing_address') unless options.has_key?(:address) || options.has_key?(:billing_address)
|
70
70
|
end
|
71
71
|
|
72
72
|
def add_creditcard(post, creditcard)
|
73
|
-
post[:CardNumber]
|
74
|
-
post[:CardExpiryMonth]
|
73
|
+
post[:CardNumber] = creditcard.number
|
74
|
+
post[:CardExpiryMonth] = sprintf('%.2i', creditcard.month)
|
75
75
|
post[:CardExpiryYear] = sprintf('%.4i', creditcard.year)[-2..-1]
|
76
76
|
post[:CustomerFirstName] = creditcard.first_name
|
77
77
|
post[:CustomerLastName] = creditcard.last_name
|
@@ -82,7 +82,7 @@ module ActiveMerchant #:nodoc:
|
|
82
82
|
|
83
83
|
def add_address(post, options)
|
84
84
|
if address = options[:billing_address] || options[:address]
|
85
|
-
post[:CustomerAddress] = [
|
85
|
+
post[:CustomerAddress] = [address[:address1], address[:address2], address[:city], address[:state], address[:country]].compact.join(', ')
|
86
86
|
post[:CustomerPostcode] = address[:zip]
|
87
87
|
end
|
88
88
|
end
|
@@ -114,9 +114,8 @@ module ActiveMerchant #:nodoc:
|
|
114
114
|
Response.new(success?(response),
|
115
115
|
message_from(response[:ewaytrxnerror]),
|
116
116
|
response,
|
117
|
-
:
|
118
|
-
:
|
119
|
-
)
|
117
|
+
authorization: response[:ewaytrxnnumber],
|
118
|
+
test: test?)
|
120
119
|
end
|
121
120
|
|
122
121
|
def success?(response)
|
@@ -145,6 +144,7 @@ module ActiveMerchant #:nodoc:
|
|
145
144
|
|
146
145
|
def message_from(message)
|
147
146
|
return '' if message.blank?
|
147
|
+
|
148
148
|
MESSAGES[message[0, 2]] || message
|
149
149
|
end
|
150
150
|
|