activemerchant 1.42.6 → 1.90.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 +5 -13
- data/CHANGELOG +1420 -2
- data/CONTRIBUTORS +106 -0
- data/README.md +107 -103
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +12 -13
- data/lib/active_merchant/billing/base.rb +13 -16
- data/lib/active_merchant/billing/check.rb +35 -24
- data/lib/active_merchant/billing/compatibility.rb +117 -0
- data/lib/active_merchant/billing/credit_card.rb +196 -81
- data/lib/active_merchant/billing/credit_card_formatting.rb +6 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +199 -75
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +171 -39
- data/lib/active_merchant/billing/gateways/adyen.rb +380 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +933 -604
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +74 -54
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +130 -370
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +23 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +351 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +109 -32
- data/lib/active_merchant/billing/gateways/beanstream.rb +59 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -9
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -498
- data/lib/active_merchant/billing/gateways/blue_snap.rb +347 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +80 -46
- data/lib/active_merchant/billing/gateways/borgun.rb +220 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +311 -121
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +311 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +6 -7
- data/lib/active_merchant/billing/gateways/card_stream.rb +235 -89
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +50 -8
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -14
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +22 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +91 -97
- data/lib/active_merchant/billing/gateways/creditcall.rb +271 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +356 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +268 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +294 -158
- data/lib/active_merchant/billing/gateways/d_local.rb +226 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +59 -347
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +24 -39
- data/lib/active_merchant/billing/gateways/elavon.rb +146 -147
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +41 -31
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +79 -78
- data/lib/active_merchant/billing/gateways/eway_managed.rb +35 -36
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +369 -228
- data/lib/active_merchant/billing/gateways/exact.rb +32 -26
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +90 -64
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -14
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +142 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +128 -122
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +190 -64
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +446 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +270 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +29 -27
- data/lib/active_merchant/billing/gateways/global_collect.rb +340 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +35 -36
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +29 -32
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -6
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +247 -41
- data/lib/active_merchant/billing/gateways/itransact.rb +4 -5
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +198 -71
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +219 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +411 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +45 -43
- data/lib/active_merchant/billing/gateways/litle.rb +328 -444
- data/lib/active_merchant/billing/gateways/mastercard.rb +267 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +145 -115
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +277 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +37 -19
- data/lib/active_merchant/billing/gateways/merchant_one.rb +13 -15
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +57 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +59 -48
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +38 -19
- data/lib/active_merchant/billing/gateways/mercury.rb +77 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +11 -30
- data/lib/active_merchant/billing/gateways/micropayment.rb +183 -0
- data/lib/active_merchant/billing/gateways/migs.rb +81 -22
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +23 -25
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +146 -64
- data/lib/active_merchant/billing/gateways/moneris_us.rb +197 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -15
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +86 -64
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +11 -5
- data/lib/active_merchant/billing/gateways/netaxept.rb +21 -22
- data/lib/active_merchant/billing/gateways/netbanx.rb +290 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +70 -35
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -6
- data/lib/active_merchant/billing/gateways/network_merchants.rb +241 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +274 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +90 -47
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +48 -20
- data/lib/active_merchant/billing/gateways/opp.rb +369 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +79 -44
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -102
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +48 -29
- data/lib/active_merchant/billing/gateways/pagarme.rb +246 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +67 -48
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +20 -26
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +188 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +7 -15
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +40 -36
- data/lib/active_merchant/billing/gateways/payeezy.rb +410 -0
- data/lib/active_merchant/billing/gateways/payex.rb +38 -30
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +62 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +74 -27
- data/lib/active_merchant/billing/gateways/payflow_express.rb +77 -81
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +54 -45
- data/lib/active_merchant/billing/gateways/paymentez.rb +304 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +160 -66
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +54 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +17 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +36 -27
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +7 -6
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -88
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +445 -0
- data/lib/active_merchant/billing/gateways/payway.rb +8 -8
- data/lib/active_merchant/billing/gateways/pin.rb +74 -18
- data/lib/active_merchant/billing/gateways/plugnpay.rb +66 -76
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +30 -30
- data/lib/active_merchant/billing/gateways/psl_card.rb +27 -34
- data/lib/active_merchant/billing/gateways/qbms.rb +65 -54
- data/lib/active_merchant/billing/gateways/quantum.rb +18 -18
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +295 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -350
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +78 -48
- data/lib/active_merchant/billing/gateways/redsys.rb +310 -170
- data/lib/active_merchant/billing/gateways/s5.rb +246 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +415 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +195 -90
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -12
- data/lib/active_merchant/billing/gateways/secure_net.rb +51 -43
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -10
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -14
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +10 -18
- data/lib/active_merchant/billing/gateways/securion_pay.rb +264 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +35 -38
- data/lib/active_merchant/billing/gateways/smart_ps.rb +50 -42
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +9 -9
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +62 -12
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -103
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +12 -18
- data/lib/active_merchant/billing/gateways/telr.rb +274 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +143 -30
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transax.rb +5 -6
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -232
- data/lib/active_merchant/billing/gateways/trexle.rb +218 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +86 -57
- data/lib/active_merchant/billing/gateways/usa_epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +196 -89
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +157 -32
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +42 -49
- data/lib/active_merchant/billing/gateways/viaklix.rb +11 -24
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +233 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +26 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +237 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +153 -31
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +207 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +215 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +31 -24
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +195 -0
- data/lib/active_merchant/country.rb +335 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +10 -0
- data/lib/active_merchant/network_connection_retries.rb +80 -0
- data/lib/active_merchant/post_data.rb +25 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +23 -27
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3988 -0
- data/lib/support/gateway_support.rb +7 -9
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +6 -7
- data/lib/support/ssl_version.rb +87 -0
- metadata +148 -323
- checksums.yaml.gz.sig +0 -0
- data/gem-public_cert.pem +0 -21
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/app55.rb +0 -185
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -249
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/alipay/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/alipay/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/alipay.rb +0 -18
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -64
- data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
- data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
- data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
- data/lib/active_merchant/billing/integrations/citrus.rb +0 -51
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
- data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
- data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -60
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
- data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
- data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class CheckoutV2Gateway < Gateway
|
|
4
|
+
self.display_name = 'Checkout.com V2 Gateway'
|
|
5
|
+
self.homepage_url = 'https://www.checkout.com/'
|
|
6
|
+
self.live_url = 'https://api2.checkout.com/v2'
|
|
7
|
+
self.test_url = 'https://sandbox.checkout.com/api2/v2'
|
|
8
|
+
|
|
9
|
+
self.supported_countries = ['AD', 'AE', 'AT', 'BE', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FO', 'FI', 'FR', 'GB', 'GI', 'GL', 'GR', 'HR', 'HU', 'IE', 'IS', 'IL', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SM', 'SK', 'SJ', 'TR', 'VA']
|
|
10
|
+
self.default_currency = 'USD'
|
|
11
|
+
self.money_format = :cents
|
|
12
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
|
13
|
+
|
|
14
|
+
def initialize(options={})
|
|
15
|
+
requires!(options, :secret_key)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def purchase(amount, payment_method, options={})
|
|
20
|
+
multi = MultiResponse.run do |r|
|
|
21
|
+
r.process { authorize(amount, payment_method, options) }
|
|
22
|
+
r.process { capture(amount, r.authorization, options) }
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
merged_params = multi.responses.map(&:params).reduce({}, :merge)
|
|
26
|
+
succeeded = success_from(merged_params)
|
|
27
|
+
|
|
28
|
+
response(:purchase, succeeded, merged_params)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def authorize(amount, payment_method, options={})
|
|
32
|
+
post = {}
|
|
33
|
+
post[:autoCapture] = 'n'
|
|
34
|
+
add_invoice(post, amount, options)
|
|
35
|
+
add_payment_method(post, payment_method)
|
|
36
|
+
add_customer_data(post, options)
|
|
37
|
+
add_transaction_data(post, options)
|
|
38
|
+
|
|
39
|
+
commit(:authorize, post)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def capture(amount, authorization, options={})
|
|
43
|
+
post = {}
|
|
44
|
+
add_invoice(post, amount, options)
|
|
45
|
+
add_customer_data(post, options)
|
|
46
|
+
|
|
47
|
+
commit(:capture, post, authorization)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def void(authorization, options={})
|
|
51
|
+
post = {}
|
|
52
|
+
commit(:void, post, authorization)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def refund(amount, authorization, options={})
|
|
56
|
+
post = {}
|
|
57
|
+
add_invoice(post, amount, options)
|
|
58
|
+
add_customer_data(post, options)
|
|
59
|
+
|
|
60
|
+
commit(:refund, post, authorization)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def verify(credit_card, options={})
|
|
64
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
65
|
+
r.process { authorize(100, credit_card, options) }
|
|
66
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def supports_scrubbing?
|
|
71
|
+
true
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def scrub(transcript)
|
|
75
|
+
transcript.
|
|
76
|
+
gsub(%r((Authorization: )[^\\]*)i, '\1[FILTERED]').
|
|
77
|
+
gsub(%r(("number\\":\\")\d+), '\1[FILTERED]').
|
|
78
|
+
gsub(%r(("cvv\\":\\")\d+), '\1[FILTERED]')
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
private
|
|
82
|
+
|
|
83
|
+
def add_invoice(post, money, options)
|
|
84
|
+
post[:value] = localized_amount(money, options[:currency])
|
|
85
|
+
post[:trackId] = options[:order_id]
|
|
86
|
+
post[:currency] = options[:currency] || currency(money)
|
|
87
|
+
post[:descriptor] = {}
|
|
88
|
+
post[:descriptor][:name] = options[:descriptor_name] if options[:descriptor_name]
|
|
89
|
+
post[:descriptor][:city] = options[:descriptor_city] if options[:descriptor_city]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def add_payment_method(post, payment_method)
|
|
93
|
+
post[:card] = {}
|
|
94
|
+
post[:card][:name] = payment_method.name
|
|
95
|
+
post[:card][:number] = payment_method.number
|
|
96
|
+
post[:card][:cvv] = payment_method.verification_value
|
|
97
|
+
post[:card][:expiryYear] = format(payment_method.year, :four_digits)
|
|
98
|
+
post[:card][:expiryMonth] = format(payment_method.month, :two_digits)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def add_customer_data(post, options)
|
|
102
|
+
post[:email] = options[:email] || 'unspecified@example.com'
|
|
103
|
+
post[:customerIp] = options[:ip] if options[:ip]
|
|
104
|
+
address = options[:billing_address]
|
|
105
|
+
if(address && post[:card])
|
|
106
|
+
post[:card][:billingDetails] = {}
|
|
107
|
+
post[:card][:billingDetails][:addressLine1] = address[:address1]
|
|
108
|
+
post[:card][:billingDetails][:addressLine2] = address[:address2]
|
|
109
|
+
post[:card][:billingDetails][:city] = address[:city]
|
|
110
|
+
post[:card][:billingDetails][:state] = address[:state]
|
|
111
|
+
post[:card][:billingDetails][:country] = address[:country]
|
|
112
|
+
post[:card][:billingDetails][:postcode] = address[:zip]
|
|
113
|
+
post[:card][:billingDetails][:phone] = { number: address[:phone] } unless address[:phone].blank?
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def add_transaction_data(post, options={})
|
|
118
|
+
post[:cardOnFile] = true if options[:card_on_file] == true
|
|
119
|
+
post[:transactionIndicator] = options[:transaction_indicator] || 1
|
|
120
|
+
post[:previousChargeId] = options[:previous_charge_id] if options[:previous_charge_id]
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def commit(action, post, authorization = nil)
|
|
124
|
+
begin
|
|
125
|
+
raw_response = ssl_post(url(post, action, authorization), post.to_json, headers)
|
|
126
|
+
response = parse(raw_response)
|
|
127
|
+
rescue ResponseError => e
|
|
128
|
+
raise unless(e.response.code.to_s =~ /4\d\d/)
|
|
129
|
+
response = parse(e.response.body)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
succeeded = success_from(response)
|
|
133
|
+
|
|
134
|
+
response(action, succeeded, response)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def response(action, succeeded, response)
|
|
138
|
+
successful_response = succeeded && action == :purchase || action == :authorize
|
|
139
|
+
avs_result = successful_response ? avs_result(response) : nil
|
|
140
|
+
cvv_result = successful_response ? cvv_result(response) : nil
|
|
141
|
+
|
|
142
|
+
Response.new(
|
|
143
|
+
succeeded,
|
|
144
|
+
message_from(succeeded, response),
|
|
145
|
+
response,
|
|
146
|
+
authorization: authorization_from(response),
|
|
147
|
+
error_code: error_code_from(succeeded, response),
|
|
148
|
+
test: test?,
|
|
149
|
+
avs_result: avs_result,
|
|
150
|
+
cvv_result: cvv_result
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def headers
|
|
155
|
+
{
|
|
156
|
+
'Authorization' => @options[:secret_key],
|
|
157
|
+
'Content-Type' => 'application/json;charset=UTF-8'
|
|
158
|
+
}
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def url(post, action, authorization)
|
|
162
|
+
if action == :authorize
|
|
163
|
+
"#{base_url}/charges/card"
|
|
164
|
+
else
|
|
165
|
+
"#{base_url}/charges/#{authorization}/#{action}"
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def base_url
|
|
170
|
+
test? ? test_url : live_url
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def avs_result(response)
|
|
174
|
+
response['card'] && response['card']['avsCheck'] ? AVSResult.new(code: response['card']['avsCheck']) : nil
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def cvv_result(response)
|
|
178
|
+
response['card'] && response['card']['cvvCheck'] ? CVVResult.new(response['card']['cvvCheck']) : nil
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def parse(body)
|
|
182
|
+
JSON.parse(body)
|
|
183
|
+
rescue JSON::ParserError
|
|
184
|
+
{
|
|
185
|
+
'message' => 'Invalid JSON response received from CheckoutV2Gateway. Please contact CheckoutV2Gateway if you continue to receive this message.',
|
|
186
|
+
'raw_response' => scrub(body)
|
|
187
|
+
}
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def success_from(response)
|
|
191
|
+
(response['responseCode'] == '10000' && !response['responseMessage'].start_with?('40')) || response['responseCode'] == '10100'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def message_from(succeeded, response)
|
|
195
|
+
if succeeded
|
|
196
|
+
'Succeeded'
|
|
197
|
+
elsif response['errors']
|
|
198
|
+
response['message'] + ': ' + response['errors'].first
|
|
199
|
+
else
|
|
200
|
+
response['responseMessage'] || response['message'] || 'Unable to read error message'
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
STANDARD_ERROR_CODE_MAPPING = {
|
|
205
|
+
'20014' => STANDARD_ERROR_CODE[:invalid_number],
|
|
206
|
+
'20100' => STANDARD_ERROR_CODE[:invalid_expiry_date],
|
|
207
|
+
'20054' => STANDARD_ERROR_CODE[:expired_card],
|
|
208
|
+
'40104' => STANDARD_ERROR_CODE[:incorrect_cvc],
|
|
209
|
+
'40108' => STANDARD_ERROR_CODE[:incorrect_zip],
|
|
210
|
+
'40111' => STANDARD_ERROR_CODE[:incorrect_address],
|
|
211
|
+
'20005' => STANDARD_ERROR_CODE[:card_declined],
|
|
212
|
+
'20088' => STANDARD_ERROR_CODE[:processing_error],
|
|
213
|
+
'20001' => STANDARD_ERROR_CODE[:call_issuer],
|
|
214
|
+
'30004' => STANDARD_ERROR_CODE[:pickup_card]
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
def authorization_from(raw)
|
|
218
|
+
raw['id']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def error_code_from(succeeded, response)
|
|
222
|
+
return if succeeded
|
|
223
|
+
if response['errorCode'] && response['errorMessageCodes']
|
|
224
|
+
"#{response["errorCode"]}: #{response["errorMessageCodes"].join(", ")}"
|
|
225
|
+
elsif response['errorCode']
|
|
226
|
+
response['errorCode']
|
|
227
|
+
else
|
|
228
|
+
STANDARD_ERROR_CODE_MAPPING[response['responseCode']]
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module ActiveMerchant
|
|
2
|
+
module Billing
|
|
3
|
+
class CitrusPayGateway < Gateway
|
|
4
|
+
include MastercardGateway
|
|
5
|
+
|
|
6
|
+
class_attribute :live_na_url, :live_ap_url, :test_na_url, :test_ap_url
|
|
7
|
+
|
|
8
|
+
self.test_na_url = 'https://test-gateway.mastercard.com/api/rest/version/39/'
|
|
9
|
+
self.test_ap_url = 'https://test-gateway.mastercard.com/api/rest/version/39/'
|
|
10
|
+
|
|
11
|
+
self.live_na_url = 'https://na-gateway.mastercard.com/api/rest/version/39/'
|
|
12
|
+
self.live_ap_url = 'https://ap-gateway.mastercard.com/api/rest/version/39/'
|
|
13
|
+
|
|
14
|
+
self.display_name = 'Citrus Pay'
|
|
15
|
+
self.homepage_url = 'http://www.citruspay.com/'
|
|
16
|
+
self.supported_countries = %w(AR AU BR FR DE HK MX NZ SG GB US)
|
|
17
|
+
self.default_currency = 'USD'
|
|
18
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class ClearhausGateway < Gateway
|
|
4
|
+
self.test_url = 'https://gateway.test.clearhaus.com'
|
|
5
|
+
self.live_url = 'https://gateway.clearhaus.com'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = ['DK', 'NO', 'SE', 'FI', 'DE', 'CH', 'NL', 'AD', 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'FO', 'GL', 'EE', 'FR', 'GR',
|
|
8
|
+
'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MT', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'GB']
|
|
9
|
+
|
|
10
|
+
self.default_currency = 'EUR'
|
|
11
|
+
self.currencies_without_fractions = %w(BIF BYR DJF GNF JPY KMF KRW PYG RWF VND VUV XAF XOF XPF)
|
|
12
|
+
self.supported_cardtypes = [:visa, :master]
|
|
13
|
+
|
|
14
|
+
self.homepage_url = 'https://www.clearhaus.com'
|
|
15
|
+
self.display_name = 'Clearhaus'
|
|
16
|
+
self.money_format = :cents
|
|
17
|
+
|
|
18
|
+
ACTION_CODE_MESSAGES = {
|
|
19
|
+
20000 => 'Approved',
|
|
20
|
+
40000 => 'General input error',
|
|
21
|
+
40110 => 'Invalid card number',
|
|
22
|
+
40120 => 'Invalid CSC',
|
|
23
|
+
40130 => 'Invalid expire date',
|
|
24
|
+
40135 => 'Card expired',
|
|
25
|
+
40140 => 'Invalid currency',
|
|
26
|
+
40200 => 'Clearhaus rule violation',
|
|
27
|
+
40300 => '3-D Secure problem',
|
|
28
|
+
40310 => '3-D Secure authentication failure',
|
|
29
|
+
40400 => 'Backend problem',
|
|
30
|
+
40410 => 'Declined by issuer or card scheme',
|
|
31
|
+
40411 => 'Card restricted',
|
|
32
|
+
40412 => 'Card lost or stolen',
|
|
33
|
+
40413 => 'Insufficient funds',
|
|
34
|
+
40414 => 'Suspected fraud',
|
|
35
|
+
40415 => 'Amount limit exceeded',
|
|
36
|
+
50000 => 'Clearhaus error'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
def initialize(options={})
|
|
40
|
+
requires!(options, :api_key)
|
|
41
|
+
options[:private_key] = options[:private_key].strip if options[:private_key]
|
|
42
|
+
super
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def purchase(amount, payment, options={})
|
|
46
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
47
|
+
r.process { authorize(amount, payment, options) }
|
|
48
|
+
r.process { capture(amount, r.authorization, options) }
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def authorize(amount, payment, options={})
|
|
53
|
+
post = {}
|
|
54
|
+
add_invoice(post, amount, options)
|
|
55
|
+
|
|
56
|
+
action = if payment.respond_to?(:number)
|
|
57
|
+
add_payment(post, payment)
|
|
58
|
+
'/authorizations'
|
|
59
|
+
elsif payment.kind_of?(String)
|
|
60
|
+
"/cards/#{payment}/authorizations"
|
|
61
|
+
else
|
|
62
|
+
raise ArgumentError.new("Unknown payment type #{payment.inspect}")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
post[:recurring] = options[:recurring] if options[:recurring]
|
|
66
|
+
post[:card][:pares] = options[:pares] if options[:pares]
|
|
67
|
+
|
|
68
|
+
commit(action, post)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def capture(amount, authorization, options={})
|
|
72
|
+
post = {}
|
|
73
|
+
add_invoice(post, amount, options)
|
|
74
|
+
|
|
75
|
+
commit("/authorizations/#{authorization}/captures", post)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def refund(amount, authorization, options={})
|
|
79
|
+
post = {}
|
|
80
|
+
add_amount(post, amount, options)
|
|
81
|
+
|
|
82
|
+
commit("/authorizations/#{authorization}/refunds", post)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def void(authorization, options = {})
|
|
86
|
+
commit("/authorizations/#{authorization}/voids", options)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def verify(credit_card, options={})
|
|
90
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
91
|
+
r.process { authorize(0, credit_card, options) }
|
|
92
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def store(credit_card, options={})
|
|
97
|
+
post = {}
|
|
98
|
+
add_payment(post, credit_card)
|
|
99
|
+
|
|
100
|
+
commit('/cards', post)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def supports_scrubbing?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def scrub(transcript)
|
|
108
|
+
transcript.
|
|
109
|
+
gsub(%r((Authorization: Basic )[\w=]+), '\1[FILTERED]').
|
|
110
|
+
gsub(%r((&?card(?:\[|%5B)csc(?:\]|%5D)=)[^&]*)i, '\1[FILTERED]').
|
|
111
|
+
gsub(%r((&?card(?:\[|%5B)pan(?:\]|%5D)=)[^&]*)i, '\1[FILTERED]')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
private
|
|
115
|
+
|
|
116
|
+
def add_invoice(post, money, options)
|
|
117
|
+
add_amount(post, money, options)
|
|
118
|
+
post[:reference] = options[:order_id] if options[:order_id]
|
|
119
|
+
post[:text_on_statement] = options[:text_on_statement] if options[:text_on_statement]
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def add_amount(post, amount, options)
|
|
123
|
+
post[:amount] = localized_amount(amount, options[:currency] || default_currency)
|
|
124
|
+
post[:currency] = (options[:currency] || default_currency)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def add_payment(post, payment)
|
|
128
|
+
card = {}
|
|
129
|
+
card[:pan] = payment.number
|
|
130
|
+
card[:expire_month] = '%02d'% payment.month
|
|
131
|
+
card[:expire_year] = payment.year
|
|
132
|
+
|
|
133
|
+
if payment.verification_value?
|
|
134
|
+
card[:csc] = payment.verification_value
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
post[:card] = card if card.any?
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def headers(api_key)
|
|
141
|
+
{
|
|
142
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64("#{api_key}:"),
|
|
143
|
+
'User-Agent' => "Clearhaus ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
|
|
144
|
+
}
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def parse(body)
|
|
148
|
+
JSON.parse(body) rescue body
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def commit(action, parameters)
|
|
152
|
+
url = (test? ? test_url : live_url) + action
|
|
153
|
+
headers = headers(@options[:api_key])
|
|
154
|
+
body = parameters.to_query
|
|
155
|
+
|
|
156
|
+
if @options[:signing_key] && @options[:private_key]
|
|
157
|
+
begin
|
|
158
|
+
headers['Signature'] = generate_signature(body)
|
|
159
|
+
rescue OpenSSL::PKey::RSAError => e
|
|
160
|
+
return Response.new(false, e.message)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
response = begin
|
|
165
|
+
parse(ssl_post(url, body, headers))
|
|
166
|
+
rescue ResponseError => e
|
|
167
|
+
raise unless(e.response.code.to_s =~ /400/)
|
|
168
|
+
parse(e.response.body)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
Response.new(
|
|
172
|
+
success_from(response),
|
|
173
|
+
message_from(response),
|
|
174
|
+
response,
|
|
175
|
+
authorization: authorization_from(action, response),
|
|
176
|
+
test: test?,
|
|
177
|
+
error_code: error_code_from(response)
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def success_from(response)
|
|
182
|
+
(response && (response['status']['code'] == 20000))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def message_from(response)
|
|
186
|
+
default_message = ACTION_CODE_MESSAGES[response['status']['code']]
|
|
187
|
+
|
|
188
|
+
if success_from(response)
|
|
189
|
+
default_message
|
|
190
|
+
else
|
|
191
|
+
(response['status']['message'] || default_message)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def authorization_from(action, response)
|
|
196
|
+
id_of_auth_for_capture(action) || response['id']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def id_of_auth_for_capture(action)
|
|
200
|
+
match = action.match(/authorizations\/(.+)\/captures/)
|
|
201
|
+
return nil unless match
|
|
202
|
+
|
|
203
|
+
match.captures.first
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def generate_signature(body)
|
|
207
|
+
key = OpenSSL::PKey::RSA.new(@options[:private_key])
|
|
208
|
+
hex = key.sign(OpenSSL::Digest.new('sha256'), body).unpack('H*').first
|
|
209
|
+
|
|
210
|
+
"#{@options[:signing_key]} RS256-hex #{hex}"
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def error_code_from(response)
|
|
214
|
+
unless success_from(response)
|
|
215
|
+
response['status']['code']
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
|
2
|
+
module Billing #:nodoc:
|
|
3
|
+
class CommercegateGateway < Gateway
|
|
4
|
+
self.test_url = self.live_url = 'https://secure.commercegate.com/gateway/nvp'
|
|
5
|
+
|
|
6
|
+
self.supported_countries = %w(
|
|
7
|
+
AD AT AX BE BG CH CY CZ DE DK ES FI FR GB GG
|
|
8
|
+
GI GR HR HU IE IM IS IT JE LI LT LU LV MC MT
|
|
9
|
+
NL NO PL PT RO SE SI SK VA
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
self.money_format = :dollars
|
|
13
|
+
self.default_currency = 'EUR'
|
|
14
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
15
|
+
self.homepage_url = 'http://www.commercegate.com/'
|
|
16
|
+
self.display_name = 'CommerceGate'
|
|
17
|
+
|
|
18
|
+
def initialize(options = {})
|
|
19
|
+
requires!(options, :login, :password, :site_id, :offer_id)
|
|
20
|
+
super
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def authorize(money, creditcard, options = {})
|
|
24
|
+
post = {}
|
|
25
|
+
add_creditcard(post, creditcard)
|
|
26
|
+
add_auth_purchase_options(post, money, options)
|
|
27
|
+
commit('AUTH', post)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def capture(money, authorization, options = {})
|
|
31
|
+
post = {}
|
|
32
|
+
post[:currencyCode] = (options[:currency] || currency(money))
|
|
33
|
+
post[:amount] = amount(money)
|
|
34
|
+
post[:transID] = authorization
|
|
35
|
+
commit('CAPTURE', post)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def purchase(money, creditcard, options = {})
|
|
39
|
+
post = {}
|
|
40
|
+
add_creditcard(post, creditcard)
|
|
41
|
+
add_auth_purchase_options(post, money, options)
|
|
42
|
+
commit('SALE', post)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def refund(money, identification, options = {})
|
|
46
|
+
post = {}
|
|
47
|
+
post[:currencyCode] = options[:currency] || currency(money)
|
|
48
|
+
post[:amount] = amount(money)
|
|
49
|
+
post[:transID] = identification
|
|
50
|
+
commit('REFUND', post)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def void(identification, options = {})
|
|
54
|
+
post = {}
|
|
55
|
+
post[:transID] = identification
|
|
56
|
+
commit('VOID_AUTH', post)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
def add_address(post, address)
|
|
62
|
+
if address
|
|
63
|
+
post[:address] = address[:address1]
|
|
64
|
+
post[:city] = address[:city]
|
|
65
|
+
post[:state] = address[:state]
|
|
66
|
+
post[:postalCode] = address[:zip]
|
|
67
|
+
end
|
|
68
|
+
post[:countryCode] = ((address && address[:country]) || 'US')
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def add_auth_purchase_options(post, money, options)
|
|
72
|
+
add_address(post, options[:address])
|
|
73
|
+
|
|
74
|
+
post[:customerIP] = options[:ip] || '127.0.0.1'
|
|
75
|
+
post[:amount] = amount(money)
|
|
76
|
+
post[:email] = options[:email] || 'unknown@example.com'
|
|
77
|
+
post[:currencyCode]= options[:currency] || currency(money)
|
|
78
|
+
post[:merchAcct] = options[:merchant]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def add_creditcard(params, creditcard)
|
|
82
|
+
params[:firstName] = creditcard.first_name
|
|
83
|
+
params[:lastName] = creditcard.last_name
|
|
84
|
+
params[:cardNumber] = creditcard.number
|
|
85
|
+
params[:expiryMonth] = creditcard.month
|
|
86
|
+
params[:expiryYear] = creditcard.year
|
|
87
|
+
params[:cvv] = creditcard.verification_value if creditcard.verification_value?
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def commit(action, parameters)
|
|
91
|
+
parameters[:apiUsername] = @options[:login]
|
|
92
|
+
parameters[:apiPassword] = @options[:password]
|
|
93
|
+
parameters[:siteID] = @options[:site_id]
|
|
94
|
+
parameters[:offerID] = @options[:offer_id]
|
|
95
|
+
parameters[:action] = action
|
|
96
|
+
|
|
97
|
+
response = parse(ssl_post(self.live_url, post_data(parameters)))
|
|
98
|
+
|
|
99
|
+
Response.new(
|
|
100
|
+
successful?(response),
|
|
101
|
+
message_from(response),
|
|
102
|
+
response,
|
|
103
|
+
authorization: response['transID'],
|
|
104
|
+
test: test?,
|
|
105
|
+
avs_result: {code: response['avsCode']},
|
|
106
|
+
cvv_result: response['cvvCode']
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def parse(body)
|
|
111
|
+
results = {}
|
|
112
|
+
|
|
113
|
+
body.split(/\&/).each do |pair|
|
|
114
|
+
key, val = pair.split(%r{=})
|
|
115
|
+
results[key] = CGI.unescape(val)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
results
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def successful?(response)
|
|
122
|
+
response['returnCode'] == '0'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def message_from(response)
|
|
126
|
+
if response['returnText'].present?
|
|
127
|
+
response['returnText']
|
|
128
|
+
else
|
|
129
|
+
'Invalid response received from the CommerceGate API. ' \
|
|
130
|
+
'Please contact CommerceGate support if you continue to receive this message. ' \
|
|
131
|
+
"(The raw response returned by the API was #{response.inspect})"
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def post_data(parameters)
|
|
136
|
+
parameters.collect do |key, value|
|
|
137
|
+
"#{key}=#{CGI.escape(value.to_s)}"
|
|
138
|
+
end.join('&')
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|