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
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
|
2
|
-
module Billing #:nodoc:
|
|
3
|
-
class CertoDirectGateway < Gateway
|
|
4
|
-
self.live_url = self.test_url = "https://secure.certodirect.com/gateway/process/v2"
|
|
5
|
-
|
|
6
|
-
self.supported_countries = [
|
|
7
|
-
"BE", "BG", "CZ", "DK", "DE", "EE", "IE", "EL", "ES", "FR",
|
|
8
|
-
"IT", "CY", "LV", "LT", "LU", "HU", "MT", "NL", "AT", "PL",
|
|
9
|
-
"PT", "RO", "SI", "SK", "FI", "SE", "GB"
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
|
13
|
-
self.homepage_url = 'http://www.certodirect.com/'
|
|
14
|
-
self.display_name = 'CertoDirect'
|
|
15
|
-
|
|
16
|
-
# Creates a new CertoDirectGateway
|
|
17
|
-
#
|
|
18
|
-
# The gateway requires that a valid login and password be passed
|
|
19
|
-
# in the +options+ hash.
|
|
20
|
-
#
|
|
21
|
-
# ==== Options
|
|
22
|
-
#
|
|
23
|
-
# * <tt>:login</tt> -- The CertoDirect Shop ID (REQUIRED)
|
|
24
|
-
# * <tt>:password</tt> -- The CertoDirect Shop Password. (REQUIRED)
|
|
25
|
-
# * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
|
|
26
|
-
# Otherwise, perform transactions against the production server.
|
|
27
|
-
def initialize(options = {})
|
|
28
|
-
requires!(options, :login, :password)
|
|
29
|
-
super
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Perform a purchase, which is essentially an authorization and capture in a single operation.
|
|
33
|
-
#
|
|
34
|
-
# ==== Parameters
|
|
35
|
-
#
|
|
36
|
-
# * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
|
|
37
|
-
# * <tt>credit_card</tt> -- The CreditCard details for the transaction.
|
|
38
|
-
# * <tt>options</tt> -- A hash of optional parameters.
|
|
39
|
-
def purchase(money, credit_card, options = {})
|
|
40
|
-
requires!(options, :email, :currency, :ip, :description)
|
|
41
|
-
|
|
42
|
-
commit(build_sale_request(money, credit_card, options))
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# Refund a transaction.
|
|
46
|
-
#
|
|
47
|
-
# This transaction indicates to the gateway that
|
|
48
|
-
# money should flow from the merchant to the customer.
|
|
49
|
-
#
|
|
50
|
-
# ==== Parameters
|
|
51
|
-
#
|
|
52
|
-
# * <tt>money</tt> -- The amount to be credited to the customer as an Integer value in cents.
|
|
53
|
-
# * <tt>identification</tt> -- The ID of the original order against which the refund is being issued.
|
|
54
|
-
# * <tt>options</tt> -- A hash of parameters.
|
|
55
|
-
def refund(money, identification, options = {})
|
|
56
|
-
requires!(options, :reason)
|
|
57
|
-
|
|
58
|
-
commit(build_refund_request(money, identification, options))
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# Performs an authorization, which reserves the funds on the customer's credit card, but does not
|
|
62
|
-
# charge the card.
|
|
63
|
-
#
|
|
64
|
-
# ==== Parameters
|
|
65
|
-
#
|
|
66
|
-
# * <tt>money</tt> -- The amount to be authorized as an Integer value in cents.
|
|
67
|
-
# * <tt>credit_card</tt> -- The CreditCard details for the transaction.
|
|
68
|
-
# * <tt>options</tt> -- A hash of optional parameters.
|
|
69
|
-
def authorize(money, credit_card, options = {})
|
|
70
|
-
requires!(options, :email, :currency, :ip, :description)
|
|
71
|
-
|
|
72
|
-
commit(build_authorize_request(money, credit_card, options))
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# Captures the funds from an authorized transaction.
|
|
76
|
-
#
|
|
77
|
-
# ==== Parameters
|
|
78
|
-
#
|
|
79
|
-
# * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
|
|
80
|
-
# * <tt>identification</tt> -- The authorization returned from the previous authorize request.
|
|
81
|
-
def capture(money, identification, options = {})
|
|
82
|
-
commit(build_capture_request(money, identification))
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# Void a previous transaction
|
|
86
|
-
#
|
|
87
|
-
# ==== Parameters
|
|
88
|
-
#
|
|
89
|
-
# * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
|
|
90
|
-
# * <tt>identification</tt> - The authorization returned from the previous authorize request.
|
|
91
|
-
def void(money, identification, options = {})
|
|
92
|
-
commit(build_void_request(money, identification))
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Create a recurring payment.
|
|
96
|
-
#
|
|
97
|
-
# ==== Parameters
|
|
98
|
-
#
|
|
99
|
-
# * <tt>options</tt> -- A hash of parameters.
|
|
100
|
-
#
|
|
101
|
-
# ==== Options
|
|
102
|
-
#
|
|
103
|
-
def recurring(identification, options={})
|
|
104
|
-
commit(build_recurring_request(identification, options))
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
private
|
|
109
|
-
|
|
110
|
-
def commit(request_xml)
|
|
111
|
-
begin
|
|
112
|
-
response = Hash.from_xml(ssl_post(self.live_url, request_xml, headers))
|
|
113
|
-
Response.new(success?(response),
|
|
114
|
-
message(response),
|
|
115
|
-
response,
|
|
116
|
-
:test => test?,
|
|
117
|
-
:authorization => authorization(response))
|
|
118
|
-
rescue ResponseError => e
|
|
119
|
-
raise e unless e.response.code == '403'
|
|
120
|
-
response = Hash.from_xml(e.response.body)['response']
|
|
121
|
-
Response.new(false, message(response), {}, :test => test?)
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
def build_sale_request(money, credit_card, options)
|
|
126
|
-
build_request_xml('Sale') do |xml|
|
|
127
|
-
add_order(xml, money, credit_card, options)
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
def build_authorize_request(money, credit_card, options)
|
|
132
|
-
build_request_xml('Authorize') do |xml|
|
|
133
|
-
add_order(xml, money, credit_card, options)
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
def build_refund_request(money, identification, options)
|
|
138
|
-
build_request_xml('Refund') do |xml|
|
|
139
|
-
add_reference_info(xml, money, identification, options)
|
|
140
|
-
xml.tag! 'reason', options[:reason]
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
def build_capture_request(money, identification)
|
|
145
|
-
build_request_xml('Capture') do |xml|
|
|
146
|
-
add_reference_info(xml, money, identification, options)
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
def build_void_request(money, identification)
|
|
151
|
-
build_request_xml('Void') do |xml|
|
|
152
|
-
add_reference_info(xml, money, identification, options)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
def build_recurring_request(identification, options)
|
|
157
|
-
build_request_xml('Sale') do |xml|
|
|
158
|
-
xml.tag! 'order' do |xml|
|
|
159
|
-
xml.tag!('test', 'true') if test?
|
|
160
|
-
xml.tag! 'initial_order_id', identification, :type => 'integer'
|
|
161
|
-
|
|
162
|
-
add_order_details(xml, options[:amount], options) if has_any_order_details_key?(options)
|
|
163
|
-
add_address(xml, 'billing_address', options[:billing_address]) if options[:billing_address]
|
|
164
|
-
add_address(xml, 'shipping_address', options[:shipping_address]) if options[:shipping_address]
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
def build_request_xml(type, &block)
|
|
170
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
|
171
|
-
xml.tag! 'transaction' do
|
|
172
|
-
xml.tag! 'type', type
|
|
173
|
-
yield(xml)
|
|
174
|
-
end
|
|
175
|
-
xml.target!
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
def add_order(xml, money, credit_card, options)
|
|
179
|
-
xml.tag! 'order' do
|
|
180
|
-
xml.tag!('test', 'true') if test?
|
|
181
|
-
|
|
182
|
-
xml.tag!('return_url', options[:return_url]) if options[:return_url]
|
|
183
|
-
xml.tag!('cancel_url', options[:cancel_url]) if options[:cancel_url]
|
|
184
|
-
|
|
185
|
-
xml.tag! 'payment_method_type', 'CreditCard'
|
|
186
|
-
xml.tag! 'payment_method' do
|
|
187
|
-
xml.tag! 'number', credit_card.number
|
|
188
|
-
xml.tag! 'exp_month', "%02i" % credit_card.month
|
|
189
|
-
xml.tag! 'exp_year', credit_card.year
|
|
190
|
-
xml.tag! 'holder', credit_card.name
|
|
191
|
-
xml.tag! 'verification_value', credit_card.verification_value
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
add_order_details(xml, money, options)
|
|
195
|
-
add_address(xml, 'billing_address', options[:billing_address]) if options[:billing_address]
|
|
196
|
-
add_address(xml, 'shipping_address', options[:shipping_address]) if options[:shipping_address]
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
def add_order_details(xml, money, options)
|
|
201
|
-
xml.tag! 'details' do
|
|
202
|
-
xml.tag!('amount', localized_amount(money, options[:currency]), :type => 'decimal') if money
|
|
203
|
-
xml.tag!('currency', options[:currency]) if options[:currency]
|
|
204
|
-
xml.tag!('email', options[:email]) if options[:email]
|
|
205
|
-
xml.tag!('ip', options[:ip]) if options[:ip]
|
|
206
|
-
xml.tag!('shipping', options[:shipping], :type => 'decimal') if options[:shipping]
|
|
207
|
-
xml.tag!('description', options[:description]) if options[:description]
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
def add_reference_info(xml, money, identification, options)
|
|
212
|
-
xml.tag! 'order_id', identification, :type => 'integer'
|
|
213
|
-
xml.tag! 'amount', localized_amount(money, options[:currency]), :type => 'decimal'
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
def add_address(xml, address_type, address)
|
|
217
|
-
xml.tag! address_type do
|
|
218
|
-
xml.tag! 'address', address[:address1]
|
|
219
|
-
xml.tag! 'city', address[:city]
|
|
220
|
-
xml.tag! 'country', address[:country]
|
|
221
|
-
xml.tag! 'first_name', address[:first_name]
|
|
222
|
-
xml.tag! 'last_name', address[:last_name]
|
|
223
|
-
xml.tag! 'state', address[:state]
|
|
224
|
-
xml.tag! 'phone', address[:phone]
|
|
225
|
-
xml.tag! 'zip', address[:zip]
|
|
226
|
-
end
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
def has_any_order_details_key?(options)
|
|
230
|
-
[ :currency, :amount, :email, :ip, :shipping, :description ].any? do |key|
|
|
231
|
-
options.has_key?(key)
|
|
232
|
-
end
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
def success?(response)
|
|
236
|
-
%w(completed forwarding).include?(state(response)) and
|
|
237
|
-
status(response) == 'success'
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
def error?(response)
|
|
241
|
-
response['errors']
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
def state(response)
|
|
245
|
-
response["transaction"].try(:[], "state")
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
def status(response)
|
|
249
|
-
response['transaction'].try(:[], 'response').try(:[], 'status')
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
def authorization(response)
|
|
253
|
-
error?(response) ? nil : response["transaction"]["order"]['id'].to_s
|
|
254
|
-
end
|
|
255
|
-
|
|
256
|
-
def message(response)
|
|
257
|
-
return response['errors'].join('; ') if error?(response)
|
|
258
|
-
|
|
259
|
-
if state(response) == 'completed'
|
|
260
|
-
response["transaction"]["response"]["message"]
|
|
261
|
-
else
|
|
262
|
-
response['transaction']['message']
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
def headers
|
|
267
|
-
{ 'authorization' => basic_auth,
|
|
268
|
-
'Accept' => 'application/xml',
|
|
269
|
-
'Content-Type' => 'application/xml' }
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
def basic_auth
|
|
273
|
-
'Basic ' + ["#{@options[:login]}:#{@options[:password]}"].pack('m').delete("\r\n")
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
end
|
|
277
|
-
end
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/ideal_response'
|
|
2
|
-
|
|
3
|
-
module ActiveMerchant #:nodoc:
|
|
4
|
-
module Billing #:nodoc:
|
|
5
|
-
# Implementation contains some simplifications
|
|
6
|
-
# - does not support multiple subID per merchant
|
|
7
|
-
# - language is fixed to 'nl'
|
|
8
|
-
class IdealBaseGateway < Gateway
|
|
9
|
-
class_attribute :server_pem, :pem_password, :default_expiration_period
|
|
10
|
-
self.default_expiration_period = 'PT10M'
|
|
11
|
-
self.default_currency = 'EUR'
|
|
12
|
-
self.pem_password = true
|
|
13
|
-
|
|
14
|
-
self.abstract_class = true
|
|
15
|
-
|
|
16
|
-
# These constants will never change for most users
|
|
17
|
-
AUTHENTICATION_TYPE = 'SHA1_RSA'
|
|
18
|
-
LANGUAGE = 'nl'
|
|
19
|
-
SUB_ID = '0'
|
|
20
|
-
API_VERSION = '1.1.0'
|
|
21
|
-
|
|
22
|
-
def initialize(options = {})
|
|
23
|
-
requires!(options, :login, :password, :pem)
|
|
24
|
-
|
|
25
|
-
options[:pem_password] = options[:password]
|
|
26
|
-
super
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
# Setup transaction. Get redirect_url from response.service_url
|
|
30
|
-
def setup_purchase(money, options = {})
|
|
31
|
-
requires!(options, :issuer_id, :return_url, :order_id, :currency, :description, :entrance_code)
|
|
32
|
-
|
|
33
|
-
commit(build_transaction_request(money, options))
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Check status of transaction and confirm payment
|
|
37
|
-
# transaction_id must be a valid transaction_id from a prior setup.
|
|
38
|
-
def capture(transaction, options = {})
|
|
39
|
-
options[:transaction_id] = transaction
|
|
40
|
-
commit(build_status_request(options))
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Get list of issuers from response.issuer_list
|
|
44
|
-
def issuers
|
|
45
|
-
commit(build_directory_request)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
|
|
50
|
-
def url
|
|
51
|
-
(test? ? test_url : live_url)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def token
|
|
55
|
-
if @token.nil?
|
|
56
|
-
@token = create_fingerprint(@options[:pem])
|
|
57
|
-
end
|
|
58
|
-
@token
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
|
62
|
-
# <AcquirerTrxReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
|
63
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
|
64
|
-
# <Issuer>
|
|
65
|
-
# <issuerID>1003</issuerID>
|
|
66
|
-
# </Issuer>
|
|
67
|
-
# <Merchant>
|
|
68
|
-
# <merchantID>000123456</merchantID>
|
|
69
|
-
# <subID>0</subID>
|
|
70
|
-
# <authentication>passkey</authentication>
|
|
71
|
-
# <token>1</token>
|
|
72
|
-
# <tokenCode>3823ad872eff23</tokenCode>
|
|
73
|
-
# <merchantReturnURL>https://www.mijnwinkel.nl/betaalafhandeling
|
|
74
|
-
# </merchantReturnURL>
|
|
75
|
-
# </Merchant>
|
|
76
|
-
# <Transaction>
|
|
77
|
-
# <purchaseID>iDEAL-aankoop 21</purchaseID>
|
|
78
|
-
# <amount>5999</amount>
|
|
79
|
-
# <currency>EUR</currency>
|
|
80
|
-
# <expirationPeriod>PT3M30S</expirationPeriod>
|
|
81
|
-
# <language>nl</language>
|
|
82
|
-
# <description>Documentensuite</description>
|
|
83
|
-
# <entranceCode>D67tyx6rw9IhY71</entranceCode>
|
|
84
|
-
# </Transaction>
|
|
85
|
-
# </AcquirerTrxReq>
|
|
86
|
-
def build_transaction_request(money, options)
|
|
87
|
-
date_time_stamp = create_time_stamp
|
|
88
|
-
message = date_time_stamp +
|
|
89
|
-
options[:issuer_id] +
|
|
90
|
-
@options[:login] +
|
|
91
|
-
SUB_ID +
|
|
92
|
-
options[:return_url] +
|
|
93
|
-
options[:order_id] +
|
|
94
|
-
money.to_s +
|
|
95
|
-
(options[:currency] || currency(money)) +
|
|
96
|
-
LANGUAGE +
|
|
97
|
-
options[:description] +
|
|
98
|
-
options[:entrance_code]
|
|
99
|
-
token_code = sign_message(@options[:pem], @options[:password], message)
|
|
100
|
-
|
|
101
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
|
102
|
-
xml.instruct!
|
|
103
|
-
xml.tag! 'AcquirerTrxReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
|
104
|
-
xml.tag! 'createDateTimeStamp', date_time_stamp
|
|
105
|
-
xml.tag! 'Issuer' do
|
|
106
|
-
xml.tag! 'issuerID', options[:issuer_id]
|
|
107
|
-
end
|
|
108
|
-
xml.tag! 'Merchant' do
|
|
109
|
-
xml.tag! 'merchantID', @options[:login]
|
|
110
|
-
xml.tag! 'subID', SUB_ID
|
|
111
|
-
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
|
112
|
-
xml.tag! 'token', token
|
|
113
|
-
xml.tag! 'tokenCode', token_code
|
|
114
|
-
xml.tag! 'merchantReturnURL', options[:return_url]
|
|
115
|
-
end
|
|
116
|
-
xml.tag! 'Transaction' do
|
|
117
|
-
xml.tag! 'purchaseID', options[:order_id]
|
|
118
|
-
xml.tag! 'amount', money
|
|
119
|
-
xml.tag! 'currency', options[:currency]
|
|
120
|
-
xml.tag! 'expirationPeriod', options[:expiration_period] || default_expiration_period
|
|
121
|
-
xml.tag! 'language', LANGUAGE
|
|
122
|
-
xml.tag! 'description', options[:description]
|
|
123
|
-
xml.tag! 'entranceCode', options[:entrance_code]
|
|
124
|
-
end
|
|
125
|
-
xml.target!
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
|
130
|
-
# <AcquirerStatusReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
|
131
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
|
132
|
-
# <Merchant>
|
|
133
|
-
# <merchantID>000123456</merchantID>
|
|
134
|
-
# <subID>0</subID>
|
|
135
|
-
# <authentication>keyed hash</authentication>
|
|
136
|
-
# <token>1</token>
|
|
137
|
-
# <tokenCode>3823ad872eff23</tokenCode>
|
|
138
|
-
# </Merchant>
|
|
139
|
-
# <Transaction>
|
|
140
|
-
# <transactionID>0001023456789112</transactionID>
|
|
141
|
-
# </Transaction>
|
|
142
|
-
# </AcquirerStatusReq>
|
|
143
|
-
def build_status_request(options)
|
|
144
|
-
datetimestamp = create_time_stamp
|
|
145
|
-
message = datetimestamp + @options[:login] + SUB_ID + options[:transaction_id]
|
|
146
|
-
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
|
147
|
-
|
|
148
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
|
149
|
-
xml.instruct!
|
|
150
|
-
xml.tag! 'AcquirerStatusReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
|
151
|
-
xml.tag! 'createDateTimeStamp', datetimestamp
|
|
152
|
-
xml.tag! 'Merchant' do
|
|
153
|
-
xml.tag! 'merchantID', @options[:login]
|
|
154
|
-
xml.tag! 'subID', SUB_ID
|
|
155
|
-
xml.tag! 'authentication' , AUTHENTICATION_TYPE
|
|
156
|
-
xml.tag! 'token', token
|
|
157
|
-
xml.tag! 'tokenCode', tokenCode
|
|
158
|
-
end
|
|
159
|
-
xml.tag! 'Transaction' do
|
|
160
|
-
xml.tag! 'transactionID', options[:transaction_id]
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
xml.target!
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
|
167
|
-
# <DirectoryReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
|
168
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
|
169
|
-
# <Merchant>
|
|
170
|
-
# <merchantID>000000001</merchantID>
|
|
171
|
-
# <subID>0</subID>
|
|
172
|
-
# <authentication>1</authentication>
|
|
173
|
-
# <token>hashkey</token>
|
|
174
|
-
# <tokenCode>WajqV1a3nDen0be2r196g9FGFF=</tokenCode>
|
|
175
|
-
# </Merchant>
|
|
176
|
-
# </DirectoryReq>
|
|
177
|
-
def build_directory_request
|
|
178
|
-
datetimestamp = create_time_stamp
|
|
179
|
-
message = datetimestamp + @options[:login] + SUB_ID
|
|
180
|
-
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
|
181
|
-
|
|
182
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
|
183
|
-
xml.instruct!
|
|
184
|
-
xml.tag! 'DirectoryReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
|
185
|
-
xml.tag! 'createDateTimeStamp', datetimestamp
|
|
186
|
-
xml.tag! 'Merchant' do
|
|
187
|
-
xml.tag! 'merchantID', @options[:login]
|
|
188
|
-
xml.tag! 'subID', SUB_ID
|
|
189
|
-
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
|
190
|
-
xml.tag! 'token', token
|
|
191
|
-
xml.tag! 'tokenCode', tokenCode
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
xml.target!
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
def commit(request)
|
|
198
|
-
raw_response = ssl_post(url, request)
|
|
199
|
-
response = Hash.from_xml(raw_response.to_s)
|
|
200
|
-
response_type = response.keys[0]
|
|
201
|
-
|
|
202
|
-
case response_type
|
|
203
|
-
when 'AcquirerTrxRes', 'DirectoryRes'
|
|
204
|
-
success = true
|
|
205
|
-
when 'ErrorRes'
|
|
206
|
-
success = false
|
|
207
|
-
when 'AcquirerStatusRes'
|
|
208
|
-
raise SecurityError, "Message verification failed.", caller unless status_response_verified?(response)
|
|
209
|
-
success = (response['AcquirerStatusRes']['Transaction']['status'] == 'Success')
|
|
210
|
-
else
|
|
211
|
-
raise ArgumentError, "Unknown response type.", caller
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
return IdealResponse.new(success, response.keys[0], response, :test => test?)
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
def create_fingerprint(cert_file)
|
|
218
|
-
cert_data = OpenSSL::X509::Certificate.new(cert_file).to_s
|
|
219
|
-
cert_data = cert_data.sub(/-----BEGIN CERTIFICATE-----/, '')
|
|
220
|
-
cert_data = cert_data.sub(/-----END CERTIFICATE-----/, '')
|
|
221
|
-
fingerprint = Base64.decode64(cert_data)
|
|
222
|
-
fingerprint = Digest::SHA1.hexdigest(fingerprint)
|
|
223
|
-
return fingerprint.upcase
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
def sign_message(private_key_data, password, data)
|
|
227
|
-
private_key = OpenSSL::PKey::RSA.new(private_key_data, password)
|
|
228
|
-
signature = private_key.sign(OpenSSL::Digest::SHA1.new, data.gsub('\s', ''))
|
|
229
|
-
return Base64.encode64(signature).gsub(/\n/, '')
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
def verify_message(cert_file, data, signature)
|
|
233
|
-
public_key = OpenSSL::X509::Certificate.new(cert_file).public_key
|
|
234
|
-
return public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data)
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
def status_response_verified?(response)
|
|
238
|
-
transaction = response['AcquirerStatusRes']['Transaction']
|
|
239
|
-
message = response['AcquirerStatusRes']['createDateTimeStamp'] + transaction['transactionID' ] + transaction['status']
|
|
240
|
-
message << transaction['consumerAccountNumber'].to_s
|
|
241
|
-
verify_message(server_pem, message, response['AcquirerStatusRes']['Signature']['signatureValue'])
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
def create_time_stamp
|
|
245
|
-
Time.now.gmtime.strftime('%Y-%m-%dT%H:%M:%S.000Z')
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
end
|
|
249
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
|
2
|
-
MIICQDCCAakCBELvbPYwDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCREUxDzANBgNVBAgTBkhl
|
|
3
|
-
c3NlbjESMBAGA1UEBxMJRnJhbmtmdXJ0MQ4wDAYDVQQKEwVpREVBTDEOMAwGA1UECxMFaURFQUwx
|
|
4
|
-
EzARBgNVBAMTCmlERUFMIFJhYm8wHhcNMDUwODAyMTI1NDE0WhcNMTUwNzMxMTI1NDE0WjBnMQsw
|
|
5
|
-
CQYDVQQGEwJERTEPMA0GA1UECBMGSGVzc2VuMRIwEAYDVQQHEwlGcmFua2Z1cnQxDjAMBgNVBAoT
|
|
6
|
-
BWlERUFMMQ4wDAYDVQQLEwVpREVBTDETMBEGA1UEAxMKaURFQUwgUmFibzCBnzANBgkqhkiG9w0B
|
|
7
|
-
AQEFAAOBjQAwgYkCgYEA486iIKVhr8RNjxH+PZ3yTWx/8k2fqDFm8XU8I1Z5esRmPFnXmlgA8cG7
|
|
8
|
-
e9AaBPaLoP7Dc8dRQoUO66KMakzGI/WAVdHIJiiKrz8xOcioIgrzPSqec7aqse3J28UraEHkGESJ
|
|
9
|
-
7dAW7Pw/shrmpmkzKsunLt6AkXss4W3JUndZUN0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCGy/FK
|
|
10
|
-
Lotp2ZOTtuLMgvDy74eicq/Znv4bLfpglzAPHycRHcHsXuer/lNHyvpKf2gdYe+IFalUW3OJZWIM
|
|
11
|
-
jpm4UniJ16RPdgwWVRJEdPr/P7JXMIqD2IEOgujuuTQ7x0VgCf9XrsPsP9ZR5DIPcDDhbrpSE0yF
|
|
12
|
-
Do77nwG61xMaGA==
|
|
13
|
-
-----END CERTIFICATE-----
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
|
2
|
-
module Billing #:nodoc:
|
|
3
|
-
class IdealResponse < Response
|
|
4
|
-
|
|
5
|
-
def issuer_list
|
|
6
|
-
list = @params.values[0]['Directory']['Issuer']
|
|
7
|
-
case list
|
|
8
|
-
when Hash
|
|
9
|
-
return [list]
|
|
10
|
-
when Array
|
|
11
|
-
return list
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def service_url
|
|
16
|
-
@params.values[0]['Issuer']['issuerAuthenticationURL']
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def transaction
|
|
20
|
-
@params.values[0]['Transaction']
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def error
|
|
24
|
-
@params.values[0]['Error']
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/ideal/ideal_base'
|
|
2
|
-
|
|
3
|
-
module ActiveMerchant #:nodoc:
|
|
4
|
-
module Billing #:nodoc:
|
|
5
|
-
# First, make sure you have everything setup correctly and all of your dependencies in place with:
|
|
6
|
-
#
|
|
7
|
-
# require 'rubygems'
|
|
8
|
-
# require 'active_merchant'
|
|
9
|
-
#
|
|
10
|
-
# ActiveMerchant expects the amounts to be given as an Integer in cents. In this case, 10 EUR becomes 1000.
|
|
11
|
-
#
|
|
12
|
-
# Create certificates for authentication:
|
|
13
|
-
#
|
|
14
|
-
# The PEM file expected should contain both the certificate and the generated PEM file.
|
|
15
|
-
# Some sample shell commands to generate the certificates:
|
|
16
|
-
#
|
|
17
|
-
# openssl genrsa -aes128 -out priv.pem -passout pass:[YOUR PASSWORD] 1024
|
|
18
|
-
# openssl req -x509 -new -key priv.pem -passin pass:[YOUR PASSWORD] -days 3000 -out cert.cer
|
|
19
|
-
# cat cert.cer priv.pem > ideal.pem
|
|
20
|
-
#
|
|
21
|
-
# Following the steps above, upload cert.cer to the ideal web interface and pass the path of ideal.pem to the :pem option.
|
|
22
|
-
#
|
|
23
|
-
# Configure the gateway using your iDEAL bank account info and security settings:
|
|
24
|
-
#
|
|
25
|
-
# Create gateway:
|
|
26
|
-
# gateway = ActiveMerchant::Billing::IdealRabobankGateway.new(
|
|
27
|
-
# :login => '123456789', # 9 digit merchant number
|
|
28
|
-
# :pem => File.read(Rails.root + 'config/ideal.pem'),
|
|
29
|
-
# :password => 'password' # password for the PEM key
|
|
30
|
-
# )
|
|
31
|
-
#
|
|
32
|
-
# Get list of issuers to fill selection list on your payment form:
|
|
33
|
-
# response = gateway.issuers
|
|
34
|
-
# list = response.issuer_list
|
|
35
|
-
#
|
|
36
|
-
# Request transaction:
|
|
37
|
-
#
|
|
38
|
-
# options = {
|
|
39
|
-
# :issuer_id => '0001',
|
|
40
|
-
# :expiration_period => 'PT10M',
|
|
41
|
-
# :return_url => 'http://www.return.url',
|
|
42
|
-
# :order_id => '1234567890123456',
|
|
43
|
-
# :currency => 'EUR',
|
|
44
|
-
# :description => 'Een omschrijving',
|
|
45
|
-
# :entrance_code => '1234'
|
|
46
|
-
# }
|
|
47
|
-
#
|
|
48
|
-
# response = gateway.setup_purchase(amount, options)
|
|
49
|
-
# transaction_id = response.transaction['transactionID']
|
|
50
|
-
# redirect_url = response.service_url
|
|
51
|
-
#
|
|
52
|
-
# Mandatory status request will confirm transaction:
|
|
53
|
-
# response = gateway.capture(transaction_id)
|
|
54
|
-
#
|
|
55
|
-
# Implementation contains some simplifications
|
|
56
|
-
# - does not support multiple subID per merchant
|
|
57
|
-
# - language is fixed to 'nl'
|
|
58
|
-
class IdealRabobankGateway < IdealBaseGateway
|
|
59
|
-
class_attribute :test_url, :live_url
|
|
60
|
-
|
|
61
|
-
self.test_url = 'https://idealtest.rabobank.nl/ideal/iDeal'
|
|
62
|
-
self.live_url = 'https://ideal.rabobank.nl/ideal/iDeal'
|
|
63
|
-
self.server_pem = File.read(File.dirname(__FILE__) + '/ideal/ideal_rabobank.pem')
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|