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,267 @@
|
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
|
+
class LoanPaymentProGateway < Gateway
|
|
4
|
+
self.live_url = 'https://gateway.loanpaymentpro.com'
|
|
5
|
+
self.test_url = 'https://gateway.loanpaymentpro.com'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = ['US']
|
|
8
|
+
self.default_currency = 'USD'
|
|
9
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
|
10
|
+
|
|
11
|
+
self.homepage_url = 'https://loanpaymentpro.com/'
|
|
12
|
+
self.display_name = 'LoanPaymentPro'
|
|
13
|
+
|
|
14
|
+
RESPONSE_CODE_MAPPING = {
|
|
15
|
+
1 => 'Customer added successfully.',
|
|
16
|
+
3 => 'Customer removed successfully.',
|
|
17
|
+
4 => 'An error occurred while removing the customer.',
|
|
18
|
+
5 => 'Customer updated successfully.',
|
|
19
|
+
6 => 'An error occurred while updating the customer.',
|
|
20
|
+
7 => 'Customer was retrieved successfully.',
|
|
21
|
+
8 => 'A customer with that token was not found.',
|
|
22
|
+
9 => 'Customer listing successful.',
|
|
23
|
+
10 => 'Payment method was removed successfully.',
|
|
24
|
+
11 => 'An error occurred while removing the payment method.',
|
|
25
|
+
12 => 'A payment method with that token was not found.',
|
|
26
|
+
13 => 'Payment method updated successfully.',
|
|
27
|
+
14 => 'An error occurred while updating the payment method.',
|
|
28
|
+
15 => 'Payment method retrieved successfully.',
|
|
29
|
+
21 => 'Payment method added successfully.',
|
|
30
|
+
27 => 'Transaction search completed successfully',
|
|
31
|
+
28 => 'An error occurred while searching transactions.',
|
|
32
|
+
30 => 'Payment method listing successful.',
|
|
33
|
+
31 => 'Transaction retrieved sucessfully.',
|
|
34
|
+
32 => 'A transaction with that ID could not be found.',
|
|
35
|
+
41 => 'Transaction summary retrieved successfully.',
|
|
36
|
+
42 => 'Error retrieving transaction summary',
|
|
37
|
+
46 => 'A transaction with that InvoiceId could not be found.',
|
|
38
|
+
56 => 'The operation failed to complete successfully.',
|
|
39
|
+
95 => 'Timeout occurred, transaction not processed.',
|
|
40
|
+
105 => 'Batch report retrieved successfully.',
|
|
41
|
+
198 => 'Invalid transaction key to perform this action',
|
|
42
|
+
254 => 'Portfolio retrieved successfully',
|
|
43
|
+
275 => 'Invalid transaction type',
|
|
44
|
+
276 => 'Batch search failed.',
|
|
45
|
+
376 => 'Pre-Payment created successfully',
|
|
46
|
+
377 => 'An error occurred while creating the pre-payment',
|
|
47
|
+
378 => 'Pre-Payment retrieval successful.',
|
|
48
|
+
379 => 'Invalid pre-payment uniqueId',
|
|
49
|
+
380 => 'An error occurred while retrieving pre-payment information',
|
|
50
|
+
382 => 'An error occurred while retrieving pre-payment information',
|
|
51
|
+
383 => 'Pre-Payment updated successfully',
|
|
52
|
+
384 => 'Invalid pre-payment uniqueId',
|
|
53
|
+
385 => 'An error occurred while updating the pre-payment'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
def initialize(options = {})
|
|
57
|
+
requires!(options, :transaction_key)
|
|
58
|
+
super
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def purchase(money, payment, options = {})
|
|
62
|
+
return delegate_to_ach(:purchase, money, payment, options) if use_ach_gateway?(payment)
|
|
63
|
+
|
|
64
|
+
post = {}
|
|
65
|
+
|
|
66
|
+
add_invoice(post, money, options)
|
|
67
|
+
add_payment(post, payment)
|
|
68
|
+
add_address(post, payment, options)
|
|
69
|
+
|
|
70
|
+
commit(auth_purchase_path(payment, options), post)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def authorize(money, payment, options = {})
|
|
74
|
+
return delegate_to_ach(:authorize, money, payment, options) if use_ach_gateway?(payment)
|
|
75
|
+
|
|
76
|
+
options[:action] = :authorize
|
|
77
|
+
purchase(money, payment, options)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def capture(money, authorization, options = {})
|
|
81
|
+
commit(path(:capture, authorization), {})
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def refund(money, authorization, options = {})
|
|
85
|
+
return delegate_to_ach(:refund, money, authorization, options) if use_ach_gateway?(authorization)
|
|
86
|
+
|
|
87
|
+
transaction_id, invoice_id = authorization.split('|')
|
|
88
|
+
post = { Amount: amount(money), InvoiceId: invoice_id }
|
|
89
|
+
|
|
90
|
+
commit(path(:refund, transaction_id), post)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def void(authorization, options = {})
|
|
94
|
+
return delegate_to_ach(:void, authorization, options) if use_ach_gateway?(authorization)
|
|
95
|
+
|
|
96
|
+
commit(path(:void, authorization), {})
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def verify(credit_card, options = {})
|
|
100
|
+
post = {}
|
|
101
|
+
add_payment(post, credit_card)
|
|
102
|
+
add_address(post, credit_card, options)
|
|
103
|
+
|
|
104
|
+
commit(path(:verify), post)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def store(credit_card, options = {})
|
|
108
|
+
post = {}
|
|
109
|
+
add_payment(post, credit_card)
|
|
110
|
+
add_address(post, credit_card, options)
|
|
111
|
+
|
|
112
|
+
commit(path(:store), post)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def unstore(authorization, options = {})
|
|
116
|
+
commit(path(:unstore, authorization), {}, :delete)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def supports_scrubbing?
|
|
120
|
+
true
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def scrub(transcript)
|
|
124
|
+
transcript.
|
|
125
|
+
gsub(%r((Transactionkey: )\S+), '\1[FILTERED]').
|
|
126
|
+
gsub(%r((CardNumber=)\d+), '\1[FILTERED]').
|
|
127
|
+
gsub(%r((CardCode=)\d+), '\1[FILTERED]')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
private
|
|
131
|
+
|
|
132
|
+
def address_from_options(options)
|
|
133
|
+
options[:billing_address] || options[:address] || {}
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def address_names(address_name, payment_method)
|
|
137
|
+
names = split_names(address_name)
|
|
138
|
+
return names if names.any?(&:present?)
|
|
139
|
+
|
|
140
|
+
[payment_method.try(:first_name), payment_method.try(:last_name)]
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def add_address(post, payment_method, options)
|
|
144
|
+
address = address_from_options(options)
|
|
145
|
+
first_name, last_name = address_names(address[:name], payment_method)
|
|
146
|
+
|
|
147
|
+
post.merge!(
|
|
148
|
+
BillingFirstName: first_name,
|
|
149
|
+
BillingLastName: last_name,
|
|
150
|
+
BillingAddress1: address[:address1],
|
|
151
|
+
BillingAddress2: address[:address2],
|
|
152
|
+
BillingCity: address[:city],
|
|
153
|
+
BillingState: address[:state],
|
|
154
|
+
BillingZip: address[:zip]
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def add_invoice(post, money, options)
|
|
159
|
+
post[:InvoiceId] = options[:order_id]
|
|
160
|
+
post[:Amount] = amount(money)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def add_payment(post, payment)
|
|
164
|
+
return unless payment.is_a?(CreditCard)
|
|
165
|
+
|
|
166
|
+
post.merge!(
|
|
167
|
+
CardNumber: payment.number,
|
|
168
|
+
CardCode: payment.verification_value,
|
|
169
|
+
ExpMonth: format(payment.month, :two_digits),
|
|
170
|
+
ExpYear: format(payment.year, :two_digits)
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def parse(body)
|
|
175
|
+
JSON.parse(body).with_indifferent_access
|
|
176
|
+
rescue JSON::ParserError, TypeError => e
|
|
177
|
+
{
|
|
178
|
+
errors: body,
|
|
179
|
+
status: 'Unable to parse JSON response',
|
|
180
|
+
message: e.message
|
|
181
|
+
}.with_indifferent_access
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def path(action, value = '')
|
|
185
|
+
placeholder = value.to_s.split('|').first || ''
|
|
186
|
+
|
|
187
|
+
{
|
|
188
|
+
purchase: 'v2-3/paymentcards/run',
|
|
189
|
+
authorize: 'v2-3/paymentcards/authorize',
|
|
190
|
+
capture: "v2-1/transactions/#{placeholder}/capture",
|
|
191
|
+
void: "v2/payments/#{placeholder}/void",
|
|
192
|
+
refund: "v2/payments/#{placeholder}/refund",
|
|
193
|
+
verify: 'v2/paymentcards/validate/detailed',
|
|
194
|
+
store: 'v2/paymentcards/add',
|
|
195
|
+
unstore: "v2/paymentcards/#{placeholder}/delete",
|
|
196
|
+
authorize_with_token: "v2-3/payments/paymentcards/#{placeholder}/authorize",
|
|
197
|
+
purchase_with_token: "v2-3/payments/paymentcards/#{placeholder}/run"
|
|
198
|
+
}[action]
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def auth_purchase_path(payment, options)
|
|
202
|
+
action = options.delete(:action) || :purchase
|
|
203
|
+
pm_token = ''
|
|
204
|
+
|
|
205
|
+
if payment.is_a?(String)
|
|
206
|
+
pm_token = payment
|
|
207
|
+
action = "#{action}_with_token".to_sym
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
path(action, pm_token)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def url(path)
|
|
214
|
+
"#{test? ? test_url : live_url}/#{path}"
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def request_headers
|
|
218
|
+
{ TransactionKey: @options[:transaction_key] }
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def commit(path, post = {}, method = :post, options = {})
|
|
222
|
+
response = parse(ssl_request(method, url(path), post_data(post), request_headers))
|
|
223
|
+
|
|
224
|
+
Response.new(
|
|
225
|
+
success_from(response),
|
|
226
|
+
message_from(response),
|
|
227
|
+
response,
|
|
228
|
+
authorization: authorization_from(response, post),
|
|
229
|
+
test: test?,
|
|
230
|
+
error_code: error_code_from(response)
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
def success_from(response)
|
|
235
|
+
response[:Status] == 'Success'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def message_from(response)
|
|
239
|
+
response[:Message] || response[:ResponseMessage] || response[:Status]
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def authorization_from(response = {}, post = {})
|
|
243
|
+
response[:PaymentMethodToken].presence || [response[:TransactionId], post[:InvoiceId]].compact.join('|')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def post_data(params)
|
|
247
|
+
URI.encode_www_form(params.compact)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def error_code_from(response)
|
|
251
|
+
RESPONSE_CODE_MAPPING[response[:ResponseCode].to_i] unless success_from(response)
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def ach_gateway
|
|
255
|
+
@ach_gateway ||= LoanPaymentProAchGateway.new(@options)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def use_ach_gateway?(payment_or_auth)
|
|
259
|
+
payment_or_auth.is_a?(Check) || (payment_or_auth.is_a?(String) && payment_or_auth.include?('|ach'))
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def delegate_to_ach(method, *args)
|
|
263
|
+
ach_gateway.public_send(method, *args)
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
|
+
class LoanPaymentProAchGateway < LoanPaymentProGateway
|
|
4
|
+
self.live_url = 'https://www.checkcommerce.com/EpnPublic/ACH.aspx'
|
|
5
|
+
self.test_url = 'https://sandbox.checkcommerce.com/EpnPublic/ACH.aspx'
|
|
6
|
+
|
|
7
|
+
API_VERSION = '1.4.2.36'.freeze
|
|
8
|
+
|
|
9
|
+
def initialize(options = {})
|
|
10
|
+
requires!(options, :login, :password)
|
|
11
|
+
super
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def purchase(money, bank_account, options = {})
|
|
15
|
+
post = {
|
|
16
|
+
Method: options.delete(:method) || :Debit,
|
|
17
|
+
ReferenceNumber: options[:order_id] || SecureRandom.uuid,
|
|
18
|
+
Name: bank_account.name,
|
|
19
|
+
Amount: amount(money),
|
|
20
|
+
RoutingNumber: bank_account.routing_number,
|
|
21
|
+
AccountNumber: bank_account.account_number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
commit(post)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def authorize(money, bank_account, options = {})
|
|
28
|
+
purchase(money, bank_account, options.merge(method: :Authorize))
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def void(authorization, options = {})
|
|
32
|
+
post = {
|
|
33
|
+
Method: :Cancel,
|
|
34
|
+
TransactionId: authorization.to_s.split('|').first
|
|
35
|
+
}
|
|
36
|
+
commit(post)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def refund(money, authorization, options = {})
|
|
40
|
+
post = {
|
|
41
|
+
Method: :Refund,
|
|
42
|
+
TransactionId: authorization.to_s.split('|').first,
|
|
43
|
+
Amount: amount(money)
|
|
44
|
+
}
|
|
45
|
+
commit(post)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
def add_credentials_and_version(post)
|
|
51
|
+
post.merge!({
|
|
52
|
+
Login: @options[:login],
|
|
53
|
+
Password: @options[:password],
|
|
54
|
+
Version: API_VERSION
|
|
55
|
+
})
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def url
|
|
59
|
+
test? ? test_url : live_url
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def commit(post = {}, method = :post, options = {})
|
|
63
|
+
add_credentials_and_version(post)
|
|
64
|
+
response = parse(ssl_request(method, url, post_data(post), {}))
|
|
65
|
+
|
|
66
|
+
Response.new(
|
|
67
|
+
success_from(response),
|
|
68
|
+
message_from(response),
|
|
69
|
+
response,
|
|
70
|
+
authorization: authorization_from(response),
|
|
71
|
+
test: test?,
|
|
72
|
+
error_code: error_code_from(response)
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def parse(response_body)
|
|
77
|
+
URI.decode_www_form(response_body.gsub(/\r\n/, '&')).to_h.with_indifferent_access
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def success_from(response)
|
|
81
|
+
response[:Success].to_s.downcase == 'true'
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def message_from(response)
|
|
85
|
+
response[:Message]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def authorization_from(response = {})
|
|
89
|
+
"#{response[:TransactionID]}|ach"
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant
|
|
|
10
10
|
if options[:pay_mode]
|
|
11
11
|
post = new_post
|
|
12
12
|
add_invoice(post, amount, options)
|
|
13
|
-
add_reference(post, *new_authorization)
|
|
13
|
+
add_reference(post, *new_authorization(options))
|
|
14
14
|
add_payment_method(post, payment_method)
|
|
15
15
|
add_customer_data(post, payment_method, options)
|
|
16
16
|
add_3dsecure_id(post, options)
|
|
@@ -27,7 +27,7 @@ module ActiveMerchant
|
|
|
27
27
|
def authorize(amount, payment_method, options = {})
|
|
28
28
|
post = new_post
|
|
29
29
|
add_invoice(post, amount, options)
|
|
30
|
-
add_reference(post, *new_authorization)
|
|
30
|
+
add_reference(post, *new_authorization(options))
|
|
31
31
|
add_payment_method(post, payment_method)
|
|
32
32
|
add_customer_data(post, payment_method, options)
|
|
33
33
|
add_3dsecure_id(post, options)
|
|
@@ -264,9 +264,9 @@ module ActiveMerchant
|
|
|
264
264
|
authorization.split('|')
|
|
265
265
|
end
|
|
266
266
|
|
|
267
|
-
def new_authorization
|
|
267
|
+
def new_authorization(options)
|
|
268
268
|
# Must be unique within a merchant id.
|
|
269
|
-
orderid = SecureRandom.uuid
|
|
269
|
+
orderid = options[:order_id] || SecureRandom.uuid
|
|
270
270
|
|
|
271
271
|
# Must be unique within an order id.
|
|
272
272
|
transactionid = '1'
|
|
@@ -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 MaxipagoGateway < Gateway
|
|
6
6
|
API_VERSION = '3.1.1.15'
|
|
7
7
|
|
|
@@ -79,8 +79,8 @@ module ActiveMerchant #:nodoc:
|
|
|
79
79
|
|
|
80
80
|
private
|
|
81
81
|
|
|
82
|
-
def commit(action)
|
|
83
|
-
request = build_xml_request(action
|
|
82
|
+
def commit(action, &block)
|
|
83
|
+
request = build_xml_request(action, &block)
|
|
84
84
|
response = parse(ssl_post(url, request, 'Content-Type' => 'text/xml'))
|
|
85
85
|
|
|
86
86
|
Response.new(
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class MercadoPagoGateway < Gateway
|
|
4
|
-
|
|
4
|
+
version 'v1'
|
|
5
|
+
|
|
6
|
+
self.live_url = self.test_url = "https://api.mercadopago.com/#{fetch_version}"
|
|
5
7
|
|
|
6
8
|
self.supported_countries = %w[AR BR CL CO MX PE UY]
|
|
7
|
-
self.supported_cardtypes = %i[visa master american_express elo cabal naranja creditel]
|
|
9
|
+
self.supported_cardtypes = %i[visa master american_express elo cabal naranja creditel patagonia_365 tarjeta_sol]
|
|
8
10
|
|
|
9
11
|
self.homepage_url = 'https://www.mercadopago.com/'
|
|
10
12
|
self.display_name = 'Mercado Pago'
|
|
@@ -43,6 +45,7 @@ module ActiveMerchant #:nodoc:
|
|
|
43
45
|
post = {}
|
|
44
46
|
authorization, original_amount = authorization.split('|')
|
|
45
47
|
post[:amount] = amount(money).to_f if original_amount && original_amount.to_f > amount(money).to_f
|
|
48
|
+
add_idempotency_key(post, options)
|
|
46
49
|
commit('refund', "payments/#{authorization}/refunds", post)
|
|
47
50
|
end
|
|
48
51
|
|
|
@@ -85,7 +88,7 @@ module ActiveMerchant #:nodoc:
|
|
|
85
88
|
post[:expiration_month] = payment.month
|
|
86
89
|
post[:expiration_year] = payment.year
|
|
87
90
|
post[:cardholder] = {
|
|
88
|
-
name: payment.name,
|
|
91
|
+
name: format_name(payment.name),
|
|
89
92
|
identification: {
|
|
90
93
|
type: options[:cardholder_identification_type],
|
|
91
94
|
number: options[:cardholder_identification_number]
|
|
@@ -105,7 +108,9 @@ module ActiveMerchant #:nodoc:
|
|
|
105
108
|
add_net_amount(post, options)
|
|
106
109
|
add_taxes(post, options)
|
|
107
110
|
add_notification_url(post, options)
|
|
108
|
-
post
|
|
111
|
+
add_idempotency_key(post, options)
|
|
112
|
+
add_3ds(post, options)
|
|
113
|
+
post[:binary_mode] = options.fetch(:binary_mode, true) unless options[:execute_threed]
|
|
109
114
|
post
|
|
110
115
|
end
|
|
111
116
|
|
|
@@ -134,7 +139,7 @@ module ActiveMerchant #:nodoc:
|
|
|
134
139
|
end
|
|
135
140
|
|
|
136
141
|
def add_additional_data(post, options)
|
|
137
|
-
post[:sponsor_id] = options[:sponsor_id]
|
|
142
|
+
post[:sponsor_id] = options[:sponsor_id] unless test?
|
|
138
143
|
post[:metadata] = options[:metadata] if options[:metadata]
|
|
139
144
|
post[:device_id] = options[:device_id] if options[:device_id]
|
|
140
145
|
post[:additional_info] = {
|
|
@@ -148,8 +153,8 @@ module ActiveMerchant #:nodoc:
|
|
|
148
153
|
def add_customer_data(post, payment, options)
|
|
149
154
|
post[:payer] = {
|
|
150
155
|
email: options[:email],
|
|
151
|
-
first_name: payment.first_name,
|
|
152
|
-
last_name: payment.last_name
|
|
156
|
+
first_name: format_name(payment.first_name),
|
|
157
|
+
last_name: format_name(payment.last_name)
|
|
153
158
|
}.merge(options[:payer] || {})
|
|
154
159
|
end
|
|
155
160
|
|
|
@@ -211,6 +216,10 @@ module ActiveMerchant #:nodoc:
|
|
|
211
216
|
post[:net_amount] = Float(options[:net_amount]) if options[:net_amount]
|
|
212
217
|
end
|
|
213
218
|
|
|
219
|
+
def add_idempotency_key(post, options)
|
|
220
|
+
post[:idempotency_key] = options[:idempotency_key] if options[:idempotency_key]
|
|
221
|
+
end
|
|
222
|
+
|
|
214
223
|
def add_notification_url(post, options)
|
|
215
224
|
post[:notification_url] = options[:notification_url] if options[:notification_url]
|
|
216
225
|
end
|
|
@@ -287,7 +296,7 @@ module ActiveMerchant #:nodoc:
|
|
|
287
296
|
if action == 'refund'
|
|
288
297
|
response['status'] != 404 && response['error'].nil?
|
|
289
298
|
else
|
|
290
|
-
%w[active approved authorized cancelled in_process].include?(response['status'])
|
|
299
|
+
%w[active approved authorized cancelled in_process pending].include?(response['status'])
|
|
291
300
|
end
|
|
292
301
|
end
|
|
293
302
|
|
|
@@ -300,7 +309,11 @@ module ActiveMerchant #:nodoc:
|
|
|
300
309
|
end
|
|
301
310
|
|
|
302
311
|
def post_data(parameters = {})
|
|
303
|
-
parameters.clone.tap
|
|
312
|
+
params = parameters.clone.tap do |p|
|
|
313
|
+
p.delete(:device_id)
|
|
314
|
+
p.delete(:idempotency_key)
|
|
315
|
+
end
|
|
316
|
+
params.to_json
|
|
304
317
|
end
|
|
305
318
|
|
|
306
319
|
def inquire_path(authorization, options)
|
|
@@ -322,6 +335,13 @@ module ActiveMerchant #:nodoc:
|
|
|
322
335
|
end
|
|
323
336
|
end
|
|
324
337
|
|
|
338
|
+
def add_3ds(post, options)
|
|
339
|
+
return unless options[:execute_threed]
|
|
340
|
+
|
|
341
|
+
post[:three_d_secure_mode] = options[:three_ds_mode] == 'mandatory' ? 'mandatory' : 'optional'
|
|
342
|
+
post[:notification_url] = options[:notification_url] if options[:notification_url]
|
|
343
|
+
end
|
|
344
|
+
|
|
325
345
|
def url(action)
|
|
326
346
|
full_url = (test? ? test_url : live_url)
|
|
327
347
|
full_url + "/#{action}?access_token=#{CGI.escape(@options[:access_token])}"
|
|
@@ -332,6 +352,7 @@ module ActiveMerchant #:nodoc:
|
|
|
332
352
|
'Content-Type' => 'application/json'
|
|
333
353
|
}
|
|
334
354
|
headers['X-meli-session-id'] = options[:device_id] if options[:device_id]
|
|
355
|
+
headers['X-Idempotency-Key'] = options[:idempotency_key] if options[:idempotency_key]
|
|
335
356
|
headers
|
|
336
357
|
end
|
|
337
358
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class MerchantESolutionsGateway < Gateway
|
|
4
4
|
include Empty
|
|
5
5
|
|
|
@@ -180,7 +180,7 @@ module ActiveMerchant #:nodoc:
|
|
|
180
180
|
|
|
181
181
|
def commit(action, money, parameters)
|
|
182
182
|
url = test? ? self.test_url : self.live_url
|
|
183
|
-
parameters[:transaction_amount] = amount(money) if
|
|
183
|
+
parameters[:transaction_amount] = amount(money) if !(action == 'V') && money
|
|
184
184
|
|
|
185
185
|
response =
|
|
186
186
|
begin
|
|
@@ -189,11 +189,15 @@ module ActiveMerchant #:nodoc:
|
|
|
189
189
|
{ 'error_code' => '404', 'auth_response_text' => e.to_s }
|
|
190
190
|
end
|
|
191
191
|
|
|
192
|
-
Response.new(
|
|
192
|
+
Response.new(
|
|
193
|
+
success_from(response),
|
|
194
|
+
message_from(response),
|
|
195
|
+
response,
|
|
193
196
|
authorization: authorization_from(response),
|
|
194
197
|
test: test?,
|
|
195
198
|
cvv_result: response['cvv2_result'],
|
|
196
|
-
avs_result: { code: response['avs_result'] }
|
|
199
|
+
avs_result: { code: response['avs_result'] }
|
|
200
|
+
)
|
|
197
201
|
end
|
|
198
202
|
|
|
199
203
|
def authorization_from(response)
|
|
@@ -220,8 +224,7 @@ module ActiveMerchant #:nodoc:
|
|
|
220
224
|
post[:profile_key] = @options[:password]
|
|
221
225
|
post[:transaction_type] = action if action
|
|
222
226
|
|
|
223
|
-
|
|
224
|
-
request
|
|
227
|
+
post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
|
|
225
228
|
end
|
|
226
229
|
end
|
|
227
230
|
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 MerchantPartnersGateway < Gateway
|
|
6
6
|
self.display_name = 'Merchant Partners'
|
|
7
7
|
self.homepage_url = 'http://www.merchantpartners.com/'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class MerchantWareGateway < Gateway
|
|
4
4
|
class_attribute :v4_live_url
|
|
5
5
|
|
|
@@ -290,19 +290,26 @@ module ActiveMerchant #:nodoc:
|
|
|
290
290
|
|
|
291
291
|
def commit(action, request, v4 = false)
|
|
292
292
|
begin
|
|
293
|
-
data = ssl_post(
|
|
293
|
+
data = ssl_post(
|
|
294
|
+
url(v4),
|
|
295
|
+
request,
|
|
294
296
|
'Content-Type' => 'text/xml; charset=utf-8',
|
|
295
|
-
'SOAPAction' => soap_action(action, v4)
|
|
297
|
+
'SOAPAction' => soap_action(action, v4)
|
|
298
|
+
)
|
|
296
299
|
response = parse(action, data)
|
|
297
300
|
rescue ActiveMerchant::ResponseError => e
|
|
298
301
|
response = parse_error(e.response)
|
|
299
302
|
end
|
|
300
303
|
|
|
301
|
-
Response.new(
|
|
304
|
+
Response.new(
|
|
305
|
+
response[:success],
|
|
306
|
+
response[:message],
|
|
307
|
+
response,
|
|
302
308
|
test: test?,
|
|
303
309
|
authorization: authorization_from(response),
|
|
304
310
|
avs_result: { code: response['AVSResponse'] },
|
|
305
|
-
cvv_result: response['CVResponse']
|
|
311
|
+
cvv_result: response['CVResponse']
|
|
312
|
+
)
|
|
306
313
|
end
|
|
307
314
|
|
|
308
315
|
def authorization_from(response)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class MerchantWareVersionFourGateway < Gateway
|
|
4
4
|
self.live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
|
5
5
|
self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
|
|
@@ -261,19 +261,26 @@ module ActiveMerchant #:nodoc:
|
|
|
261
261
|
|
|
262
262
|
def commit(action, request)
|
|
263
263
|
begin
|
|
264
|
-
data = ssl_post(
|
|
264
|
+
data = ssl_post(
|
|
265
|
+
url,
|
|
266
|
+
request,
|
|
265
267
|
'Content-Type' => 'text/xml; charset=utf-8',
|
|
266
|
-
'SOAPAction' => soap_action(action)
|
|
268
|
+
'SOAPAction' => soap_action(action)
|
|
269
|
+
)
|
|
267
270
|
response = parse(action, data)
|
|
268
271
|
rescue ActiveMerchant::ResponseError => e
|
|
269
272
|
response = parse_error(e.response, action)
|
|
270
273
|
end
|
|
271
274
|
|
|
272
|
-
Response.new(
|
|
275
|
+
Response.new(
|
|
276
|
+
response[:success],
|
|
277
|
+
response[:message],
|
|
278
|
+
response,
|
|
273
279
|
test: test?,
|
|
274
280
|
authorization: authorization_from(response),
|
|
275
281
|
avs_result: { code: response['AvsResponse'] },
|
|
276
|
-
cvv_result: response['CvResponse']
|
|
282
|
+
cvv_result: response['CvResponse']
|
|
283
|
+
)
|
|
277
284
|
end
|
|
278
285
|
|
|
279
286
|
def authorization_from(response)
|