activemerchant 1.38.0 → 1.79.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +1402 -3
- data/CONTRIBUTORS +154 -0
- data/README.md +157 -144
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/base.rb +21 -17
- data/lib/active_merchant/billing/check.rb +32 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +215 -67
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +152 -53
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +170 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +299 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +206 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +904 -606
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +43 -18
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +134 -346
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +13 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +326 -0
- data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +96 -15
- data/lib/active_merchant/billing/gateways/beanstream.rb +52 -9
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -8
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -501
- data/lib/active_merchant/billing/gateways/blue_snap.rb +343 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +94 -50
- data/lib/active_merchant/billing/gateways/borgun.rb +221 -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 +387 -139
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +245 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +286 -0
- data/lib/active_merchant/billing/gateways/card_stream.rb +269 -118
- data/lib/active_merchant/billing/gateways/cardknox.rb +328 -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 +45 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +239 -0
- 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 +23 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +225 -0
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +345 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +237 -98
- data/lib/active_merchant/billing/gateways/data_cash.rb +41 -314
- data/lib/active_merchant/billing/gateways/dibs.rb +205 -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 +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +143 -142
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +23 -12
- data/lib/active_merchant/billing/gateways/eway.rb +12 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +417 -204
- data/lib/active_merchant/billing/gateways/exact.rb +10 -1
- data/lib/active_merchant/billing/gateways/ezic.rb +196 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +65 -37
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +143 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +110 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +155 -29
- 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 +256 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +11 -5
- data/lib/active_merchant/billing/gateways/global_collect.rb +334 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- 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/ideal/ideal_base.rb +2 -5
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -0
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +1 -1
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -10
- data/lib/active_merchant/billing/gateways/instapay.rb +0 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +210 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +176 -49
- 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 +227 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +416 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +17 -13
- data/lib/active_merchant/billing/gateways/litle.rb +329 -439
- data/lib/active_merchant/billing/gateways/mastercard.rb +268 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +220 -0
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +262 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +26 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +0 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +12 -15
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +24 -13
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +33 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +74 -29
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -21
- data/lib/active_merchant/billing/gateways/micropayment.rb +185 -0
- data/lib/active_merchant/billing/gateways/migs.rb +73 -14
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -3
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +119 -36
- data/lib/active_merchant/billing/gateways/moneris_us.rb +146 -45
- data/lib/active_merchant/billing/gateways/money_movers.rb +152 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +81 -56
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netbanx.rb +289 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +61 -26
- data/lib/active_merchant/billing/gateways/netpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/network_merchants.rb +242 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +265 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +85 -27
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +227 -0
- data/lib/active_merchant/billing/gateways/opp.rb +372 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +59 -28
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -56
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +207 -0
- data/lib/active_merchant/billing/gateways/pagarme.rb +248 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +246 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -14
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +19 -25
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +190 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +16 -12
- data/lib/active_merchant/billing/gateways/payeezy.rb +386 -0
- data/lib/active_merchant/billing/gateways/payex.rb +412 -0
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +38 -17
- data/lib/active_merchant/billing/gateways/payflow.rb +100 -19
- data/lib/active_merchant/billing/gateways/payflow_express.rb +22 -22
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +6 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +15 -3
- data/lib/active_merchant/billing/gateways/paymentez.rb +276 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +237 -48
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -8
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +18 -4
- data/lib/active_merchant/billing/gateways/paypal.rb +37 -20
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +6 -5
- 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 +162 -0
- data/lib/active_merchant/billing/gateways/paystation.rb +32 -24
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +440 -0
- data/lib/active_merchant/billing/gateways/pin.rb +68 -13
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +14 -14
- data/lib/active_merchant/billing/gateways/psl_card.rb +3 -3
- data/lib/active_merchant/billing/gateways/qbms.rb +12 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +299 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -319
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +40 -25
- data/lib/active_merchant/billing/gateways/redsys.rb +212 -80
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +412 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +176 -59
- data/lib/active_merchant/billing/gateways/secure_net.rb +35 -29
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -9
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +21 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/securion_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -3
- data/lib/active_merchant/billing/gateways/smart_ps.rb +14 -3
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +194 -0
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +74 -14
- data/lib/active_merchant/billing/gateways/stripe.rb +472 -83
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +156 -0
- data/lib/active_merchant/billing/gateways/telr.rb +275 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +142 -28
- 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/transnational.rb +2 -231
- data/lib/active_merchant/billing/gateways/trexle.rb +217 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +17 -11
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +193 -75
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +156 -64
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +1 -15
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +209 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +45 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +238 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +167 -49
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +171 -45
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +218 -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 +24 -17
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +208 -0
- data/lib/active_merchant/country.rb +334 -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 +9 -0
- data/lib/active_merchant/network_connection_retries.rb +81 -0
- data/lib/active_merchant/post_data.rb +24 -0
- data/lib/active_merchant/posts_data.rb +94 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +22 -22
- data/lib/certs/cacert.pem +3951 -0
- data/lib/support/gateway_support.rb +16 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_version.rb +87 -0
- metadata +164 -306
- data/gem-public_cert.pem +0 -20
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +0 -155
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- 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 -73
- 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/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/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/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 -114
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -95
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -19
- 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 -129
- 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/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 -28
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -165
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -43
- 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 -74
- 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 -91
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -139
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -17
- 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/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 -0
@@ -1,17 +1,8 @@
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
2
2
|
module Billing #:nodoc:
|
3
|
-
# See the remote and mocked unit test files for example usage. Pay special
|
4
|
-
# attention to the contents of the options hash.
|
5
|
-
#
|
6
3
|
# Initial setup instructions can be found in
|
7
4
|
# http://cybersource.com/support_center/implementation/downloads/soap_api/SOAP_toolkits.pdf
|
8
5
|
#
|
9
|
-
# Debugging
|
10
|
-
# If you experience an issue with this gateway be sure to examine the
|
11
|
-
# transaction information from a general transaction search inside the
|
12
|
-
# CyberSource Business Center for the full error messages including field
|
13
|
-
# names.
|
14
|
-
#
|
15
6
|
# Important Notes
|
16
7
|
# * For checks you can purchase and store.
|
17
8
|
# * AVS and CVV only work against the production server. You will always
|
@@ -24,31 +15,38 @@ module ActiveMerchant #:nodoc:
|
|
24
15
|
# CyberSource what kind of item you are selling. It is used when
|
25
16
|
# calculating tax/VAT.
|
26
17
|
# * All transactions use dollar values.
|
27
|
-
# * To process pinless debit cards
|
18
|
+
# * To process pinless debit cards through the pinless debit card
|
28
19
|
# network, your Cybersource merchant account must accept pinless
|
29
20
|
# debit card payments.
|
21
|
+
# * The order of the XML elements does matter, make sure to follow the order in
|
22
|
+
# the documentation exactly.
|
30
23
|
class CyberSourceGateway < Gateway
|
31
|
-
self.test_url = 'https://
|
32
|
-
self.live_url = 'https://
|
24
|
+
self.test_url = 'https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor'
|
25
|
+
self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
|
26
|
+
|
27
|
+
XSD_VERSION = "1.121"
|
33
28
|
|
34
|
-
|
29
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :switch, :dankort, :maestro]
|
30
|
+
self.supported_countries = %w(US BR CA CN DK FI FR DE JP MX NO SE GB SG LB)
|
35
31
|
|
36
|
-
# visa, master, american_express, discover
|
37
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
38
|
-
self.supported_countries = ['US']
|
39
32
|
self.default_currency = 'USD'
|
33
|
+
self.currencies_without_fractions = %w(JPY)
|
34
|
+
|
40
35
|
self.homepage_url = 'http://www.cybersource.com'
|
41
36
|
self.display_name = 'CyberSource'
|
42
37
|
|
43
|
-
# map credit card to the CyberSource expected representation
|
44
38
|
@@credit_card_codes = {
|
45
39
|
:visa => '001',
|
46
40
|
:master => '002',
|
47
41
|
:american_express => '003',
|
48
|
-
:discover => '004'
|
42
|
+
:discover => '004',
|
43
|
+
:diners_club => '005',
|
44
|
+
:jcb => '007',
|
45
|
+
:switch => '024',
|
46
|
+
:dankort => '034',
|
47
|
+
:maestro => '042'
|
49
48
|
}
|
50
49
|
|
51
|
-
# map response codes to something humans can read
|
52
50
|
@@response_codes = {
|
53
51
|
:r100 => "Successful transaction",
|
54
52
|
:r101 => "Request is missing one or more required fields" ,
|
@@ -102,7 +100,7 @@ module ActiveMerchant #:nodoc:
|
|
102
100
|
# :vat_reg_number => your VAT registration number
|
103
101
|
#
|
104
102
|
# :nexus => "WI CA QC" sets the states/provinces where you have a physical
|
105
|
-
#
|
103
|
+
# presence for tax purposes
|
106
104
|
#
|
107
105
|
# :ignore_avs => true don't want to use AVS so continue processing even
|
108
106
|
# if AVS would have failed
|
@@ -114,74 +112,67 @@ module ActiveMerchant #:nodoc:
|
|
114
112
|
super
|
115
113
|
end
|
116
114
|
|
117
|
-
# Request an authorization for an amount from CyberSource
|
118
|
-
#
|
119
|
-
# You must supply an :order_id in the options hash
|
120
115
|
def authorize(money, creditcard_or_reference, options = {})
|
121
|
-
requires!(options, :order_id)
|
122
116
|
setup_address_hash(options)
|
123
|
-
commit(build_auth_request(money, creditcard_or_reference, options), options )
|
117
|
+
commit(build_auth_request(money, creditcard_or_reference, options), :authorize, money, options )
|
124
118
|
end
|
125
119
|
|
126
|
-
def auth_reversal(money, identification, options = {})
|
127
|
-
commit(build_auth_reversal_request(money, identification, options), options)
|
128
|
-
end
|
129
|
-
|
130
|
-
# Capture an authorization that has previously been requested
|
131
120
|
def capture(money, authorization, options = {})
|
132
121
|
setup_address_hash(options)
|
133
|
-
commit(build_capture_request(money, authorization, options), options)
|
122
|
+
commit(build_capture_request(money, authorization, options), :capture, money, options)
|
134
123
|
end
|
135
124
|
|
136
|
-
# Purchase is an auth followed by a capture
|
137
|
-
# You must supply an order_id in the options hash
|
138
125
|
# options[:pinless_debit_card] => true # attempts to process as pinless debit card
|
139
126
|
def purchase(money, payment_method_or_reference, options = {})
|
140
|
-
requires!(options, :order_id)
|
141
127
|
setup_address_hash(options)
|
142
|
-
commit(build_purchase_request(money, payment_method_or_reference, options), options)
|
128
|
+
commit(build_purchase_request(money, payment_method_or_reference, options), :purchase, money, options)
|
143
129
|
end
|
144
130
|
|
145
131
|
def void(identification, options = {})
|
146
|
-
commit(build_void_request(identification, options), options)
|
132
|
+
commit(build_void_request(identification, options), :void, nil, options)
|
147
133
|
end
|
148
134
|
|
149
135
|
def refund(money, identification, options = {})
|
150
|
-
commit(build_refund_request(money, identification, options), options)
|
136
|
+
commit(build_refund_request(money, identification, options), :refund, money, options)
|
137
|
+
end
|
138
|
+
|
139
|
+
def verify(payment, options = {})
|
140
|
+
MultiResponse.run(:use_first_response) do |r|
|
141
|
+
r.process { authorize(100, payment, options) }
|
142
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
143
|
+
end
|
151
144
|
end
|
152
145
|
|
153
146
|
# Adds credit to a subscription (stand alone credit).
|
154
147
|
def credit(money, reference, options = {})
|
155
|
-
|
156
|
-
commit(build_credit_request(money, reference, options), options)
|
148
|
+
commit(build_credit_request(money, reference, options), :credit, money, options)
|
157
149
|
end
|
158
150
|
|
159
151
|
# Stores a customer subscription/profile with type "on-demand".
|
160
152
|
# To charge the card while creating a profile, pass
|
161
153
|
# options[:setup_fee] => money
|
162
154
|
def store(payment_method, options = {})
|
163
|
-
requires!(options, :order_id)
|
164
155
|
setup_address_hash(options)
|
165
|
-
commit(build_create_subscription_request(payment_method, options), options)
|
156
|
+
commit(build_create_subscription_request(payment_method, options), :store, nil, options)
|
166
157
|
end
|
167
158
|
|
168
159
|
# Updates a customer subscription/profile
|
169
160
|
def update(reference, creditcard, options = {})
|
170
161
|
requires!(options, :order_id)
|
171
162
|
setup_address_hash(options)
|
172
|
-
commit(build_update_subscription_request(reference, creditcard, options), options)
|
163
|
+
commit(build_update_subscription_request(reference, creditcard, options), :update, nil, options)
|
173
164
|
end
|
174
165
|
|
175
166
|
# Removes a customer subscription/profile
|
176
167
|
def unstore(reference, options = {})
|
177
168
|
requires!(options, :order_id)
|
178
|
-
commit(build_delete_subscription_request(reference, options), options)
|
169
|
+
commit(build_delete_subscription_request(reference, options), :unstore, nil, options)
|
179
170
|
end
|
180
171
|
|
181
172
|
# Retrieves a customer subscription/profile
|
182
173
|
def retrieve(reference, options = {})
|
183
174
|
requires!(options, :order_id)
|
184
|
-
commit(build_retrieve_subscription_request(reference, options), options)
|
175
|
+
commit(build_retrieve_subscription_request(reference, options), :retrieve, nil, options)
|
185
176
|
end
|
186
177
|
|
187
178
|
# CyberSource requires that you provide line item information for tax
|
@@ -213,29 +204,63 @@ module ActiveMerchant #:nodoc:
|
|
213
204
|
def calculate_tax(creditcard, options)
|
214
205
|
requires!(options, :line_items)
|
215
206
|
setup_address_hash(options)
|
216
|
-
commit(build_tax_calculation_request(creditcard, options), options)
|
207
|
+
commit(build_tax_calculation_request(creditcard, options), :calculate_tax, nil, options)
|
217
208
|
end
|
218
209
|
|
219
210
|
# Determines if a card can be used for Pinless Debit Card transactions
|
220
211
|
def validate_pinless_debit_card(creditcard, options = {})
|
221
212
|
requires!(options, :order_id)
|
222
|
-
commit(build_validate_pinless_debit_request(creditcard,options), options)
|
213
|
+
commit(build_validate_pinless_debit_request(creditcard,options), :validate_pinless_debit_card, nil, options)
|
214
|
+
end
|
215
|
+
|
216
|
+
def supports_scrubbing?
|
217
|
+
true
|
218
|
+
end
|
219
|
+
|
220
|
+
def scrub(transcript)
|
221
|
+
transcript.
|
222
|
+
gsub(%r((<wsse:Password [^>]*>)[^<]*(</wsse:Password>))i, '\1[FILTERED]\2').
|
223
|
+
gsub(%r((<accountNumber>)[^<]*(</accountNumber>))i, '\1[FILTERED]\2').
|
224
|
+
gsub(%r((<cvNumber>)[^<]*(</cvNumber>))i, '\1[FILTERED]\2').
|
225
|
+
gsub(%r((<cavv>)[^<]*(</cavv>))i, '\1[FILTERED]\2').
|
226
|
+
gsub(%r((<xid>)[^<]*(</xid>))i, '\1[FILTERED]\2').
|
227
|
+
gsub(%r((<authenticationData>)[^<]*(</authenticationData>))i, '\1[FILTERED]\2')
|
228
|
+
end
|
229
|
+
|
230
|
+
def supports_network_tokenization?
|
231
|
+
true
|
232
|
+
end
|
233
|
+
|
234
|
+
def verify_credentials
|
235
|
+
response = void("0")
|
236
|
+
response.params["reasonCode"] == "102"
|
223
237
|
end
|
224
238
|
|
225
239
|
private
|
226
240
|
|
227
241
|
# Create all address hash key value pairs so that we still function if we
|
228
|
-
# were only provided with one or two of them
|
242
|
+
# were only provided with one or two of them or even none
|
229
243
|
def setup_address_hash(options)
|
230
|
-
|
244
|
+
default_address = {
|
245
|
+
:address1 => 'Unspecified',
|
246
|
+
:city => 'Unspecified',
|
247
|
+
:state => 'NC',
|
248
|
+
:zip => '00000',
|
249
|
+
:country => 'US'
|
250
|
+
}
|
251
|
+
options[:billing_address] = options[:billing_address] || options[:address] || default_address
|
231
252
|
options[:shipping_address] = options[:shipping_address] || {}
|
232
253
|
end
|
233
254
|
|
234
255
|
def build_auth_request(money, creditcard_or_reference, options)
|
235
256
|
xml = Builder::XmlMarkup.new :indent => 2
|
236
257
|
add_payment_method_or_subscription(xml, money, creditcard_or_reference, options)
|
237
|
-
|
238
|
-
|
258
|
+
add_decision_manager_fields(xml, options)
|
259
|
+
add_mdd_fields(xml, options)
|
260
|
+
add_auth_service(xml, creditcard_or_reference, options)
|
261
|
+
add_threeds_services(xml, options)
|
262
|
+
add_payment_network_token(xml) if network_tokenization?(creditcard_or_reference)
|
263
|
+
add_business_rules_data(xml, creditcard_or_reference, options)
|
239
264
|
xml.target!
|
240
265
|
end
|
241
266
|
|
@@ -246,7 +271,7 @@ module ActiveMerchant #:nodoc:
|
|
246
271
|
add_line_item_data(xml, options)
|
247
272
|
add_purchase_data(xml, 0, false, options)
|
248
273
|
add_tax_service(xml)
|
249
|
-
add_business_rules_data(xml)
|
274
|
+
add_business_rules_data(xml, creditcard, options)
|
250
275
|
xml.target!
|
251
276
|
end
|
252
277
|
|
@@ -257,37 +282,37 @@ module ActiveMerchant #:nodoc:
|
|
257
282
|
xml = Builder::XmlMarkup.new :indent => 2
|
258
283
|
add_purchase_data(xml, money, true, options)
|
259
284
|
add_capture_service(xml, request_id, request_token)
|
260
|
-
add_business_rules_data(xml)
|
285
|
+
add_business_rules_data(xml, authorization, options)
|
261
286
|
xml.target!
|
262
287
|
end
|
263
288
|
|
264
289
|
def build_purchase_request(money, payment_method_or_reference, options)
|
265
290
|
xml = Builder::XmlMarkup.new :indent => 2
|
266
291
|
add_payment_method_or_subscription(xml, money, payment_method_or_reference, options)
|
292
|
+
add_decision_manager_fields(xml, options)
|
293
|
+
add_mdd_fields(xml, options)
|
267
294
|
if !payment_method_or_reference.is_a?(String) && card_brand(payment_method_or_reference) == 'check'
|
268
295
|
add_check_service(xml)
|
269
296
|
else
|
270
|
-
add_purchase_service(xml, options)
|
271
|
-
|
297
|
+
add_purchase_service(xml, payment_method_or_reference, options)
|
298
|
+
add_threeds_services(xml, options)
|
299
|
+
add_payment_network_token(xml) if network_tokenization?(payment_method_or_reference)
|
300
|
+
add_business_rules_data(xml, payment_method_or_reference, options) unless options[:pinless_debit_card]
|
272
301
|
end
|
273
302
|
xml.target!
|
274
303
|
end
|
275
304
|
|
276
305
|
def build_void_request(identification, options)
|
277
|
-
order_id, request_id, request_token = identification.split(";")
|
306
|
+
order_id, request_id, request_token, action, money, currency = identification.split(";")
|
278
307
|
options[:order_id] = order_id
|
279
308
|
|
280
309
|
xml = Builder::XmlMarkup.new :indent => 2
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
options[:order_id] = order_id
|
288
|
-
xml = Builder::XmlMarkup.new :indent => 2
|
289
|
-
add_purchase_data(xml, money, true, options)
|
290
|
-
add_auth_reversal_service(xml, request_id, request_token)
|
310
|
+
if action == "capture"
|
311
|
+
add_void_service(xml, request_id, request_token)
|
312
|
+
else
|
313
|
+
add_purchase_data(xml, money, true, options.merge(:currency => currency || default_currency))
|
314
|
+
add_auth_reversal_service(xml, request_id, request_token)
|
315
|
+
end
|
291
316
|
xml.target!
|
292
317
|
end
|
293
318
|
|
@@ -313,7 +338,10 @@ module ActiveMerchant #:nodoc:
|
|
313
338
|
end
|
314
339
|
|
315
340
|
def build_create_subscription_request(payment_method, options)
|
316
|
-
|
341
|
+
default_subscription_params = {:frequency => "on-demand", :amount => 0, :automatic_renew => false}
|
342
|
+
options[:subscription] = default_subscription_params.update(
|
343
|
+
options[:subscription] || {}
|
344
|
+
)
|
317
345
|
|
318
346
|
xml = Builder::XmlMarkup.new :indent => 2
|
319
347
|
add_address(xml, payment_method, options[:billing_address], options)
|
@@ -321,15 +349,21 @@ module ActiveMerchant #:nodoc:
|
|
321
349
|
if card_brand(payment_method) == 'check'
|
322
350
|
add_check(xml, payment_method)
|
323
351
|
add_check_payment_method(xml)
|
324
|
-
add_check_service(xml, options) if options[:setup_fee]
|
325
352
|
else
|
326
353
|
add_creditcard(xml, payment_method)
|
327
354
|
add_creditcard_payment_method(xml)
|
328
|
-
add_purchase_service(xml, options) if options[:setup_fee]
|
329
355
|
end
|
330
356
|
add_subscription(xml, options)
|
357
|
+
if options[:setup_fee]
|
358
|
+
if card_brand(payment_method) == 'check'
|
359
|
+
add_check_service(xml, options)
|
360
|
+
else
|
361
|
+
add_purchase_service(xml, payment_method, options)
|
362
|
+
add_payment_network_token(xml) if network_tokenization?(payment_method)
|
363
|
+
end
|
364
|
+
end
|
331
365
|
add_subscription_create_service(xml, options)
|
332
|
-
add_business_rules_data(xml)
|
366
|
+
add_business_rules_data(xml, payment_method, options)
|
333
367
|
xml.target!
|
334
368
|
end
|
335
369
|
|
@@ -341,7 +375,7 @@ module ActiveMerchant #:nodoc:
|
|
341
375
|
add_creditcard_payment_method(xml) if creditcard
|
342
376
|
add_subscription(xml, options, reference)
|
343
377
|
add_subscription_update_service(xml, options)
|
344
|
-
add_business_rules_data(xml)
|
378
|
+
add_business_rules_data(xml, creditcard, options)
|
345
379
|
xml.target!
|
346
380
|
end
|
347
381
|
|
@@ -366,17 +400,28 @@ module ActiveMerchant #:nodoc:
|
|
366
400
|
xml.target!
|
367
401
|
end
|
368
402
|
|
369
|
-
def add_business_rules_data(xml)
|
370
|
-
|
371
|
-
|
372
|
-
|
403
|
+
def add_business_rules_data(xml, payment_method, options)
|
404
|
+
prioritized_options = [options, @options]
|
405
|
+
|
406
|
+
unless network_tokenization?(payment_method)
|
407
|
+
xml.tag! 'businessRules' do
|
408
|
+
xml.tag!('ignoreAVSResult', 'true') if extract_option(prioritized_options, :ignore_avs)
|
409
|
+
xml.tag!('ignoreCVResult', 'true') if extract_option(prioritized_options, :ignore_cvv)
|
410
|
+
end
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
414
|
+
def extract_option prioritized_options, option_name
|
415
|
+
options_matching_key = prioritized_options.detect do |options|
|
416
|
+
options.has_key? option_name
|
373
417
|
end
|
418
|
+
options_matching_key[option_name] if options_matching_key
|
374
419
|
end
|
375
420
|
|
376
421
|
def add_line_item_data(xml, options)
|
377
422
|
options[:line_items].each_with_index do |value, index|
|
378
423
|
xml.tag! 'item', {'id' => index} do
|
379
|
-
xml.tag! 'unitPrice',
|
424
|
+
xml.tag! 'unitPrice', localized_amount(value[:declared_value].to_i, options[:currency] || default_currency)
|
380
425
|
xml.tag! 'quantity', value[:quantity]
|
381
426
|
xml.tag! 'productCode', value[:code] || 'shipping_only'
|
382
427
|
xml.tag! 'productName', value[:description]
|
@@ -387,7 +432,7 @@ module ActiveMerchant #:nodoc:
|
|
387
432
|
|
388
433
|
def add_merchant_data(xml, options)
|
389
434
|
xml.tag! 'merchantID', @options[:login]
|
390
|
-
xml.tag! 'merchantReferenceCode', options[:order_id]
|
435
|
+
xml.tag! 'merchantReferenceCode', options[:order_id] || generate_unique_id
|
391
436
|
xml.tag! 'clientLibrary' ,'Ruby Active Merchant'
|
392
437
|
xml.tag! 'clientLibraryVersion', VERSION
|
393
438
|
xml.tag! 'clientEnvironment' , RUBY_PLATFORM
|
@@ -396,13 +441,11 @@ module ActiveMerchant #:nodoc:
|
|
396
441
|
def add_purchase_data(xml, money = 0, include_grand_total = false, options={})
|
397
442
|
xml.tag! 'purchaseTotals' do
|
398
443
|
xml.tag! 'currency', options[:currency] || currency(money)
|
399
|
-
xml.tag!('grandTotalAmount',
|
444
|
+
xml.tag!('grandTotalAmount', localized_amount(money.to_i, options[:currency] || default_currency)) if include_grand_total
|
400
445
|
end
|
401
446
|
end
|
402
447
|
|
403
448
|
def add_address(xml, payment_method, address, options, shipTo = false)
|
404
|
-
requires!(options, :email)
|
405
|
-
|
406
449
|
xml.tag! shipTo ? 'shipTo' : 'billTo' do
|
407
450
|
xml.tag! 'firstName', payment_method.first_name if payment_method
|
408
451
|
xml.tag! 'lastName', payment_method.last_name if payment_method
|
@@ -411,11 +454,12 @@ module ActiveMerchant #:nodoc:
|
|
411
454
|
xml.tag! 'city', address[:city]
|
412
455
|
xml.tag! 'state', address[:state]
|
413
456
|
xml.tag! 'postalCode', address[:zip]
|
414
|
-
xml.tag! 'country', address[:country]
|
457
|
+
xml.tag! 'country', lookup_country_code(address[:country]) unless address[:country].blank?
|
415
458
|
xml.tag! 'company', address[:company] unless address[:company].blank?
|
416
459
|
xml.tag! 'companyTaxID', address[:companyTaxID] unless address[:company_tax_id].blank?
|
417
|
-
xml.tag! 'phoneNumber', address[:
|
418
|
-
xml.tag! 'email', options[:email]
|
460
|
+
xml.tag! 'phoneNumber', address[:phone] unless address[:phone].blank?
|
461
|
+
xml.tag! 'email', options[:email] || 'null@cybersource.com'
|
462
|
+
xml.tag! 'ipAddress', options[:ip] unless options[:ip].blank? || shipTo
|
419
463
|
xml.tag! 'driversLicenseNumber', options[:drivers_license_number] unless options[:drivers_license_number].blank?
|
420
464
|
xml.tag! 'driversLicenseState', options[:drivers_license_state] unless options[:drivers_license_state].blank?
|
421
465
|
end
|
@@ -431,6 +475,26 @@ module ActiveMerchant #:nodoc:
|
|
431
475
|
end
|
432
476
|
end
|
433
477
|
|
478
|
+
def add_decision_manager_fields(xml, options)
|
479
|
+
return unless options[:decision_manager_enabled]
|
480
|
+
|
481
|
+
xml.tag! 'decisionManager' do
|
482
|
+
xml.tag! 'enabled', options[:decision_manager_enabled] if options[:decision_manager_enabled]
|
483
|
+
xml.tag! 'profile', options[:decision_manager_profile] if options[:decision_manager_profile]
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
def add_mdd_fields(xml, options)
|
488
|
+
return unless options.keys.any? { |key| key.to_s.start_with?("mdd_field") }
|
489
|
+
|
490
|
+
xml.tag! 'merchantDefinedData' do
|
491
|
+
(1..100).each do |each|
|
492
|
+
key = "mdd_field_#{each}".to_sym
|
493
|
+
xml.tag!("field#{each}", options[key]) if options[key]
|
494
|
+
end
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
434
498
|
def add_check(xml, check)
|
435
499
|
xml.tag! 'check' do
|
436
500
|
xml.tag! 'accountNumber', check.account_number
|
@@ -446,8 +510,50 @@ module ActiveMerchant #:nodoc:
|
|
446
510
|
end
|
447
511
|
end
|
448
512
|
|
449
|
-
def add_auth_service(xml)
|
450
|
-
|
513
|
+
def add_auth_service(xml, payment_method, options)
|
514
|
+
if network_tokenization?(payment_method)
|
515
|
+
add_auth_network_tokenization(xml, payment_method, options)
|
516
|
+
else
|
517
|
+
xml.tag! 'ccAuthService', {'run' => 'true'}
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
def network_tokenization?(payment_method)
|
522
|
+
payment_method.is_a?(NetworkTokenizationCreditCard)
|
523
|
+
end
|
524
|
+
|
525
|
+
def add_auth_network_tokenization(xml, payment_method, options)
|
526
|
+
return unless network_tokenization?(payment_method)
|
527
|
+
|
528
|
+
case card_brand(payment_method).to_sym
|
529
|
+
when :visa
|
530
|
+
xml.tag! 'ccAuthService', {'run' => 'true'} do
|
531
|
+
xml.tag!("cavv", payment_method.payment_cryptogram)
|
532
|
+
xml.tag!("commerceIndicator", "vbv")
|
533
|
+
xml.tag!("xid", payment_method.payment_cryptogram)
|
534
|
+
end
|
535
|
+
when :mastercard
|
536
|
+
xml.tag! 'ucaf' do
|
537
|
+
xml.tag!("authenticationData", payment_method.payment_cryptogram)
|
538
|
+
xml.tag!("collectionIndicator", "2")
|
539
|
+
end
|
540
|
+
xml.tag! 'ccAuthService', {'run' => 'true'} do
|
541
|
+
xml.tag!("commerceIndicator", "spa")
|
542
|
+
end
|
543
|
+
when :american_express
|
544
|
+
cryptogram = Base64.decode64(payment_method.payment_cryptogram)
|
545
|
+
xml.tag! 'ccAuthService', {'run' => 'true'} do
|
546
|
+
xml.tag!("cavv", Base64.encode64(cryptogram[0...20]))
|
547
|
+
xml.tag!("commerceIndicator", "aesk")
|
548
|
+
xml.tag!("xid", Base64.encode64(cryptogram[20...40]))
|
549
|
+
end
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
553
|
+
def add_payment_network_token(xml)
|
554
|
+
xml.tag! 'paymentNetworkToken' do
|
555
|
+
xml.tag!('transactionType', '1')
|
556
|
+
end
|
451
557
|
end
|
452
558
|
|
453
559
|
def add_capture_service(xml, request_id, request_token)
|
@@ -457,11 +563,11 @@ module ActiveMerchant #:nodoc:
|
|
457
563
|
end
|
458
564
|
end
|
459
565
|
|
460
|
-
def add_purchase_service(xml, options)
|
566
|
+
def add_purchase_service(xml, payment_method, options)
|
461
567
|
if options[:pinless_debit_card]
|
462
568
|
xml.tag! 'pinlessDebitService', {'run' => 'true'}
|
463
569
|
else
|
464
|
-
xml
|
570
|
+
add_auth_service(xml, payment_method, options)
|
465
571
|
xml.tag! 'ccCaptureService', {'run' => 'true'}
|
466
572
|
end
|
467
573
|
end
|
@@ -512,12 +618,12 @@ module ActiveMerchant #:nodoc:
|
|
512
618
|
|
513
619
|
xml.tag! 'recurringSubscriptionInfo' do
|
514
620
|
if reference
|
515
|
-
|
621
|
+
subscription_id = reference.split(";")[6]
|
516
622
|
xml.tag! 'subscriptionID', subscription_id
|
517
623
|
end
|
518
624
|
|
519
625
|
xml.tag! 'status', options[:subscription][:status] if options[:subscription][:status]
|
520
|
-
xml.tag! 'amount', options[:subscription][:amount]
|
626
|
+
xml.tag! 'amount', localized_amount(options[:subscription][:amount].to_i, options[:currency] || default_currency) if options[:subscription][:amount]
|
521
627
|
xml.tag! 'numberOfPayments', options[:subscription][:occurrences] if options[:subscription][:occurrences]
|
522
628
|
xml.tag! 'automaticRenew', options[:subscription][:automatic_renew] if options[:subscription][:automatic_renew]
|
523
629
|
xml.tag! 'frequency', options[:subscription][:frequency] if options[:subscription][:frequency]
|
@@ -551,6 +657,7 @@ module ActiveMerchant #:nodoc:
|
|
551
657
|
add_check(xml, payment_method_or_reference)
|
552
658
|
else
|
553
659
|
add_address(xml, payment_method_or_reference, options[:billing_address], options)
|
660
|
+
add_address(xml, payment_method_or_reference, options[:shipping_address], options, true)
|
554
661
|
add_purchase_data(xml, money, true, options)
|
555
662
|
add_creditcard(xml, payment_method_or_reference)
|
556
663
|
end
|
@@ -560,6 +667,20 @@ module ActiveMerchant #:nodoc:
|
|
560
667
|
xml.tag!'pinlessDebitValidateService', {'run' => 'true'}
|
561
668
|
end
|
562
669
|
|
670
|
+
def add_threeds_services(xml, options)
|
671
|
+
xml.tag! 'payerAuthEnrollService', {'run' => 'true'} if options[:payer_auth_enroll_service]
|
672
|
+
if options[:payer_auth_validate_service]
|
673
|
+
xml.tag! 'payerAuthValidateService', {'run' => 'true'} do
|
674
|
+
xml.tag! 'signedPARes', options[:pares]
|
675
|
+
end
|
676
|
+
end
|
677
|
+
end
|
678
|
+
|
679
|
+
def lookup_country_code(country_field)
|
680
|
+
country_code = Country.find(country_field) rescue nil
|
681
|
+
country_code.code(:alpha2) if country_code
|
682
|
+
end
|
683
|
+
|
563
684
|
# Where we actually build the full SOAP request using builder
|
564
685
|
def build_request(body, options)
|
565
686
|
xml = Builder::XmlMarkup.new :indent => 2
|
@@ -585,12 +706,19 @@ module ActiveMerchant #:nodoc:
|
|
585
706
|
|
586
707
|
# Contact CyberSource, make the SOAP request, and parse the reply into a
|
587
708
|
# Response object
|
588
|
-
def commit(request, options)
|
589
|
-
|
709
|
+
def commit(request, action, amount, options)
|
710
|
+
begin
|
711
|
+
response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(request, options)))
|
712
|
+
rescue ResponseError => e
|
713
|
+
response = parse(e.response.body)
|
714
|
+
rescue REXML::ParseException => e
|
715
|
+
response = { message: e.to_s }
|
716
|
+
end
|
590
717
|
|
591
718
|
success = response[:decision] == "ACCEPT"
|
592
|
-
message =
|
593
|
-
|
719
|
+
message = response[:message]
|
720
|
+
|
721
|
+
authorization = success ? authorization_from(response, action, amount, options) : nil
|
594
722
|
|
595
723
|
Response.new(success, message, response,
|
596
724
|
:test => test?,
|
@@ -607,9 +735,10 @@ module ActiveMerchant #:nodoc:
|
|
607
735
|
xml = REXML::Document.new(xml)
|
608
736
|
if root = REXML::XPath.first(xml, "//c:replyMessage")
|
609
737
|
root.elements.to_a.each do |node|
|
610
|
-
case node.
|
738
|
+
case node.expanded_name
|
611
739
|
when 'c:reasonCode'
|
612
|
-
reply[:
|
740
|
+
reply[:reasonCode] = node.text
|
741
|
+
reply[:message] = reason_message(node.text)
|
613
742
|
else
|
614
743
|
parse_element(reply, node)
|
615
744
|
end
|
@@ -626,14 +755,24 @@ module ActiveMerchant #:nodoc:
|
|
626
755
|
node.elements.each{|e| parse_element(reply, e) }
|
627
756
|
else
|
628
757
|
if node.parent.name =~ /item/
|
629
|
-
parent = node.parent.name
|
630
|
-
|
631
|
-
|
632
|
-
reply[node.name.to_sym] = node.text
|
758
|
+
parent = node.parent.name
|
759
|
+
parent += '_' + node.parent.attributes["id"] if node.parent.attributes["id"]
|
760
|
+
parent += '_'
|
633
761
|
end
|
762
|
+
reply["#{parent}#{node.name}".to_sym] ||= node.text
|
634
763
|
end
|
635
764
|
return reply
|
636
765
|
end
|
766
|
+
|
767
|
+
def reason_message(reason_code)
|
768
|
+
return if reason_code.blank?
|
769
|
+
@@response_codes[:"r#{reason_code}"]
|
770
|
+
end
|
771
|
+
|
772
|
+
def authorization_from(response, action, amount, options)
|
773
|
+
[options[:order_id], response[:requestID], response[:requestToken], action, amount,
|
774
|
+
options[:currency], response[:subscriptionID]].join(";")
|
775
|
+
end
|
637
776
|
end
|
638
777
|
end
|
639
778
|
end
|