activemerchant 1.133.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +450 -0
- data/CONTRIBUTORS +1 -0
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +2 -2
- data/lib/active_merchant/billing/base.rb +2 -2
- data/lib/active_merchant/billing/check.rb +16 -4
- data/lib/active_merchant/billing/compatibility.rb +4 -4
- data/lib/active_merchant/billing/credit_card.rb +35 -16
- data/lib/active_merchant/billing/credit_card_formatting.rb +13 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +74 -19
- data/lib/active_merchant/billing/gateway.rb +22 -2
- data/lib/active_merchant/billing/gateways/adyen.rb +282 -87
- data/lib/active_merchant/billing/gateways/airwallex.rb +46 -25
- data/lib/active_merchant/billing/gateways/alelo.rb +29 -11
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +49 -41
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +14 -10
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -5
- data/lib/active_merchant/billing/gateways/axcessms.rb +9 -5
- data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/banwire.rb +6 -4
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +2 -2
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +12 -8
- data/lib/active_merchant/billing/gateways/beanstream.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +2 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +15 -7
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -5
- data/lib/active_merchant/billing/gateways/bogus.rb +2 -2
- data/lib/active_merchant/billing/gateways/borgun.rb +2 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +3 -1
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +68 -23
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +266 -89
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -3
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/cams.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_connect.rb +7 -4
- data/lib/active_merchant/billing/gateways/card_save.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_stream.rb +12 -13
- data/lib/active_merchant/billing/gateways/cardknox.rb +2 -2
- data/lib/active_merchant/billing/gateways/cardprocess.rb +2 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +4 -4
- data/lib/active_merchant/billing/gateways/cc5.rb +2 -2
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +331 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_xml.rb +220 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +9 -242
- data/lib/active_merchant/billing/gateways/cenpos.rb +9 -3
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +362 -50
- data/lib/active_merchant/billing/gateways/clearhaus.rb +2 -2
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +117 -35
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
- data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
- data/lib/active_merchant/billing/gateways/credorax.rb +109 -20
- data/lib/active_merchant/billing/gateways/ct_payment.rb +6 -6
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +379 -100
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +147 -76
- data/lib/active_merchant/billing/gateways/d_local.rb +45 -22
- data/lib/active_merchant/billing/gateways/data_cash.rb +22 -18
- data/lib/active_merchant/billing/gateways/datatrans.rb +284 -0
- data/lib/active_merchant/billing/gateways/decidir.rb +82 -46
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +31 -35
- data/lib/active_merchant/billing/gateways/deepstack.rb +382 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +3 -3
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +116 -68
- data/lib/active_merchant/billing/gateways/efsnet.rb +13 -8
- data/lib/active_merchant/billing/gateways/elavon.rb +80 -47
- data/lib/active_merchant/billing/gateways/element.rb +39 -10
- data/lib/active_merchant/billing/gateways/epay.rb +8 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway.rb +6 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +3 -3
- data/lib/active_merchant/billing/gateways/exact.rb +8 -4
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +37 -7
- data/lib/active_merchant/billing/gateways/federated_canada.rb +8 -4
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_common.rb +15 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +190 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +183 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +8 -174
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +8 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +9 -5
- data/lib/active_merchant/billing/gateways/flex_charge.rb +359 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -2
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +6 -4
- data/lib/active_merchant/billing/gateways/fortis.rb +347 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +6 -4
- data/lib/active_merchant/billing/gateways/global_collect.rb +69 -50
- data/lib/active_merchant/billing/gateways/global_transport.rb +2 -2
- data/lib/active_merchant/billing/gateways/hdfc.rb +2 -2
- data/lib/active_merchant/billing/gateways/hi_pay.rb +287 -0
- data/lib/active_merchant/billing/gateways/hps.rb +40 -47
- data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -6
- data/lib/active_merchant/billing/gateways/instapay.rb +9 -6
- data/lib/active_merchant/billing/gateways/ipg.rb +14 -10
- data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +18 -8
- data/lib/active_merchant/billing/gateways/itransact.rb +8 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +12 -9
- data/lib/active_merchant/billing/gateways/ixopay.rb +4 -4
- data/lib/active_merchant/billing/gateways/jetpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +9 -6
- data/lib/active_merchant/billing/gateways/komoju.rb +2 -2
- data/lib/active_merchant/billing/gateways/kushki.rb +79 -16
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +8 -4
- data/lib/active_merchant/billing/gateways/litle.rb +37 -54
- data/lib/active_merchant/billing/gateways/loan_payment_pro.rb +267 -0
- data/lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb +93 -0
- data/lib/active_merchant/billing/gateways/mastercard.rb +4 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +32 -11
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +10 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +13 -6
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +13 -6
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -5
- data/lib/active_merchant/billing/gateways/mercury.rb +11 -5
- data/lib/active_merchant/billing/gateways/metrics_global.rb +10 -8
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -6
- data/lib/active_merchant/billing/gateways/migs.rb +8 -4
- data/lib/active_merchant/billing/gateways/mit.rb +10 -5
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +21 -13
- data/lib/active_merchant/billing/gateways/moka.rb +2 -2
- data/lib/active_merchant/billing/gateways/monei.rb +3 -3
- data/lib/active_merchant/billing/gateways/moneris.rb +11 -5
- data/lib/active_merchant/billing/gateways/money_movers.rb +8 -4
- data/lib/active_merchant/billing/gateways/multi_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +5 -3
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -10
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/net_registry.rb +6 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +4 -6
- data/lib/active_merchant/billing/gateways/netbilling.rb +8 -4
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +9 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +29 -8
- data/lib/active_merchant/billing/gateways/nuvei.rb +573 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +8 -4
- data/lib/active_merchant/billing/gateways/omise.rb +2 -2
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +3 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +12 -6
- data/lib/active_merchant/billing/gateways/orbital/orbital_codes.rb +273 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +114 -94
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +9 -6
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_arc.rb +9 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +6 -4
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -5
- data/lib/active_merchant/billing/gateways/pay_junction.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_trace.rb +36 -22
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +14 -14
- data/lib/active_merchant/billing/gateways/payeezy.rb +26 -13
- data/lib/active_merchant/billing/gateways/payex.rb +8 -6
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow.rb +12 -11
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +10 -6
- data/lib/active_merchant/billing/gateways/paymentez.rb +30 -16
- data/lib/active_merchant/billing/gateways/paymill.rb +6 -4
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +17 -12
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +4 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -2
- data/lib/active_merchant/billing/gateways/paysafe.rb +48 -24
- data/lib/active_merchant/billing/gateways/payscout.rb +9 -6
- data/lib/active_merchant/billing/gateways/paystation.rb +9 -5
- data/lib/active_merchant/billing/gateways/payu_in.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -5
- data/lib/active_merchant/billing/gateways/payway.rb +6 -2
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +126 -41
- data/lib/active_merchant/billing/gateways/plexo.rb +71 -20
- data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -2
- data/lib/active_merchant/billing/gateways/priority.rb +29 -24
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +8 -4
- data/lib/active_merchant/billing/gateways/psl_card.rb +6 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +9 -5
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +27 -17
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +8 -4
- data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +2 -2
- data/lib/active_merchant/billing/gateways/rapyd.rb +172 -53
- data/lib/active_merchant/billing/gateways/reach.rb +16 -9
- data/lib/active_merchant/billing/gateways/redsys.rb +7 -15
- data/lib/active_merchant/billing/gateways/redsys_rest.rb +545 -0
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +47 -24
- data/lib/active_merchant/billing/gateways/sage.rb +14 -6
- data/lib/active_merchant/billing/gateways/sage_pay.rb +81 -7
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +8 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +9 -5
- data/lib/active_merchant/billing/gateways/secure_pay.rb +10 -8
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -15
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +8 -4
- data/lib/active_merchant/billing/gateways/securion_pay.rb +26 -12
- data/lib/active_merchant/billing/gateways/shift4.rb +34 -26
- data/lib/active_merchant/billing/gateways/shift4_v2.rb +117 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +26 -17
- data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -4
- data/lib/active_merchant/billing/gateways/smart_ps.rb +10 -7
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -4
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +88 -84
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +388 -77
- data/lib/active_merchant/billing/gateways/sum_up.rb +224 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +6 -4
- data/lib/active_merchant/billing/gateways/telr.rb +6 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +6 -4
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +10 -18
- data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
- data/lib/active_merchant/billing/gateways/transax.rb +2 -2
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +9 -5
- data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -31
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -4
- data/lib/active_merchant/billing/gateways/vanco.rb +2 -4
- data/lib/active_merchant/billing/gateways/vantiv_express.rb +668 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +12 -8
- data/lib/active_merchant/billing/gateways/versa_pay.rb +307 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +8 -4
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +5 -5
- data/lib/active_merchant/billing/gateways/vpos.rb +25 -13
- data/lib/active_merchant/billing/gateways/webpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/wepay.rb +6 -4
- data/lib/active_merchant/billing/gateways/wirecard.rb +10 -6
- data/lib/active_merchant/billing/gateways/wompi.rb +14 -7
- data/lib/active_merchant/billing/gateways/world_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +297 -113
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +16 -13
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/gateways/xpay.rb +244 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +15 -3
- data/lib/active_merchant/billing/payment_token.rb +2 -2
- data/lib/active_merchant/billing/response.rb +7 -6
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +8 -20
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +12 -2
- data/lib/active_merchant/net_http_ssl_connection.rb +35 -0
- data/lib/active_merchant/posts_data.rb +19 -4
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant/versionable.rb +29 -0
- data/lib/certs/cacert.pem +1326 -1491
- data/lib/support/gateway_support.rb +3 -3
- data/lib/support/ssl_verify.rb +6 -6
- data/lib/support/ssl_version.rb +8 -8
- metadata +35 -9
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class Shift4Gateway < Gateway
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
version 'v1'
|
|
5
|
+
|
|
6
|
+
self.test_url = "https://utgapi.shift4test.com/api/rest/#{fetch_version}/"
|
|
7
|
+
self.live_url = "https://utg.shift4api.net/api/rest/#{fetch_version}/"
|
|
6
8
|
|
|
7
9
|
self.supported_countries = %w(US CA CU HT DO PR JM TT GP MQ BS BB LC CW AW VC VI GD AG DM KY KN SX TC MF VG BQ AI BL MS)
|
|
8
10
|
self.default_currency = 'USD'
|
|
@@ -20,22 +22,6 @@ module ActiveMerchant #:nodoc:
|
|
|
20
22
|
'add' => 'tokens',
|
|
21
23
|
'verify' => 'cards'
|
|
22
24
|
}
|
|
23
|
-
STANDARD_ERROR_CODE_MAPPING = {
|
|
24
|
-
'incorrect_number' => STANDARD_ERROR_CODE[:incorrect_number],
|
|
25
|
-
'invalid_number' => STANDARD_ERROR_CODE[:invalid_number],
|
|
26
|
-
'invalid_expiry_month' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
27
|
-
'invalid_expiry_year' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
28
|
-
'invalid_cvc' => STANDARD_ERROR_CODE[:invalid_cvc],
|
|
29
|
-
'expired_card' => STANDARD_ERROR_CODE[:expired_card],
|
|
30
|
-
'insufficient_funds' => STANDARD_ERROR_CODE[:card_declined],
|
|
31
|
-
'incorrect_cvc' => STANDARD_ERROR_CODE[:incorrect_cvc],
|
|
32
|
-
'incorrect_zip' => STANDARD_ERROR_CODE[:incorrect_zip],
|
|
33
|
-
'card_declined' => STANDARD_ERROR_CODE[:card_declined],
|
|
34
|
-
'processing_error' => STANDARD_ERROR_CODE[:processing_error],
|
|
35
|
-
'lost_or_stolen' => STANDARD_ERROR_CODE[:card_declined],
|
|
36
|
-
'suspected_fraud' => STANDARD_ERROR_CODE[:card_declined],
|
|
37
|
-
'expired_token' => STANDARD_ERROR_CODE[:card_declined]
|
|
38
|
-
}
|
|
39
25
|
|
|
40
26
|
def initialize(options = {})
|
|
41
27
|
requires!(options, :client_guid, :auth_token)
|
|
@@ -147,7 +133,7 @@ module ActiveMerchant #:nodoc:
|
|
|
147
133
|
gsub(%r(("expirationDate\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
|
|
148
134
|
gsub(%r(("FirstName\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
|
|
149
135
|
gsub(%r(("LastName\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
|
|
150
|
-
gsub(%r(("securityCode\\?":{\\?"
|
|
136
|
+
gsub(%r(("securityCode\\?":{\\?"\w+\\?":\d+,\\?"value\\?":\\?")\d*)i, '\1[FILTERED]')
|
|
151
137
|
end
|
|
152
138
|
|
|
153
139
|
def setup_access_token
|
|
@@ -186,7 +172,7 @@ module ActiveMerchant #:nodoc:
|
|
|
186
172
|
|
|
187
173
|
def add_transaction(post, options)
|
|
188
174
|
post[:transaction] = {}
|
|
189
|
-
post[:transaction][:invoice] = options[:invoice] || Time.new.to_i.to_s[1..3] + rand.to_s[2..7]
|
|
175
|
+
post[:transaction][:invoice] = options[:invoice] || (Time.new.to_i.to_s[1..3] + rand.to_s[2..7])
|
|
190
176
|
post[:transaction][:notes] = options[:notes] if options[:notes].present?
|
|
191
177
|
post[:transaction][:vendorReference] = options[:order_id]
|
|
192
178
|
|
|
@@ -263,6 +249,7 @@ module ActiveMerchant #:nodoc:
|
|
|
263
249
|
message_from(action, response),
|
|
264
250
|
response,
|
|
265
251
|
authorization: authorization_from(action, response),
|
|
252
|
+
avs_result: avs_result_from(response),
|
|
266
253
|
test: test?,
|
|
267
254
|
error_code: error_code_from(action, response)
|
|
268
255
|
)
|
|
@@ -284,13 +271,34 @@ module ActiveMerchant #:nodoc:
|
|
|
284
271
|
end
|
|
285
272
|
|
|
286
273
|
def message_from(action, response)
|
|
287
|
-
success_from(action, response)
|
|
274
|
+
if success_from(action, response)
|
|
275
|
+
'Transaction successful'
|
|
276
|
+
else
|
|
277
|
+
error(response)&.dig('longText') ||
|
|
278
|
+
response['result'].first&.dig('transaction', 'hostresponse', 'reasonDescription') ||
|
|
279
|
+
response['result'].first&.dig('transaction', 'hostResponse', 'reasonDescription') ||
|
|
280
|
+
'Transaction declined'
|
|
281
|
+
end
|
|
288
282
|
end
|
|
289
283
|
|
|
290
284
|
def error_code_from(action, response)
|
|
291
|
-
|
|
285
|
+
code = response['result'].first&.dig('transaction', 'responseCode')
|
|
286
|
+
primary_code = response['result'].first['error'].present?
|
|
287
|
+
return unless code == 'D' || primary_code == true || success_from(action, response)
|
|
288
|
+
|
|
289
|
+
if response['result'].first&.dig('transaction', 'hostresponse')
|
|
290
|
+
response['result'].first&.dig('transaction', 'hostresponse', 'reasonCode')
|
|
291
|
+
elsif response['result'].first&.dig('transaction', 'hostResponse')
|
|
292
|
+
response['result'].first&.dig('transaction', 'hostResponse', 'reasonCode')
|
|
293
|
+
elsif response['result'].first['error']
|
|
294
|
+
response['result'].first&.dig('error', 'primaryCode')
|
|
295
|
+
else
|
|
296
|
+
response['result'].first&.dig('transaction', 'responseCode')
|
|
297
|
+
end
|
|
298
|
+
end
|
|
292
299
|
|
|
293
|
-
|
|
300
|
+
def avs_result_from(response)
|
|
301
|
+
AVSResult.new(code: response['result'].first&.dig('transaction', 'avs', 'result')) if response['result'].first&.dig('transaction', 'avs')
|
|
294
302
|
end
|
|
295
303
|
|
|
296
304
|
def authorization_from(action, response)
|
|
@@ -317,7 +325,7 @@ module ActiveMerchant #:nodoc:
|
|
|
317
325
|
headers['AccessToken'] = @access_token
|
|
318
326
|
headers['Invoice'] = options[:invoice] if action != 'capture' && options[:invoice].present?
|
|
319
327
|
headers['InterfaceVersion'] = '1'
|
|
320
|
-
headers['InterfaceName'] =
|
|
328
|
+
headers['InterfaceName'] = options[:interface_name]
|
|
321
329
|
headers['CompanyName'] = 'Spreedly'
|
|
322
330
|
headers
|
|
323
331
|
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
|
+
class Shift4V2Gateway < SecurionPayGateway
|
|
4
|
+
# same endpont for testing
|
|
5
|
+
self.live_url = 'https://api.shift4.com/'
|
|
6
|
+
self.display_name = 'Shift4'
|
|
7
|
+
self.homepage_url = 'https://dev.shift4.com/us/'
|
|
8
|
+
|
|
9
|
+
def credit(money, payment, options = {})
|
|
10
|
+
post = create_post_for_auth_or_purchase(money, payment, options)
|
|
11
|
+
commit('credits', post, options)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def store(payment_method, options = {})
|
|
15
|
+
post = case payment_method
|
|
16
|
+
when CreditCard
|
|
17
|
+
cc = {}.tap { |card| add_creditcard(card, payment_method, options) }[:card]
|
|
18
|
+
options[:customer_id].blank? ? { email: options[:email], card: cc } : cc
|
|
19
|
+
when Check
|
|
20
|
+
bank_account_object(payment_method, options)
|
|
21
|
+
else
|
|
22
|
+
raise ArgumentError.new("Unhandled payment method #{payment_method.class}.")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
commit url_for_store(payment_method, options), post, options
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def url_for_store(payment_method, options = {})
|
|
29
|
+
case payment_method
|
|
30
|
+
when CreditCard
|
|
31
|
+
options[:customer_id].blank? ? 'customers' : "customers/#{options[:customer_id]}/cards"
|
|
32
|
+
when Check then 'payment-methods'
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def unstore(reference, options = {})
|
|
37
|
+
commit("customers/#{options[:customer_id]}/cards/#{reference}", nil, options, :delete)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def create_post_for_auth_or_purchase(money, payment, options)
|
|
41
|
+
super.tap do |post|
|
|
42
|
+
add_stored_credentials(post, options)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def add_stored_credentials(post, options)
|
|
47
|
+
return unless options[:stored_credential].present?
|
|
48
|
+
|
|
49
|
+
initiator = options.dig(:stored_credential, :initiator)
|
|
50
|
+
reason_type = options.dig(:stored_credential, :reason_type)
|
|
51
|
+
|
|
52
|
+
post_type = {
|
|
53
|
+
%w[cardholder recurring] => 'first_recurring',
|
|
54
|
+
%w[merchant recurring] => 'subsequent_recurring',
|
|
55
|
+
%w[cardholder unscheduled] => 'customer_initiated',
|
|
56
|
+
%w[merchant installment] => 'merchant_initiated'
|
|
57
|
+
}[[initiator, reason_type]]
|
|
58
|
+
post[:type] = post_type if post_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def headers(options = {})
|
|
62
|
+
super.tap do |headers|
|
|
63
|
+
headers['User-Agent'] = "Shift4/v2 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def scrub(transcript)
|
|
68
|
+
super.
|
|
69
|
+
gsub(%r((card\[expMonth\]=)\d+), '\1[FILTERED]').
|
|
70
|
+
gsub(%r((card\[expYear\]=)\d+), '\1[FILTERED]').
|
|
71
|
+
gsub(%r((card\[cardholderName\]=)\w+[^ ]\w+), '\1[FILTERED]')
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def json_error(raw_response)
|
|
75
|
+
super(raw_response, 'Shift4 V2')
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def add_amount(post, money, options, include_currency = false)
|
|
79
|
+
super
|
|
80
|
+
post[:currency]&.upcase!
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def add_creditcard(post, payment_method, options)
|
|
84
|
+
return super unless payment_method.is_a?(Check)
|
|
85
|
+
|
|
86
|
+
post[:paymentMethod] = bank_account_object(payment_method, options)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def bank_account_object(payment_method, options)
|
|
90
|
+
{
|
|
91
|
+
type: :ach,
|
|
92
|
+
fraudCheckData: {
|
|
93
|
+
ipAddress: options[:ip],
|
|
94
|
+
email: options[:email]
|
|
95
|
+
}.compact,
|
|
96
|
+
billing: {
|
|
97
|
+
name: payment_method.name,
|
|
98
|
+
address: { country: options.dig(:billing_address, :country) }
|
|
99
|
+
}.compact,
|
|
100
|
+
ach: {
|
|
101
|
+
account: {
|
|
102
|
+
routingNumber: payment_method.routing_number,
|
|
103
|
+
accountNumber: payment_method.account_number,
|
|
104
|
+
accountType: get_account_type(payment_method)
|
|
105
|
+
},
|
|
106
|
+
verificationProvider: :external
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def get_account_type(check)
|
|
112
|
+
holder = (check.account_holder_type || '').match(/business/i) ? :corporate : :personal
|
|
113
|
+
"#{holder}_#{check.account_type}"
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class SimetrikGateway < Gateway
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
version 'v1'
|
|
5
|
+
version 'v2', :audience_api
|
|
6
|
+
|
|
7
|
+
self.test_url = "https://payments.sta.simetrik.com/#{fetch_version}"
|
|
8
|
+
self.live_url = "https://payments.simetrik.com/#{fetch_version}"
|
|
6
9
|
|
|
7
10
|
class_attribute :test_auth_url, :live_auth_url, :test_audience, :live_audience
|
|
8
11
|
self.test_auth_url = 'https://tenant-payments-dev.us.auth0.com/oauth/token'
|
|
9
12
|
self.live_auth_url = 'https://tenant-payments-prod.us.auth0.com/oauth/token'
|
|
10
13
|
|
|
11
|
-
self.test_audience =
|
|
12
|
-
self.live_audience =
|
|
14
|
+
self.test_audience = "https://tenant-payments-dev.us.auth0.com/api/#{fetch_version(:audience_api)}/"
|
|
15
|
+
self.live_audience = "https://tenant-payments-prod.us.auth0.com/api/#{fetch_version(:audience_api)}/"
|
|
13
16
|
|
|
14
17
|
self.supported_countries = %w(PE AR)
|
|
15
18
|
self.default_currency = 'USD'
|
|
@@ -44,7 +47,7 @@ module ActiveMerchant #:nodoc:
|
|
|
44
47
|
def initialize(options = {})
|
|
45
48
|
requires!(options, :client_id, :client_secret)
|
|
46
49
|
super
|
|
47
|
-
@access_token = {}
|
|
50
|
+
@access_token = options[:access_token] || {}
|
|
48
51
|
sign_access_token()
|
|
49
52
|
end
|
|
50
53
|
|
|
@@ -280,12 +283,12 @@ module ActiveMerchant #:nodoc:
|
|
|
280
283
|
def commit(action, parameters, url_params = {})
|
|
281
284
|
begin
|
|
282
285
|
response = JSON.parse ssl_post(url(action, url_params), post_data(parameters), authorized_headers())
|
|
283
|
-
rescue ResponseError =>
|
|
284
|
-
case
|
|
286
|
+
rescue ResponseError => e
|
|
287
|
+
case e.response.code.to_i
|
|
285
288
|
when 400...499
|
|
286
|
-
response = JSON.parse
|
|
289
|
+
response = JSON.parse e.response.body
|
|
287
290
|
else
|
|
288
|
-
raise
|
|
291
|
+
raise e
|
|
289
292
|
end
|
|
290
293
|
end
|
|
291
294
|
|
|
@@ -318,7 +321,7 @@ module ActiveMerchant #:nodoc:
|
|
|
318
321
|
end
|
|
319
322
|
|
|
320
323
|
def url(action, url_params)
|
|
321
|
-
"#{
|
|
324
|
+
"#{test? ? test_url : live_url}/#{url_params[:token_acquirer]}/#{action}"
|
|
322
325
|
end
|
|
323
326
|
|
|
324
327
|
def post_data(data = {})
|
|
@@ -356,12 +359,18 @@ module ActiveMerchant #:nodoc:
|
|
|
356
359
|
login_info[:client_secret] = @options[:client_secret]
|
|
357
360
|
login_info[:audience] = test? ? test_audience : live_audience
|
|
358
361
|
login_info[:grant_type] = 'client_credentials'
|
|
359
|
-
response = parse(ssl_post(auth_url(), login_info.to_json, {
|
|
360
|
-
'content-Type' => 'application/json'
|
|
361
|
-
}))
|
|
362
362
|
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
begin
|
|
364
|
+
raw_response = ssl_post(auth_url(), login_info.to_json, {
|
|
365
|
+
'content-Type' => 'application/json'
|
|
366
|
+
})
|
|
367
|
+
rescue ResponseError => e
|
|
368
|
+
raise OAuthResponseError.new(e)
|
|
369
|
+
else
|
|
370
|
+
response = parse(raw_response)
|
|
371
|
+
@access_token[:access_token] = response['access_token']
|
|
372
|
+
@access_token[:expires_at] = Time.new.to_i + response['expires_in']
|
|
373
|
+
end
|
|
365
374
|
end
|
|
366
375
|
end
|
|
367
376
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class SkipJackGateway < Gateway
|
|
6
6
|
API_VERSION = '?.?'
|
|
7
7
|
|
|
@@ -263,11 +263,15 @@ module ActiveMerchant #:nodoc:
|
|
|
263
263
|
response = parse(ssl_post(url_for(action), post_data(action, money, parameters)), action)
|
|
264
264
|
|
|
265
265
|
# Pass along the original transaction id in the case an update transaction
|
|
266
|
-
Response.new(
|
|
266
|
+
Response.new(
|
|
267
|
+
response[:success],
|
|
268
|
+
message_from(response, action),
|
|
269
|
+
response,
|
|
267
270
|
test: test?,
|
|
268
271
|
authorization: response[:szTransactionFileName] || parameters[:szTransactionId],
|
|
269
272
|
avs_result: { code: response[:szAVSResponseCode] },
|
|
270
|
-
cvv_result: response[:szCVV2ResponseCode]
|
|
273
|
+
cvv_result: response[:szCVV2ResponseCode]
|
|
274
|
+
)
|
|
271
275
|
end
|
|
272
276
|
|
|
273
277
|
def url_for(action)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require File.join(File.dirname(__FILE__), '..', 'check.rb')
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
5
|
-
class SmartPs < Gateway
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
|
+
class SmartPs < Gateway # :nodoc:
|
|
6
6
|
##
|
|
7
7
|
# This is the base gateway for processors who use the smartPS processing system
|
|
8
8
|
|
|
@@ -226,11 +226,15 @@ module ActiveMerchant #:nodoc:
|
|
|
226
226
|
def commit(action, money, parameters)
|
|
227
227
|
parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money
|
|
228
228
|
response = parse(ssl_post(self.live_url, post_data(action, parameters)))
|
|
229
|
-
Response.new(
|
|
229
|
+
Response.new(
|
|
230
|
+
response['response'] == '1',
|
|
231
|
+
message_from(response),
|
|
232
|
+
response,
|
|
230
233
|
authorization: (response['transactionid'] || response['customer_vault_id']),
|
|
231
234
|
test: test?,
|
|
232
235
|
cvv_result: response['cvvresponse'],
|
|
233
|
-
avs_result: { code: response['avsresponse'] }
|
|
236
|
+
avs_result: { code: response['avsresponse'] }
|
|
237
|
+
)
|
|
234
238
|
end
|
|
235
239
|
|
|
236
240
|
def expdate(creditcard)
|
|
@@ -257,8 +261,7 @@ module ActiveMerchant #:nodoc:
|
|
|
257
261
|
post[:password] = @options[:password]
|
|
258
262
|
post[:type] = action if action
|
|
259
263
|
|
|
260
|
-
|
|
261
|
-
request
|
|
264
|
+
post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
262
265
|
end
|
|
263
266
|
|
|
264
267
|
def determine_funding_source(source)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class SoEasyPayGateway < Gateway
|
|
4
4
|
self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
|
|
5
5
|
self.money_format = :cents
|
|
@@ -161,11 +161,13 @@ module ActiveMerchant #:nodoc:
|
|
|
161
161
|
'Content-Type' => 'text/xml; charset=utf-8' }
|
|
162
162
|
response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
|
|
163
163
|
response = parse(response_string, soap_action)
|
|
164
|
-
return Response.new(
|
|
164
|
+
return Response.new(
|
|
165
|
+
response['errorcode'] == '000',
|
|
165
166
|
response['errormessage'],
|
|
166
167
|
response,
|
|
167
168
|
test: test?,
|
|
168
|
-
authorization: response['transaction_id']
|
|
169
|
+
authorization: response['transaction_id']
|
|
170
|
+
)
|
|
169
171
|
end
|
|
170
172
|
|
|
171
173
|
def build_soap(request)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'nokogiri'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
# Public: This gateway allows you to interact with any gateway you've
|
|
6
6
|
# created in Spreedly (https://spreedly.com). It's an adapter which can be
|
|
7
7
|
# particularly useful if you already have code interacting with
|
|
@@ -271,11 +271,9 @@ module ActiveMerchant #:nodoc:
|
|
|
271
271
|
end
|
|
272
272
|
end
|
|
273
273
|
|
|
274
|
-
def build_xml_request(root)
|
|
274
|
+
def build_xml_request(root, &block)
|
|
275
275
|
builder = Nokogiri::XML::Builder.new
|
|
276
|
-
builder.__send__(root)
|
|
277
|
-
yield(doc)
|
|
278
|
-
end
|
|
276
|
+
builder.__send__(root, &block)
|
|
279
277
|
builder.to_xml
|
|
280
278
|
end
|
|
281
279
|
|