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
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
|
+
class FortisGateway < Gateway
|
|
4
|
+
self.test_url = 'https://api.sandbox.fortis.tech/v1'
|
|
5
|
+
self.live_url = 'https://api.fortis.tech/v1'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = %w{US CA}
|
|
8
|
+
self.default_currency = 'USD'
|
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover jbc unionpay]
|
|
10
|
+
self.money_format = :cents
|
|
11
|
+
self.homepage_url = 'https://fortispay.com'
|
|
12
|
+
self.display_name = 'Fortis'
|
|
13
|
+
|
|
14
|
+
STATUS_MAPPING = {
|
|
15
|
+
101 => 'Sale cc Approved',
|
|
16
|
+
102 => 'Sale cc AuthOnly',
|
|
17
|
+
111 => 'Refund cc Refunded',
|
|
18
|
+
121 => 'Credit/Debit/Refund cc AvsOnly',
|
|
19
|
+
131 => 'Credit/Debit/Refund ach Pending Origination',
|
|
20
|
+
132 => 'Credit/Debit/Refund ach Originating',
|
|
21
|
+
133 => 'Credit/Debit/Refund ach Originated',
|
|
22
|
+
134 => 'Credit/Debit/Refund ach Settled',
|
|
23
|
+
191 => 'Settled (deprecated - batches are now settled on the /v2/transactionbatches endpoint)',
|
|
24
|
+
201 => 'All cc/ach Voided',
|
|
25
|
+
301 => 'All cc/ach Declined',
|
|
26
|
+
331 => 'Credit/Debit/Refund ach Charged Back'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
REASON_MAPPING = {
|
|
30
|
+
0 => 'N/A',
|
|
31
|
+
1000 => 'CC - Approved / ACH - Accepted',
|
|
32
|
+
1001 => 'AuthCompleted',
|
|
33
|
+
1002 => 'Forced',
|
|
34
|
+
1003 => 'AuthOnly Declined',
|
|
35
|
+
1004 => 'Validation Failure (System Run Trx)',
|
|
36
|
+
1005 => 'Processor Response Invalid',
|
|
37
|
+
1200 => 'Voided',
|
|
38
|
+
1201 => 'Partial Approval',
|
|
39
|
+
1240 => 'Approved, optional fields are missing (Paya ACH only)',
|
|
40
|
+
1301 => 'Account Deactivated for Fraud',
|
|
41
|
+
1500 => 'Generic Decline',
|
|
42
|
+
1510 => 'Call',
|
|
43
|
+
1518 => 'Transaction Not Permitted - Terminal',
|
|
44
|
+
1520 => 'Pickup Card',
|
|
45
|
+
1530 => 'Retry Trx',
|
|
46
|
+
1531 => 'Communication Error',
|
|
47
|
+
1540 => 'Setup Issue, contact Support',
|
|
48
|
+
1541 => 'Device is not signature capable',
|
|
49
|
+
1588 => 'Data could not be de-tokenized',
|
|
50
|
+
1599 => 'Other Reason',
|
|
51
|
+
1601 => 'Generic Decline',
|
|
52
|
+
1602 => 'Call',
|
|
53
|
+
1603 => 'No Reply',
|
|
54
|
+
1604 => 'Pickup Card - No Fraud',
|
|
55
|
+
1605 => 'Pickup Card - Fraud',
|
|
56
|
+
1606 => 'Pickup Card - Lost',
|
|
57
|
+
1607 => 'Pickup Card - Stolen',
|
|
58
|
+
1608 => 'Account Error',
|
|
59
|
+
1609 => 'Already Reversed',
|
|
60
|
+
1610 => 'Bad PIN',
|
|
61
|
+
1611 => 'Cashback Exceeded',
|
|
62
|
+
1612 => 'Cashback Not Available',
|
|
63
|
+
1613 => 'CID Error',
|
|
64
|
+
1614 => 'Date Error',
|
|
65
|
+
1615 => 'Do Not Honor',
|
|
66
|
+
1616 => 'NSF',
|
|
67
|
+
1618 => 'Invalid Service Code',
|
|
68
|
+
1619 => 'Exceeded activity limit',
|
|
69
|
+
1620 => 'Violation',
|
|
70
|
+
1621 => 'Encryption Error',
|
|
71
|
+
1622 => 'Card Expired',
|
|
72
|
+
1623 => 'Renter',
|
|
73
|
+
1624 => 'Security Violation',
|
|
74
|
+
1625 => 'Card Not Permitted',
|
|
75
|
+
1626 => 'Trans Not Permitted',
|
|
76
|
+
1627 => 'System Error',
|
|
77
|
+
1628 => 'Bad Merchant ID',
|
|
78
|
+
1629 => 'Duplicate Batch (Already Closed)',
|
|
79
|
+
1630 => 'Batch Rejected',
|
|
80
|
+
1631 => 'Account Closed',
|
|
81
|
+
1632 => 'PIN tries exceeded',
|
|
82
|
+
1640 => 'Required fields are missing (ACH only)',
|
|
83
|
+
1641 => 'Previously declined transaction (1640)',
|
|
84
|
+
1650 => 'Contact Support',
|
|
85
|
+
1651 => 'Max Sending - Throttle Limit Hit (ACH only)',
|
|
86
|
+
1652 => 'Max Attempts Exceeded',
|
|
87
|
+
1653 => 'Contact Support',
|
|
88
|
+
1654 => 'Voided - Online Reversal Failed',
|
|
89
|
+
1655 => 'Decline (AVS Auto Reversal)',
|
|
90
|
+
1656 => 'Decline (CVV Auto Reversal)',
|
|
91
|
+
1657 => 'Decline (Partial Auth Auto Reversal)',
|
|
92
|
+
1658 => 'Expired Authorization',
|
|
93
|
+
1659 => 'Declined - Partial Approval not Supported',
|
|
94
|
+
1660 => 'Bank Account Error, please delete and re-add Token',
|
|
95
|
+
1661 => 'Declined AuthIncrement',
|
|
96
|
+
1662 => 'Auto Reversal - Processor cant settle',
|
|
97
|
+
1663 => 'Manager Needed (Needs override transaction)',
|
|
98
|
+
1664 => 'Token Not Found: Sharing Group Unavailable',
|
|
99
|
+
1665 => 'Contact Not Found: Sharing Group Unavailable',
|
|
100
|
+
1666 => 'Amount Error',
|
|
101
|
+
1667 => 'Action Not Allowed in Current State',
|
|
102
|
+
1668 => 'Original Authorization Not Valid',
|
|
103
|
+
1701 => 'Chip Reject',
|
|
104
|
+
1800 => 'Incorrect CVV',
|
|
105
|
+
1801 => 'Duplicate Transaction',
|
|
106
|
+
1802 => 'MID/TID Not Registered',
|
|
107
|
+
1803 => 'Stop Recurring',
|
|
108
|
+
1804 => 'No Transactions in Batch',
|
|
109
|
+
1805 => 'Batch Does Not Exist'
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
def initialize(options = {})
|
|
113
|
+
requires!(options, :user_id, :user_api_key, :developer_id)
|
|
114
|
+
super
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def authorize(money, payment, options = {})
|
|
118
|
+
commit path(:authorize, payment_type(payment)), auth_purchase_request(money, payment, options)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def purchase(money, payment, options = {})
|
|
122
|
+
commit path(:purchase, payment_type(payment)), auth_purchase_request(money, payment, options)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def capture(money, authorization, options = {})
|
|
126
|
+
commit path(:capture, authorization), { transaction_amount: money }, :patch
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def void(authorization, options = {})
|
|
130
|
+
commit path(:void, authorization), {}, :put
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def refund(money, authorization, options = {})
|
|
134
|
+
commit path(:refund, authorization), { transaction_amount: money }, :patch
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def credit(money, payment, options = {})
|
|
138
|
+
commit path(:credit), auth_purchase_request(money, payment, options)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def store(payment, options = {})
|
|
142
|
+
post = {}
|
|
143
|
+
add_payment(post, payment, include_cvv: false)
|
|
144
|
+
add_address(post, payment, options)
|
|
145
|
+
|
|
146
|
+
commit path(:store), post, :post, options
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def unstore(authorization, options = {})
|
|
150
|
+
commit path(:unstore, authorization), nil, :delete
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def verify(credit_card, options = {})
|
|
154
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
155
|
+
r.process { authorize(100, credit_card, options) }
|
|
156
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def supports_scrubbing?
|
|
161
|
+
true
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def scrub(transcript)
|
|
165
|
+
transcript.
|
|
166
|
+
gsub(/(\\?"account_number\\?":\\?")\d+/, '\1[FILTERED]').
|
|
167
|
+
gsub(/(\\?"cvv\\?":\\?")\d+/, '\1[FILTERED]').
|
|
168
|
+
gsub(%r((user-id: )[\w =]+), '\1[FILTERED]').
|
|
169
|
+
gsub(%r((user-api-key: )[\w =]+), '\1[FILTERED]').
|
|
170
|
+
gsub(%r((developer-id: )[\w =]+), '\1[FILTERED]')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
private
|
|
174
|
+
|
|
175
|
+
def path(action, value = '')
|
|
176
|
+
{
|
|
177
|
+
authorize: '/transactions/cc/auth-only/{placeholder}',
|
|
178
|
+
purchase: '/transactions/cc/sale/{placeholder}',
|
|
179
|
+
capture: '/transactions/{placeholder}/auth-complete',
|
|
180
|
+
void: '/transactions/{placeholder}/void',
|
|
181
|
+
refund: '/transactions/{placeholder}/refund',
|
|
182
|
+
credit: '/transactions/cc/refund/keyed',
|
|
183
|
+
store: '/tokens/cc',
|
|
184
|
+
unstore: '/tokens/{placeholder}'
|
|
185
|
+
}[action]&.gsub('{placeholder}', value.to_s.split('|').first || '')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def payment_type(payment)
|
|
189
|
+
if payment.is_a?(String)
|
|
190
|
+
payment.split('|').last == 'txn' ? 'prev-trxn' : 'token'
|
|
191
|
+
else
|
|
192
|
+
'keyed'
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def auth_purchase_request(money, payment, options = {})
|
|
197
|
+
{}.tap do |post|
|
|
198
|
+
add_invoice(post, money, options)
|
|
199
|
+
add_payment(post, payment)
|
|
200
|
+
add_address(post, payment, options)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def add_address(post, payment_method, options)
|
|
205
|
+
address = address_from_options(options)
|
|
206
|
+
return unless address.present?
|
|
207
|
+
|
|
208
|
+
post[:billing_address] = {
|
|
209
|
+
postal_code: address[:zip],
|
|
210
|
+
street: address[:address1],
|
|
211
|
+
city: address[:city],
|
|
212
|
+
state: address[:state],
|
|
213
|
+
phone: address[:phone],
|
|
214
|
+
country: lookup_country_code(address[:country])
|
|
215
|
+
}.compact
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def address_from_options(options)
|
|
219
|
+
options[:billing_address] || options[:address] || {}
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
def lookup_country_code(country_field)
|
|
223
|
+
return unless country_field.present?
|
|
224
|
+
|
|
225
|
+
country_code = Country.find(country_field)
|
|
226
|
+
country_code&.code(:alpha3)&.value
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def add_invoice(post, money, options)
|
|
230
|
+
post[:transaction_amount] = amount(money)
|
|
231
|
+
post[:order_number] = options[:order_id]
|
|
232
|
+
post[:transaction_api_id] = options[:order_id]
|
|
233
|
+
post[:notification_email_address] = options[:email]
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def add_payment(post, payment, include_cvv: true)
|
|
237
|
+
case payment
|
|
238
|
+
when CreditCard
|
|
239
|
+
post[:account_number] = payment.number
|
|
240
|
+
post[:exp_date] = expdate(payment)
|
|
241
|
+
post[:cvv] = payment.verification_value if include_cvv
|
|
242
|
+
post[:account_holder_name] = payment.name
|
|
243
|
+
when String
|
|
244
|
+
key = { 'prev-trxn' => :previous_transaction_id, 'token' => :token_id }[payment_type(payment)]
|
|
245
|
+
post[key] = payment.split('|').first
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def parse(body)
|
|
250
|
+
JSON.parse(body).with_indifferent_access
|
|
251
|
+
rescue JSON::ParserError, TypeError => e
|
|
252
|
+
{
|
|
253
|
+
errors: body,
|
|
254
|
+
status: 'Unable to parse JSON response',
|
|
255
|
+
message: e.message
|
|
256
|
+
}.with_indifferent_access
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def request_headers
|
|
260
|
+
CaseSensitiveHeaders.new.reverse_merge!({
|
|
261
|
+
'Accept' => 'application/json',
|
|
262
|
+
'Content-Type' => 'application/json',
|
|
263
|
+
'user-id' => @options[:user_id],
|
|
264
|
+
'user-api-key' => @options[:user_api_key],
|
|
265
|
+
'developer-id' => @options[:developer_id]
|
|
266
|
+
})
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
def add_location_id(post, options)
|
|
270
|
+
post[:location_id] = @options[:location_id] || options[:location_id]
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
def commit(path, post, method = :post, options = {})
|
|
274
|
+
add_location_id(post, options) if post.present?
|
|
275
|
+
|
|
276
|
+
http_code, raw_response = ssl_request(method, url(path), post&.compact&.to_json, request_headers)
|
|
277
|
+
response = parse(raw_response)
|
|
278
|
+
|
|
279
|
+
Response.new(
|
|
280
|
+
success_from(http_code, response),
|
|
281
|
+
message_from(response),
|
|
282
|
+
response,
|
|
283
|
+
authorization: authorization_from(response, token?(path)),
|
|
284
|
+
avs_result: AVSResult.new(code: response.dig(:data, :avs_enhanced)),
|
|
285
|
+
cvv_result: CVVResult.new(response.dig(:data, :cvv_response)),
|
|
286
|
+
test: test?,
|
|
287
|
+
error_code: error_code_from(http_code, response)
|
|
288
|
+
)
|
|
289
|
+
rescue ResponseError => e
|
|
290
|
+
response = parse(e.response.body)
|
|
291
|
+
Response.new(false, message_from(response), response, test: test?)
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
def handle_response(response)
|
|
295
|
+
case response.code.to_i
|
|
296
|
+
when 200...300
|
|
297
|
+
return response.code.to_i, response.body
|
|
298
|
+
else
|
|
299
|
+
raise ResponseError.new(response)
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
def url(path)
|
|
304
|
+
"#{test? ? test_url : live_url}#{path}"
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
def success_from(http_code, response)
|
|
308
|
+
return true if http_code == 204
|
|
309
|
+
return response[:data][:active] == true if response[:type] == 'Token'
|
|
310
|
+
return false if response.dig(:data, :status_code) == 301
|
|
311
|
+
|
|
312
|
+
STATUS_MAPPING[response.dig(:data, :status_code)].present?
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
def message_from(response)
|
|
316
|
+
return '' if response.blank?
|
|
317
|
+
|
|
318
|
+
response[:type] == 'Error' ? error_message_from(response) : success_message_from(response)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
def error_message_from(response)
|
|
322
|
+
response[:detail] || response[:title]
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
def success_message_from(response)
|
|
326
|
+
response.dig(:data, :verbiaje) || get_reason_description_from(response) || STATUS_MAPPING[response.dig(:data, :status_code)] || response.dig(:data, :status_code)
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
def get_reason_description_from(response)
|
|
330
|
+
code_id = response.dig(:data, :reason_code_id)
|
|
331
|
+
REASON_MAPPING[code_id] || ((1302..1399).include?(code_id) ? 'Reserved for Future Fraud Reason Codes' : nil)
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
def authorization_from(response, is_token)
|
|
335
|
+
"#{response.dig(:data, :id)}|#{is_token ? 'token' : 'txn'}"
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def token?(path)
|
|
339
|
+
path.match?(/tokens/)
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
def error_code_from(http_code, response)
|
|
343
|
+
[response.dig(:data, :status_code), response.dig(:data, :reason_code_id)].compact.join(' - ') unless success_from(http_code, response)
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class GarantiGateway < Gateway
|
|
4
4
|
self.live_url = 'https://sanalposprov.garanti.com.tr/VPServlet'
|
|
5
5
|
self.test_url = 'https://sanalposprovtest.garanti.com.tr/VPServlet'
|
|
@@ -219,11 +219,13 @@ module ActiveMerchant #:nodoc:
|
|
|
219
219
|
|
|
220
220
|
success = success?(response)
|
|
221
221
|
|
|
222
|
-
Response.new(
|
|
222
|
+
Response.new(
|
|
223
|
+
success,
|
|
223
224
|
success ? 'Approved' : "Declined (Reason: #{response[:reason_code]} - #{response[:error_msg]} - #{response[:sys_err_msg]})",
|
|
224
225
|
response,
|
|
225
226
|
test: test?,
|
|
226
|
-
authorization: response[:order_id]
|
|
227
|
+
authorization: response[:order_id]
|
|
228
|
+
)
|
|
227
229
|
end
|
|
228
230
|
|
|
229
231
|
def parse(body)
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class GlobalCollectGateway < Gateway
|
|
4
4
|
class_attribute :preproduction_url
|
|
5
5
|
class_attribute :ogone_direct_test
|
|
6
6
|
class_attribute :ogone_direct_live
|
|
7
7
|
|
|
8
|
-
self.display_name = 'GlobalCollect'
|
|
8
|
+
self.display_name = 'Worldline (formerly GlobalCollect)'
|
|
9
9
|
self.homepage_url = 'http://www.globalcollect.com/'
|
|
10
10
|
|
|
11
11
|
self.test_url = 'https://eu.sandbox.api-ingenico.com'
|
|
12
|
-
self.preproduction_url = 'https://
|
|
13
|
-
self.live_url = 'https://
|
|
12
|
+
self.preproduction_url = 'https://api.preprod.connect.worldline-solutions.com'
|
|
13
|
+
self.live_url = 'https://api.connect.worldline-solutions.com'
|
|
14
14
|
self.ogone_direct_test = 'https://payment.preprod.direct.worldline-solutions.com'
|
|
15
15
|
self.ogone_direct_live = 'https://payment.direct.worldline-solutions.com'
|
|
16
16
|
|
|
17
17
|
self.supported_countries = %w[AD AE AG AI AL AM AO AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BW BY BZ CA CC CD CF CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HN HR HT HU ID IE IL IM IN IS IT JM JO JP KE KG KH KI KM KN KR KW KY KZ LA LB LC LI LK LR LS LT LU LV MA MC MD ME MF MG MH MK MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PL PN PS PT PW QA RE RO RS RU RW SA SB SC SE SG SH SI SJ SK SL SM SN SR ST SV SZ TC TD TG TH TJ TL TM TN TO TR TT TV TW TZ UA UG US UY UZ VC VE VG VI VN WF WS ZA ZM ZW]
|
|
18
18
|
self.default_currency = 'USD'
|
|
19
19
|
self.money_format = :cents
|
|
20
|
-
self.supported_cardtypes = %i[visa master american_express discover naranja cabal]
|
|
20
|
+
self.supported_cardtypes = %i[visa master american_express discover naranja cabal tuya patagonia_365 tarjeta_sol]
|
|
21
|
+
|
|
22
|
+
version 'v1'
|
|
23
|
+
version 'v2', :ogone_direct
|
|
21
24
|
|
|
22
25
|
def initialize(options = {})
|
|
23
26
|
requires!(options, :merchant_id, :api_key_id, :secret_api_key)
|
|
@@ -40,7 +43,10 @@ module ActiveMerchant #:nodoc:
|
|
|
40
43
|
add_creator_info(post, options)
|
|
41
44
|
add_fraud_fields(post, options)
|
|
42
45
|
add_external_cardholder_authentication_data(post, options)
|
|
43
|
-
|
|
46
|
+
add_threeds_exemption_data(post, options)
|
|
47
|
+
action = options[:action] || :authorize
|
|
48
|
+
|
|
49
|
+
commit(:post, action, post, options:)
|
|
44
50
|
end
|
|
45
51
|
|
|
46
52
|
def capture(money, authorization, options = {})
|
|
@@ -48,7 +54,7 @@ module ActiveMerchant #:nodoc:
|
|
|
48
54
|
add_order(post, money, options, capture: true)
|
|
49
55
|
add_customer_data(post, options)
|
|
50
56
|
add_creator_info(post, options)
|
|
51
|
-
commit(:post, :capture, post, authorization:
|
|
57
|
+
commit(:post, :capture, post, authorization:)
|
|
52
58
|
end
|
|
53
59
|
|
|
54
60
|
def refund(money, authorization, options = {})
|
|
@@ -56,24 +62,28 @@ module ActiveMerchant #:nodoc:
|
|
|
56
62
|
add_amount(post, money, options)
|
|
57
63
|
add_refund_customer_data(post, options)
|
|
58
64
|
add_creator_info(post, options)
|
|
59
|
-
commit(:post, :refund, post, authorization:
|
|
65
|
+
commit(:post, :refund, post, authorization:)
|
|
60
66
|
end
|
|
61
67
|
|
|
62
68
|
def void(authorization, options = {})
|
|
63
69
|
post = nestable_hash
|
|
64
70
|
add_creator_info(post, options)
|
|
65
|
-
commit(:post, :void, post, authorization:
|
|
71
|
+
commit(:post, :void, post, authorization:)
|
|
66
72
|
end
|
|
67
73
|
|
|
68
74
|
def verify(payment, options = {})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
if ogone_direct?
|
|
76
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
77
|
+
r.process { authorize(100, payment, options) }
|
|
78
|
+
r.process { void(r.authorization, options) }
|
|
79
|
+
end
|
|
80
|
+
else
|
|
81
|
+
authorize(0, payment, options.merge(action: :verify))
|
|
72
82
|
end
|
|
73
83
|
end
|
|
74
84
|
|
|
75
85
|
def inquire(authorization, options = {})
|
|
76
|
-
commit(:get, :inquire, nil, authorization:
|
|
86
|
+
commit(:get, :inquire, nil, authorization:)
|
|
77
87
|
end
|
|
78
88
|
|
|
79
89
|
def supports_scrubbing?
|
|
@@ -101,8 +111,8 @@ module ActiveMerchant #:nodoc:
|
|
|
101
111
|
'diners_club' => '132',
|
|
102
112
|
'cabal' => '135',
|
|
103
113
|
'naranja' => '136',
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
apple_pay: '302',
|
|
115
|
+
google_pay: '320'
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
def add_order(post, money, options, capture: false)
|
|
@@ -138,6 +148,7 @@ module ActiveMerchant #:nodoc:
|
|
|
138
148
|
airline_data['isThirdParty'] = options[:airline_data][:is_third_party] if options[:airline_data][:is_third_party]
|
|
139
149
|
airline_data['issueDate'] = options[:airline_data][:issue_date] if options[:airline_data][:issue_date]
|
|
140
150
|
airline_data['merchantCustomerId'] = options[:airline_data][:merchant_customer_id] if options[:airline_data][:merchant_customer_id]
|
|
151
|
+
airline_data['agentNumericCode'] = options[:airline_data][:agent_numeric_code] if options[:airline_data][:agent_numeric_code]
|
|
141
152
|
airline_data['flightLegs'] = add_flight_legs(airline_options)
|
|
142
153
|
airline_data['passengers'] = add_passengers(airline_options)
|
|
143
154
|
|
|
@@ -275,7 +286,7 @@ module ActiveMerchant #:nodoc:
|
|
|
275
286
|
if payment.is_a?(NetworkTokenizationCreditCard)
|
|
276
287
|
add_mobile_credit_card(post, payment, options, specifics_inputs, expirydate)
|
|
277
288
|
elsif payment.is_a?(CreditCard)
|
|
278
|
-
|
|
289
|
+
add_credit_card(post, payment, specifics_inputs, expirydate)
|
|
279
290
|
end
|
|
280
291
|
end
|
|
281
292
|
|
|
@@ -291,31 +302,32 @@ module ActiveMerchant #:nodoc:
|
|
|
291
302
|
end
|
|
292
303
|
|
|
293
304
|
def add_mobile_credit_card(post, payment, options, specifics_inputs, expirydate)
|
|
294
|
-
specifics_inputs['paymentProductId'] =
|
|
305
|
+
specifics_inputs['paymentProductId'] = BRAND_MAP[payment.source]
|
|
295
306
|
post['mobilePaymentMethodSpecificInput'] = specifics_inputs
|
|
296
|
-
|
|
307
|
+
|
|
308
|
+
if options[:use_encrypted_payment_data]
|
|
309
|
+
post['mobilePaymentMethodSpecificInput']['encryptedPaymentData'] = payment.payment_data.to_s&.gsub('=>', ':')
|
|
310
|
+
else
|
|
311
|
+
add_decrypted_payment_data(post, payment, options, expirydate)
|
|
312
|
+
end
|
|
297
313
|
end
|
|
298
314
|
|
|
299
315
|
def add_decrypted_payment_data(post, payment, options, expirydate)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
'paymentMethod' => 'CARD'
|
|
316
|
-
}
|
|
317
|
-
end
|
|
318
|
-
post['mobilePaymentMethodSpecificInput']['decryptedPaymentData'] = data if data
|
|
316
|
+
data_type = payment.source == :apple_pay ? 'decrypted' : 'encrypted'
|
|
317
|
+
data = case payment.source
|
|
318
|
+
when :apple_pay
|
|
319
|
+
{
|
|
320
|
+
'cardholderName' => payment.name,
|
|
321
|
+
'cryptogram' => payment.payment_cryptogram,
|
|
322
|
+
'eci' => payment.eci,
|
|
323
|
+
'expiryDate' => expirydate,
|
|
324
|
+
'dpan' => payment.number
|
|
325
|
+
}
|
|
326
|
+
when :google_pay
|
|
327
|
+
payment.payment_data.to_s&.gsub('=>', ':')
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
post['mobilePaymentMethodSpecificInput']["#{data_type}PaymentData"] = data if data
|
|
319
331
|
end
|
|
320
332
|
|
|
321
333
|
def add_customer_data(post, options, payment = nil)
|
|
@@ -326,8 +338,8 @@ module ActiveMerchant #:nodoc:
|
|
|
326
338
|
post['order']['customer']['merchantCustomerId'] = options[:customer] if options[:customer]
|
|
327
339
|
post['order']['customer']['companyInformation']['name'] = options[:company] if options[:company]
|
|
328
340
|
post['order']['customer']['contactDetails']['emailAddress'] = options[:email] if options[:email]
|
|
329
|
-
if address = options[:billing_address] || options[:address]
|
|
330
|
-
post['order']['customer']['contactDetails']['phoneNumber'] = address[:phone]
|
|
341
|
+
if address = options[:billing_address] || (options[:address] && (address[:phone]))
|
|
342
|
+
post['order']['customer']['contactDetails']['phoneNumber'] = address[:phone]
|
|
331
343
|
end
|
|
332
344
|
end
|
|
333
345
|
|
|
@@ -337,8 +349,8 @@ module ActiveMerchant #:nodoc:
|
|
|
337
349
|
'countryCode' => address[:country]
|
|
338
350
|
}
|
|
339
351
|
post['customer']['contactDetails']['emailAddress'] = options[:email] if options[:email]
|
|
340
|
-
if address = options[:billing_address] || options[:address]
|
|
341
|
-
post['customer']['contactDetails']['phoneNumber'] = address[:phone]
|
|
352
|
+
if address = options[:billing_address] || (options[:address] && (address[:phone]))
|
|
353
|
+
post['customer']['contactDetails']['phoneNumber'] = address[:phone]
|
|
342
354
|
end
|
|
343
355
|
end
|
|
344
356
|
end
|
|
@@ -347,7 +359,8 @@ module ActiveMerchant #:nodoc:
|
|
|
347
359
|
shipping_address = options[:shipping_address]
|
|
348
360
|
if billing_address = options[:billing_address] || options[:address]
|
|
349
361
|
post['order']['customer']['billingAddress'] = {
|
|
350
|
-
'street' => truncate(billing_address[:address1], 50),
|
|
362
|
+
'street' => truncate(split_address(billing_address[:address1])[1], 50),
|
|
363
|
+
'houseNumber' => split_address(billing_address[:address1])[0],
|
|
351
364
|
'additionalInfo' => truncate(billing_address[:address2], 50),
|
|
352
365
|
'zip' => billing_address[:zip],
|
|
353
366
|
'city' => billing_address[:city],
|
|
@@ -357,7 +370,8 @@ module ActiveMerchant #:nodoc:
|
|
|
357
370
|
end
|
|
358
371
|
if shipping_address
|
|
359
372
|
post['order']['customer']['shippingAddress'] = {
|
|
360
|
-
'street' => truncate(shipping_address[:address1], 50),
|
|
373
|
+
'street' => truncate(split_address(shipping_address[:address1])[1], 50),
|
|
374
|
+
'houseNumber' => split_address(shipping_address[:address1])[0],
|
|
361
375
|
'additionalInfo' => truncate(shipping_address[:address2], 50),
|
|
362
376
|
'zip' => shipping_address[:zip],
|
|
363
377
|
'city' => shipping_address[:city],
|
|
@@ -374,7 +388,6 @@ module ActiveMerchant #:nodoc:
|
|
|
374
388
|
def add_fraud_fields(post, options)
|
|
375
389
|
fraud_fields = {}
|
|
376
390
|
fraud_fields.merge!(options[:fraud_fields]) if options[:fraud_fields]
|
|
377
|
-
fraud_fields[:customerIpAddress] = options[:ip] if options[:ip]
|
|
378
391
|
|
|
379
392
|
post['fraudFields'] = fraud_fields unless fraud_fields.empty?
|
|
380
393
|
end
|
|
@@ -403,6 +416,12 @@ module ActiveMerchant #:nodoc:
|
|
|
403
416
|
post['cardPaymentMethodSpecificInput']['threeDSecure']['externalCardholderAuthenticationData'] = authentication_data unless authentication_data.empty?
|
|
404
417
|
end
|
|
405
418
|
|
|
419
|
+
def add_threeds_exemption_data(post, options)
|
|
420
|
+
return unless options[:three_ds_exemption_type]
|
|
421
|
+
|
|
422
|
+
post['cardPaymentMethodSpecificInput']['transactionChannel'] = 'MOTO' if options[:three_ds_exemption_type] == 'moto'
|
|
423
|
+
end
|
|
424
|
+
|
|
406
425
|
def add_number_of_installments(post, options)
|
|
407
426
|
post['order']['additionalInput']['numberOfInstallments'] = options[:number_of_installments] if options[:number_of_installments]
|
|
408
427
|
end
|
|
@@ -427,10 +446,10 @@ module ActiveMerchant #:nodoc:
|
|
|
427
446
|
end
|
|
428
447
|
|
|
429
448
|
def uri(action, authorization)
|
|
430
|
-
version = ogone_direct? ?
|
|
449
|
+
version = ogone_direct? ? fetch_version(:ogone_direct) : fetch_version
|
|
431
450
|
uri = "/#{version}/#{@options[:merchant_id]}/"
|
|
432
451
|
case action
|
|
433
|
-
when :authorize
|
|
452
|
+
when :authorize, :verify
|
|
434
453
|
uri + 'payments'
|
|
435
454
|
when :capture
|
|
436
455
|
capture_name = ogone_direct? ? 'capture' : 'approve'
|
|
@@ -472,7 +491,7 @@ module ActiveMerchant #:nodoc:
|
|
|
472
491
|
def json_error(raw_response)
|
|
473
492
|
{
|
|
474
493
|
'error_message' => 'Invalid response received from the Ingenico ePayments (formerly GlobalCollect) API. Please contact Ingenico ePayments if you continue to receive this message.' \
|
|
475
|
-
|
|
494
|
+
" (The raw response returned by the API was #{raw_response.inspect})"
|
|
476
495
|
}
|
|
477
496
|
end
|
|
478
497
|
|
|
@@ -512,8 +531,6 @@ module ActiveMerchant #:nodoc:
|
|
|
512
531
|
def success_from(action, response)
|
|
513
532
|
return false if response['errorId'] || response['error_message']
|
|
514
533
|
|
|
515
|
-
return %w(CAPTURED CAPTURE_REQUESTED).include?(response.dig('payment', 'status')) if response.dig('payment', 'paymentOutput', 'paymentMethod') == 'mobile'
|
|
516
|
-
|
|
517
534
|
case action
|
|
518
535
|
when :authorize
|
|
519
536
|
response.dig('payment', 'statusOutput', 'isAuthorized')
|
|
@@ -526,6 +543,8 @@ module ActiveMerchant #:nodoc:
|
|
|
526
543
|
when :refund
|
|
527
544
|
refund_status = response.dig('status') || response.dig('payment', 'status')
|
|
528
545
|
%w(REFUNDED REFUND_REQUESTED).include?(refund_status)
|
|
546
|
+
when :verify
|
|
547
|
+
response.dig('payment', 'statusOutput', 'statusCategory') == 'ACCOUNT_VERIFIED'
|
|
529
548
|
else
|
|
530
549
|
response['status'] != 'REJECTED'
|
|
531
550
|
end
|
|
@@ -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
|
class GlobalTransportGateway < Gateway
|
|
6
6
|
self.test_url = 'https://certapia.globalpay.com/GlobalPay/transact.asmx/ProcessCreditCard'
|
|
7
7
|
self.live_url = 'https://api.globalpay.com/GlobalPay/transact.asmx/ProcessCreditCard'
|
|
@@ -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
|
class HdfcGateway < Gateway
|
|
6
6
|
self.display_name = 'HDFC'
|
|
7
7
|
self.homepage_url = 'http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i'
|