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,220 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
module ActiveMerchant #:nodoc:
|
|
4
|
+
module Billing #:nodoc:
|
|
5
|
+
class BorgunGateway < Gateway
|
|
6
|
+
self.display_name = 'Borgun'
|
|
7
|
+
self.homepage_url = 'http://www.borgun.com'
|
|
8
|
+
|
|
9
|
+
self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
|
|
10
|
+
self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization'
|
|
11
|
+
|
|
12
|
+
self.supported_countries = ['IS', 'GB', 'HU', 'CZ', 'DE', 'DK', 'SE' ]
|
|
13
|
+
self.default_currency = 'ISK'
|
|
14
|
+
self.money_format = :cents
|
|
15
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb]
|
|
16
|
+
|
|
17
|
+
self.homepage_url = 'https://www.borgun.is/'
|
|
18
|
+
|
|
19
|
+
def initialize(options={})
|
|
20
|
+
requires!(options, :processor, :merchant_id, :username, :password)
|
|
21
|
+
super
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def purchase(money, payment, options={})
|
|
25
|
+
post = {}
|
|
26
|
+
post[:TransType] = '1'
|
|
27
|
+
add_invoice(post, money, options)
|
|
28
|
+
add_payment_method(post, payment)
|
|
29
|
+
commit('sale', post)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def authorize(money, payment, options={})
|
|
33
|
+
post = {}
|
|
34
|
+
post[:TransType] = '5'
|
|
35
|
+
add_invoice(post, money, options)
|
|
36
|
+
add_payment_method(post, payment)
|
|
37
|
+
commit('authonly', post)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def capture(money, authorization, options={})
|
|
41
|
+
post = {}
|
|
42
|
+
post[:TransType] = '1'
|
|
43
|
+
add_invoice(post, money, options)
|
|
44
|
+
add_reference(post, authorization)
|
|
45
|
+
commit('capture', post)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def refund(money, authorization, options={})
|
|
49
|
+
post = {}
|
|
50
|
+
post[:TransType] = '3'
|
|
51
|
+
add_invoice(post, money, options)
|
|
52
|
+
add_reference(post, authorization)
|
|
53
|
+
commit('refund', post)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def void(authorization, options={})
|
|
57
|
+
post = {}
|
|
58
|
+
# TransType, TrAmount, and currency must match original values from auth or purchase.
|
|
59
|
+
_, _, _, _, _, transtype, tramount, currency = split_authorization(authorization)
|
|
60
|
+
post[:TransType] = transtype
|
|
61
|
+
options[:currency] = options[:currency] || CURRENCY_CODES.key(currency)
|
|
62
|
+
add_invoice(post, tramount.to_i, options)
|
|
63
|
+
add_reference(post, authorization)
|
|
64
|
+
commit('void', post)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def supports_scrubbing
|
|
68
|
+
true
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def scrub(transcript)
|
|
72
|
+
transcript.gsub(%r((<PAN>)[^&]*(</PAN>))i, '\1[FILTERED]\2').
|
|
73
|
+
gsub(%r((<CVC2>)[^&]*(</CVC2>))i, '\1[FILTERED]\2').
|
|
74
|
+
gsub(%r(((?:\r\n)?Authorization: Basic )[^\r\n]+(\r\n)?), '\1[FILTERED]\2')
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
private
|
|
78
|
+
|
|
79
|
+
CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
|
|
80
|
+
CURRENCY_CODES['ISK'] = '352'
|
|
81
|
+
CURRENCY_CODES['EUR'] = '978'
|
|
82
|
+
CURRENCY_CODES['USD'] = '840'
|
|
83
|
+
|
|
84
|
+
def add_invoice(post, money, options)
|
|
85
|
+
post[:TrAmount] = amount(money)
|
|
86
|
+
post[:TrCurrency] = CURRENCY_CODES[options[:currency] || currency(money)]
|
|
87
|
+
post[:TerminalID] = options[:terminal_id] || '1'
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def add_payment_method(post, payment_method)
|
|
91
|
+
post[:PAN] = payment_method.number
|
|
92
|
+
post[:ExpDate] = format(payment_method.year, :two_digits) + format(payment_method.month, :two_digits)
|
|
93
|
+
post[:CVC2] = payment_method.verification_value
|
|
94
|
+
post[:DateAndTime] = Time.now.strftime('%y%m%d%H%M%S')
|
|
95
|
+
post[:RRN] = 'AMRCNT' + six_random_digits
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def add_reference(post, authorization)
|
|
99
|
+
dateandtime, _batch, transaction, rrn, authcode, _, _, _ = split_authorization(authorization)
|
|
100
|
+
post[:DateAndTime] = dateandtime
|
|
101
|
+
post[:Transaction] = transaction
|
|
102
|
+
post[:RRN] = rrn
|
|
103
|
+
post[:AuthCode] = authcode
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def parse(xml)
|
|
107
|
+
response = {}
|
|
108
|
+
|
|
109
|
+
doc = Nokogiri::XML(CGI.unescapeHTML(xml))
|
|
110
|
+
body = doc.xpath('//getAuthorizationReply')
|
|
111
|
+
body = doc.xpath('//cancelAuthorizationReply') if body.length == 0
|
|
112
|
+
body.children.each do |node|
|
|
113
|
+
if node.text?
|
|
114
|
+
next
|
|
115
|
+
elsif node.elements.size == 0
|
|
116
|
+
response[node.name.downcase.to_sym] = node.text
|
|
117
|
+
else
|
|
118
|
+
node.elements.each do |childnode|
|
|
119
|
+
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
|
120
|
+
response[name.to_sym] = childnode.text
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
response
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def commit(action, post)
|
|
129
|
+
post[:Version] = '1000'
|
|
130
|
+
post[:Processor] = @options[:processor]
|
|
131
|
+
post[:MerchantID] = @options[:merchant_id]
|
|
132
|
+
|
|
133
|
+
request = build_request(action, post)
|
|
134
|
+
raw = ssl_post(url(action), request, headers)
|
|
135
|
+
pairs = parse(raw)
|
|
136
|
+
success = success_from(pairs)
|
|
137
|
+
|
|
138
|
+
Response.new(
|
|
139
|
+
success,
|
|
140
|
+
message_from(success, pairs),
|
|
141
|
+
pairs,
|
|
142
|
+
authorization: authorization_from(pairs),
|
|
143
|
+
test: test?
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def success_from(response)
|
|
148
|
+
(response[:actioncode] == '000')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def message_from(succeeded, response)
|
|
152
|
+
if succeeded
|
|
153
|
+
'Succeeded'
|
|
154
|
+
else
|
|
155
|
+
response[:message] || "Error with ActionCode=#{response[:actioncode]}"
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def authorization_from(response)
|
|
160
|
+
[
|
|
161
|
+
response[:dateandtime],
|
|
162
|
+
response[:batch],
|
|
163
|
+
response[:transaction],
|
|
164
|
+
response[:rrn],
|
|
165
|
+
response[:authcode],
|
|
166
|
+
response[:transtype],
|
|
167
|
+
response[:tramount],
|
|
168
|
+
response[:trcurrency]
|
|
169
|
+
].join('|')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def split_authorization(authorization)
|
|
173
|
+
dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency = authorization.split('|')
|
|
174
|
+
[dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency]
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def headers
|
|
178
|
+
{
|
|
179
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s),
|
|
180
|
+
}
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def build_request(action, post)
|
|
184
|
+
mode = action == 'void' ? 'cancel' : 'get'
|
|
185
|
+
xml = Builder::XmlMarkup.new :indent => 18
|
|
186
|
+
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
187
|
+
xml.tag!("#{mode}Authorization") do
|
|
188
|
+
post.each do |field, value|
|
|
189
|
+
xml.tag!(field, value)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
inner = CGI.escapeHTML(xml.target!)
|
|
193
|
+
envelope(mode).sub(/{{ :body }}/, inner)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def envelope(mode)
|
|
197
|
+
<<-EOS
|
|
198
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://Borgun/Heimir/pub/ws/Authorization">
|
|
199
|
+
<soapenv:Header/>
|
|
200
|
+
<soapenv:Body>
|
|
201
|
+
<aut:#{mode}AuthorizationInput>
|
|
202
|
+
<#{mode}AuthReqXml>
|
|
203
|
+
{{ :body }}
|
|
204
|
+
</#{mode}AuthReqXml>
|
|
205
|
+
</aut:#{mode}AuthorizationInput>
|
|
206
|
+
</soapenv:Body>
|
|
207
|
+
</soapenv:Envelope>
|
|
208
|
+
EOS
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def url(action)
|
|
212
|
+
(test? ? test_url : live_url)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def six_random_digits
|
|
216
|
+
(0...6).map { rand(48..57).chr }.join
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
module ActiveMerchant #:nodoc:
|
|
4
|
+
module Billing #:nodoc:
|
|
5
|
+
class BpointGateway < Gateway
|
|
6
|
+
self.live_url = 'https://www.bpoint.com.au/evolve/service_1_4_4.asmx'
|
|
7
|
+
|
|
8
|
+
self.supported_countries = ['AU']
|
|
9
|
+
self.default_currency = 'AUD'
|
|
10
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
|
11
|
+
|
|
12
|
+
self.homepage_url = 'https://www.bpoint.com.au/bpoint'
|
|
13
|
+
self.display_name = 'BPoint'
|
|
14
|
+
|
|
15
|
+
def initialize(options={})
|
|
16
|
+
requires!(options, :username, :password, :merchant_number)
|
|
17
|
+
super
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def store(credit_card, options={})
|
|
21
|
+
options[:crn1] ||= 'DEFAULT'
|
|
22
|
+
request_body = soap_request do |xml|
|
|
23
|
+
add_token(xml, credit_card, options)
|
|
24
|
+
end
|
|
25
|
+
commit(request_body)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def purchase(amount, credit_card, options={})
|
|
29
|
+
request_body = soap_request do |xml|
|
|
30
|
+
process_payment(xml) do |payment_xml|
|
|
31
|
+
add_purchase(payment_xml, amount, credit_card, options)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
commit(request_body)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def authorize(amount, credit_card, options={})
|
|
38
|
+
request_body = soap_request do |xml|
|
|
39
|
+
process_payment(xml) do |payment_xml|
|
|
40
|
+
add_authorize(payment_xml, amount, credit_card, options)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
commit(request_body)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def capture(amount, authorization, options={})
|
|
47
|
+
request_body = soap_request do |xml|
|
|
48
|
+
process_payment(xml) do |payment_xml|
|
|
49
|
+
add_capture(payment_xml, amount, authorization, options)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
commit(request_body)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def refund(amount, authorization, options={})
|
|
56
|
+
request_body = soap_request do |xml|
|
|
57
|
+
process_payment(xml) do |payment_xml|
|
|
58
|
+
add_refund(payment_xml, amount, authorization, options)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
commit(request_body)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def void(amount, authorization, options={})
|
|
65
|
+
request_body = soap_request do |xml|
|
|
66
|
+
process_payment(xml) do |payment_xml|
|
|
67
|
+
add_void(payment_xml, amount, authorization, options)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
commit(request_body)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def verify(credit_card, options={})
|
|
74
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
75
|
+
r.process { authorize(100, credit_card, options) }
|
|
76
|
+
r.process(:ignore_result) { void(100, r.authorization, options) }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def supports_scrubbing?
|
|
81
|
+
true
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def scrub(transcript)
|
|
85
|
+
transcript.
|
|
86
|
+
gsub(%r((<password>).+(</password>)), '\1[FILTERED]\2').
|
|
87
|
+
gsub(%r((<CardNumber>).+(</CardNumber>)), '\1[FILTERED]\2').
|
|
88
|
+
gsub(%r((<CVC>).+(</CVC>)), '\1[FILTERED]\2')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
private
|
|
92
|
+
|
|
93
|
+
def soap_request
|
|
94
|
+
Nokogiri::XML::Builder.new(:encoding => 'utf-8') do |xml|
|
|
95
|
+
xml.send('soap12:Envelope', soap_envelope_attributes) {
|
|
96
|
+
xml.send('soap12:Body') {
|
|
97
|
+
yield(xml) if block_given?
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
end.to_xml
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def soap_envelope_attributes
|
|
104
|
+
{ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
|
105
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
106
|
+
'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope' }
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def process_payment(xml)
|
|
110
|
+
xml.send('ProcessPayment', { 'xmlns' => 'urn:Eve_1_4_4' }) {
|
|
111
|
+
credentials_xml(xml)
|
|
112
|
+
xml.send('txnReq') {
|
|
113
|
+
yield(xml) if block_given?
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def add_token(xml, credit_card, options)
|
|
119
|
+
xml.send('AddToken', { 'xmlns' => 'urn:Eve_1_4_4' }) {
|
|
120
|
+
credentials_xml(xml)
|
|
121
|
+
xml.send('tokenRequest') {
|
|
122
|
+
xml.send('CRN1', options[:crn1])
|
|
123
|
+
xml.send('CRN2', '')
|
|
124
|
+
xml.send('CRN3', '')
|
|
125
|
+
xml.send('CardNumber', credit_card.number)
|
|
126
|
+
xml.send('ExpiryDate', expdate(credit_card))
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def credentials_xml(xml)
|
|
132
|
+
xml.send('username', @options[:username])
|
|
133
|
+
xml.send('password', @options[:password])
|
|
134
|
+
xml.send('merchantNumber', @options[:merchant_number])
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def add_purchase(xml, amount, credit_card, options)
|
|
138
|
+
payment_xml(xml, 'PAYMENT', amount, options)
|
|
139
|
+
credit_card_xml(xml, credit_card)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def add_authorize(xml, amount, credit_card, options)
|
|
143
|
+
payment_xml(xml, 'PREAUTH', amount, options)
|
|
144
|
+
credit_card_xml(xml, credit_card)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def add_capture(xml, amount, transaction_number, options)
|
|
148
|
+
payment_xml(xml, 'CAPTURE', amount, options)
|
|
149
|
+
transaction_number_xml(xml, transaction_number)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def add_refund(xml, amount, transaction_number, options)
|
|
153
|
+
payment_xml(xml, 'REFUND', amount, options)
|
|
154
|
+
transaction_number_xml(xml, transaction_number)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def add_void(xml, amount, transaction_number, options)
|
|
158
|
+
payment_xml(xml, 'REVERSAL', amount, options)
|
|
159
|
+
transaction_number_xml(xml, transaction_number)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def payment_xml(xml, payment_type, amount, options)
|
|
163
|
+
xml.send('PaymentType', payment_type)
|
|
164
|
+
xml.send('TxnType', 'WEB_SHOP')
|
|
165
|
+
xml.send('BillerCode', options.fetch(:biller_code, ''))
|
|
166
|
+
xml.send('MerchantReference', '')
|
|
167
|
+
xml.send('CRN1', '')
|
|
168
|
+
xml.send('CRN2', '')
|
|
169
|
+
xml.send('CRN3', '')
|
|
170
|
+
xml.send('Amount', amount)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def credit_card_xml(xml, credit_card)
|
|
174
|
+
xml.send('CardNumber', credit_card.number)
|
|
175
|
+
xml.send('ExpiryDate', expdate(credit_card))
|
|
176
|
+
xml.send('CVC', credit_card.verification_value)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def transaction_number_xml(xml, transaction_number)
|
|
180
|
+
xml.send('OriginalTransactionNumber', transaction_number)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
def commit(request_body)
|
|
184
|
+
parse(ssl_post(live_url, request_body, request_headers))
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def request_headers
|
|
188
|
+
{ 'Content-Type' => 'application/soap+xml; charset=utf-8' }
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def parse(body)
|
|
192
|
+
response_for(Nokogiri::XML(body).remove_namespaces!)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
def response_for(xml_doc)
|
|
196
|
+
if xml_doc.xpath('//ProcessPaymentResponse').any?
|
|
197
|
+
ProcessPaymentResponse.new(xml_doc, self).to_response
|
|
198
|
+
elsif xml_doc.xpath('//AddTokenResponse').any?
|
|
199
|
+
AddTokenResponse.new(xml_doc, self).to_response
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
class BPointResponse
|
|
204
|
+
attr_reader :xml_doc, :gateway, :params
|
|
205
|
+
|
|
206
|
+
def initialize(xml_doc, gateway)
|
|
207
|
+
@xml_doc = xml_doc
|
|
208
|
+
@gateway = gateway
|
|
209
|
+
@params = init_params
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def to_response
|
|
213
|
+
Response.new(success?, message, params, options)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
private
|
|
217
|
+
|
|
218
|
+
def init_params
|
|
219
|
+
{}.tap do |h|
|
|
220
|
+
xml_doc.xpath(response_node).each do |node|
|
|
221
|
+
if node.elements.empty?
|
|
222
|
+
h[node.name.to_sym] = node.text
|
|
223
|
+
else
|
|
224
|
+
node.elements.each do |childnode|
|
|
225
|
+
name = "#{node.name}_#{childnode.name}"
|
|
226
|
+
h[name.to_sym] = childnode.text
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def response_node
|
|
234
|
+
"//#{self.class.name.split('::').last}/*"
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
def options
|
|
238
|
+
{ authorization: params[authorization_key], test: gateway.test? }
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
class ProcessPaymentResponse < BPointResponse
|
|
243
|
+
|
|
244
|
+
private
|
|
245
|
+
|
|
246
|
+
def authorization_key
|
|
247
|
+
:ProcessPaymentResult_TransactionNumber
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def success?
|
|
251
|
+
params[:ProcessPaymentResult_ResponseCode] == '0'
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
def message
|
|
255
|
+
params[:ProcessPaymentResult_AuthorisationResult] || params[:response_ResponseMessage]
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
class AddTokenResponse < BPointResponse
|
|
260
|
+
|
|
261
|
+
private
|
|
262
|
+
|
|
263
|
+
def authorization_key
|
|
264
|
+
:AddTokenResult_Token
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def success?
|
|
268
|
+
params[:response_ResponseCode] == 'SUCCESS'
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
def message
|
|
272
|
+
params[:response_ResponseCode].capitalize
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
module BraintreeCommon
|
|
2
2
|
def self.included(base)
|
|
3
|
-
base.supported_countries = %w(US CA
|
|
4
|
-
base.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
|
|
3
|
+
base.supported_countries = %w(US CA AD AT BE BG HR CY CZ DK EE FI FR GI DE GR GG HU IS IM IE IT JE LV LI LT LU MT MC NL NO PL PT RO SM SK SI ES SE CH TR GB SG HK MY AU NZ)
|
|
4
|
+
base.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro]
|
|
5
5
|
base.homepage_url = 'http://www.braintreepaymentsolutions.com'
|
|
6
6
|
base.display_name = 'Braintree'
|
|
7
7
|
base.default_currency = 'USD'
|
|
8
|
+
base.currencies_without_fractions = %w(BIF CLP DJF GNF JPY KMF KRW LAK PYG RWF UGX VND VUV XAF XOF XPF)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def supports_scrubbing
|
|
12
|
+
true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def scrub(transcript)
|
|
16
|
+
return '' if transcript.blank?
|
|
17
|
+
transcript.
|
|
18
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
|
19
|
+
gsub(%r((&?ccnumber=)\d*(&?)), '\1[FILTERED]\2').
|
|
20
|
+
gsub(%r((&?cvv=)\d*(&?)), '\1[FILTERED]\2')
|
|
8
21
|
end
|
|
9
22
|
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'active_merchant/billing/gateways/braintree/braintree_common'
|
|
2
2
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
5
5
|
class BraintreeGateway < Gateway
|
|
6
6
|
include BraintreeCommon
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
self.abstract_class = true
|
|
9
9
|
|
|
10
10
|
def self.new(options={})
|