activemerchant 1.43.3 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG +133 -3
- data/CONTRIBUTORS +25 -0
- data/README.md +14 -39
- data/lib/active_merchant.rb +43 -2
- data/lib/active_merchant/billing.rb +3 -1
- data/lib/active_merchant/billing/base.rb +10 -2
- data/lib/active_merchant/billing/check.rb +29 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +129 -60
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +60 -43
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +46 -11
- data/lib/active_merchant/billing/gateways/adyen.rb +205 -0
- data/lib/active_merchant/billing/gateways/app55.rb +1 -9
- data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -391
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +20 -4
- data/lib/active_merchant/billing/gateways/balanced.rb +127 -367
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream.rb +25 -6
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -3
- data/lib/active_merchant/billing/gateways/blue_pay.rb +11 -3
- data/lib/active_merchant/billing/gateways/bogus.rb +1 -13
- data/lib/active_merchant/billing/gateways/borgun.rb +211 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +31 -13
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +184 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
- data/lib/active_merchant/billing/gateways/certo_direct.rb +3 -2
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +56 -81
- data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +3 -1
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +45 -9
- data/lib/active_merchant/billing/gateways/epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/eway.rb +1 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +233 -202
- data/lib/active_merchant/billing/gateways/exact.rb +1 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +1 -1
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +108 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +43 -13
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/hps.rb +281 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +1 -4
- data/lib/active_merchant/billing/gateways/inspire.rb +0 -8
- data/lib/active_merchant/billing/gateways/iridium.rb +25 -3
- data/lib/active_merchant/billing/gateways/jetpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -13
- data/lib/active_merchant/billing/gateways/litle.rb +10 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +7 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -6
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +4 -11
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -10
- data/lib/active_merchant/billing/gateways/mercury.rb +0 -7
- data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -20
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/moneris.rb +29 -21
- data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -11
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -8
- data/lib/active_merchant/billing/gateways/nab_transact.rb +16 -15
- data/lib/active_merchant/billing/gateways/net_registry.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbilling.rb +0 -7
- data/lib/active_merchant/billing/gateways/network_merchants.rb +21 -18
- data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
- data/lib/active_merchant/billing/gateways/openpay.rb +1 -8
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +34 -23
- data/lib/active_merchant/billing/gateways/orbital.rb +121 -4
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +2 -9
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -13
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -9
- data/lib/active_merchant/billing/gateways/payex.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +15 -15
- data/lib/active_merchant/billing/gateways/payflow_express.rb +19 -19
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +25 -14
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +16 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +3 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +25 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -8
- data/lib/active_merchant/billing/gateways/pin.rb +39 -7
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/psigate.rb +1 -12
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickpay.rb +17 -15
- data/lib/active_merchant/billing/gateways/realex.rb +3 -12
- data/lib/active_merchant/billing/gateways/sage.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +2 -8
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage_pay.rb +93 -28
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -8
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +3 -3
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -2
- data/lib/active_merchant/billing/gateways/smart_ps.rb +8 -2
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +14 -15
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +0 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +4 -9
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +46 -43
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +7 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +0 -6
- data/lib/active_merchant/billing/gateways/vindicia.rb +68 -44
- data/lib/active_merchant/billing/gateways/webpay.rb +1 -9
- data/lib/active_merchant/billing/gateways/wirecard.rb +117 -11
- data/lib/active_merchant/billing/gateways/worldpay.rb +50 -22
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +181 -0
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +20 -15
- data/lib/active_merchant/country.rb +327 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +29 -0
- data/lib/active_merchant/offsite_payments_shim.rb +19 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +60 -243
- metadata.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/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- 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/action_view_helper.rb +0 -78
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- 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/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -66
- 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/bogus.rb +0 -23
- 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/chronopay.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/citrus.rb +0 -28
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -57
- 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/direc_pay.rb +0 -41
- 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/directebanking.rb +0 -47
- 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/doku.rb +0 -24
- 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/dotpay.rb +0 -22
- 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/dwolla.rb +0 -23
- 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/e_payment_plans.rb +0 -48
- 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/easy_pay.rb +0 -30
- 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/epay.rb +0 -21
- 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/first_data.rb +0 -38
- 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/gestpay.rb +0 -25
- 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/helper.rb +0 -123
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- 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/ipay88.rb +0 -23
- 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/klarna.rb +0 -71
- data/lib/active_merchant/billing/integrations/klarna/helper.rb +0 -123
- data/lib/active_merchant/billing/integrations/klarna/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- 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/maksuturva.rb +0 -86
- 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/mollie_ideal.rb +0 -98
- data/lib/active_merchant/billing/integrations/mollie_ideal/helper.rb +0 -67
- data/lib/active_merchant/billing/integrations/mollie_ideal/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/mollie_ideal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- 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/nochex.rb +0 -88
- 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/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/pag_seguro.rb +0 -53
- data/lib/active_merchant/billing/integrations/pag_seguro/helper.rb +0 -121
- data/lib/active_merchant/billing/integrations/pag_seguro/notification.rb +0 -104
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- 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/pay_fast.rb +0 -70
- 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/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- 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/paypal.rb +0 -39
- 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_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- 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/payu_in.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_paisa.rb +0 -30
- 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/platron.rb +0 -28
- 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/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -113
- 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/quickpay.rb +0 -21
- 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/rbkmoney.rb +0 -17
- 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/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- 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/sage_pay_form.rb +0 -37
- 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/two_checkout.rb +0 -44
- 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/universal.rb +0 -23
- data/lib/active_merchant/billing/integrations/universal/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/universal/notification.rb +0 -52
- data/lib/active_merchant/billing/integrations/universal/return.rb +0 -18
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- 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/verkkomaksut.rb +0 -20
- 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/web_pay.rb +0 -45
- 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/webmoney.rb +0 -43
- 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/wirecard_checkout_page.rb +0 -39
- 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/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
|
@@ -63,6 +63,13 @@ module ActiveMerchant #:nodoc:
|
|
|
63
63
|
commit(:refund, post)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
def verify(creditcard, options = {})
|
|
67
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
68
|
+
r.process { authorize(1, creditcard, options) }
|
|
69
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
66
73
|
def void(authorization, options = {})
|
|
67
74
|
post = { :refNum => authorization }
|
|
68
75
|
commit(:void, post)
|
|
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
|
|
|
86
86
|
|
|
87
87
|
def credit(money, credit_card_or_authorization, options = {})
|
|
88
88
|
if credit_card_or_authorization.is_a?(String)
|
|
89
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
89
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
90
90
|
refund(money, credit_card_or_authorization, options)
|
|
91
91
|
else
|
|
92
92
|
sale_authorization_or_credit_template(:credit, money, credit_card_or_authorization, options)
|
|
@@ -125,13 +125,6 @@ module ActiveMerchant #:nodoc:
|
|
|
125
125
|
post[:cvv] = credit_card.verification_value
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
-
def expdate(credit_card)
|
|
129
|
-
year = sprintf("%.4i", credit_card.year)
|
|
130
|
-
month = sprintf("%.2i", credit_card.month)
|
|
131
|
-
|
|
132
|
-
"#{month}#{year[-2..-1]}"
|
|
133
|
-
end
|
|
134
|
-
|
|
135
128
|
def add_addresses(post, options)
|
|
136
129
|
if billing_address = options[:billing_address] || options[:address]
|
|
137
130
|
post[:company] = billing_address[:company]
|
|
@@ -169,12 +169,6 @@ module ActiveMerchant #:nodoc:
|
|
|
169
169
|
result.collect { |key, value| "ssl_#{key}=#{CGI.escape(value.to_s)}" }.join("&")
|
|
170
170
|
end
|
|
171
171
|
|
|
172
|
-
def expdate(creditcard)
|
|
173
|
-
year = sprintf("%.4i", creditcard.year)
|
|
174
|
-
month = sprintf("%.2i", creditcard.month)
|
|
175
|
-
"#{month}#{year[2..3]}"
|
|
176
|
-
end
|
|
177
|
-
|
|
178
172
|
# Parse the response message
|
|
179
173
|
def parse(msg)
|
|
180
174
|
resp = {}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
begin
|
|
2
|
-
require "vindicia-api"
|
|
3
|
-
rescue LoadError
|
|
4
|
-
raise "Could not load the vindicia-api gem. Use `gem install vindicia-api` to install it."
|
|
5
|
-
end
|
|
6
|
-
|
|
7
1
|
require 'i18n/core_ext/string/interpolate'
|
|
8
2
|
|
|
9
3
|
module ActiveMerchant #:nodoc:
|
|
@@ -46,24 +40,9 @@ module ActiveMerchant #:nodoc:
|
|
|
46
40
|
# * <tt>:cvn_success</tt> -- Array of valid CVN Check return values - defaults to [M, P] (OPTIONAL)
|
|
47
41
|
# * <tt>:avs_success</tt> -- Array of valid AVS Check return values - defaults to [X, Y, A, W, Z] (OPTIONAL)
|
|
48
42
|
def initialize(options = {})
|
|
49
|
-
requires!(options, :login, :password)
|
|
43
|
+
requires!(options, :login, :password, :account_id)
|
|
50
44
|
super
|
|
51
45
|
|
|
52
|
-
config = lambda do |config|
|
|
53
|
-
config.login = options[:login]
|
|
54
|
-
config.password = options[:password]
|
|
55
|
-
config.api_version = options[:api_version] || "3.6"
|
|
56
|
-
config.endpoint = test? ? self.test_url : self.live_url
|
|
57
|
-
config.namespace = "http://soap.vindicia.com"
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
if Vindicia.config.is_configured?
|
|
61
|
-
config.call(Vindicia.config)
|
|
62
|
-
else
|
|
63
|
-
Vindicia.configure(&config)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
requires!(options, :account_id)
|
|
67
46
|
@account_id = options[:account_id]
|
|
68
47
|
|
|
69
48
|
@transaction_prefix = options[:transaction_prefix] || "X"
|
|
@@ -121,9 +100,9 @@ module ActiveMerchant #:nodoc:
|
|
|
121
100
|
# * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
|
|
122
101
|
# * <tt>identification</tt> -- The authorization returned from the previous authorize request.
|
|
123
102
|
def capture(money, identification, options = {})
|
|
124
|
-
response = post(
|
|
125
|
-
:
|
|
126
|
-
|
|
103
|
+
response = post(:capture) do |xml|
|
|
104
|
+
add_hash(xml, transactions: [{ merchantTransactionId: identification }])
|
|
105
|
+
end
|
|
127
106
|
|
|
128
107
|
if response[:return][:returnCode] != '200' || response[:qtyFail].to_i > 0
|
|
129
108
|
return fail(response)
|
|
@@ -139,13 +118,13 @@ module ActiveMerchant #:nodoc:
|
|
|
139
118
|
# * <tt>identification</tt> - The authorization returned from the previous authorize request.
|
|
140
119
|
# * <tt>options</tt> - Extra options (currently only :ip used)
|
|
141
120
|
def void(identification, options = {})
|
|
142
|
-
response = post(
|
|
143
|
-
:
|
|
144
|
-
:
|
|
145
|
-
:
|
|
146
|
-
:
|
|
147
|
-
}]
|
|
148
|
-
|
|
121
|
+
response = post(:cancel) do |xml|
|
|
122
|
+
add_hash(xml, transactions: [{
|
|
123
|
+
account: {merchantAccountId: @account_id},
|
|
124
|
+
merchantTransactionId: identification,
|
|
125
|
+
sourceIp: options[:ip]
|
|
126
|
+
}])
|
|
127
|
+
end
|
|
149
128
|
|
|
150
129
|
if response[:return][:returnCode] == '200' && response[:qtyFail].to_i == 0
|
|
151
130
|
success(response, identification)
|
|
@@ -167,6 +146,8 @@ module ActiveMerchant #:nodoc:
|
|
|
167
146
|
# * <tt>:product_sku</tt> -- The subscription product's sku
|
|
168
147
|
# * <tt>:autobill_prefix</tt> -- Prefix to order id for subscriptions - defaults to 'A' (OPTIONAL)
|
|
169
148
|
def recurring(money, creditcard, options={})
|
|
149
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
150
|
+
|
|
170
151
|
options[:recurring] = true
|
|
171
152
|
@autobill_prefix = options[:autobill_prefix] || "A"
|
|
172
153
|
|
|
@@ -193,10 +174,56 @@ module ActiveMerchant #:nodoc:
|
|
|
193
174
|
end
|
|
194
175
|
end
|
|
195
176
|
|
|
196
|
-
|
|
177
|
+
private
|
|
178
|
+
|
|
179
|
+
def add_hash(xml, hash)
|
|
180
|
+
hash.each do |k,v|
|
|
181
|
+
add_element(xml, k, v)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def add_array(xml, elem, val)
|
|
186
|
+
val.each do |v|
|
|
187
|
+
add_element(xml, elem, v)
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def add_element(xml, elem, val)
|
|
192
|
+
if val.is_a?(Hash)
|
|
193
|
+
xml.tag!(elem.to_s.camelize(:lower)) do |env|
|
|
194
|
+
add_hash(env, val)
|
|
195
|
+
end
|
|
196
|
+
elsif val.is_a?(Array)
|
|
197
|
+
add_array(xml, elem, val)
|
|
198
|
+
else
|
|
199
|
+
xml.tag!(elem.to_s.camelize(:lower), val.to_s)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def post(action, kind="Transaction")
|
|
204
|
+
xml = Builder::XmlMarkup.new
|
|
205
|
+
xml.instruct!(:xml, :encoding => "UTF-8")
|
|
206
|
+
xml.env :Envelope,
|
|
207
|
+
"xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
|
|
208
|
+
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
|
209
|
+
"xmlns:tns" => "http://soap.vindicia.com/v3_6/#{kind}",
|
|
210
|
+
"xmlns:env" => "http://schemas.xmlsoap.org/soap/envelope/" do
|
|
211
|
+
|
|
212
|
+
xml.env :Body do
|
|
213
|
+
xml.tns action.to_sym do
|
|
214
|
+
xml.auth do
|
|
215
|
+
xml.tag! :login, @options[:login]
|
|
216
|
+
xml.tag! :password, @options[:password]
|
|
217
|
+
xml.tag! :version, "3.6"
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
yield(xml)
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
197
224
|
|
|
198
|
-
|
|
199
|
-
parse(ssl_post(
|
|
225
|
+
url = (test? ? self.test_url : self.live_url)
|
|
226
|
+
parse(ssl_post(url, xml.target!, "Content-Type" => "text/xml"))
|
|
200
227
|
end
|
|
201
228
|
|
|
202
229
|
def parse(response)
|
|
@@ -240,10 +267,9 @@ module ActiveMerchant #:nodoc:
|
|
|
240
267
|
add_customer_data(parameters, options)
|
|
241
268
|
add_payment_source(parameters, creditcard, options)
|
|
242
269
|
|
|
243
|
-
post(
|
|
244
|
-
:
|
|
245
|
-
|
|
246
|
-
}))
|
|
270
|
+
post(:auth) do |xml|
|
|
271
|
+
add_hash(xml, transaction: parameters, minChargebackProbability: @min_chargeback_probability)
|
|
272
|
+
end
|
|
247
273
|
end
|
|
248
274
|
|
|
249
275
|
def add_account_data(parameters, options)
|
|
@@ -282,11 +308,9 @@ module ActiveMerchant #:nodoc:
|
|
|
282
308
|
add_account_data(parameters, options)
|
|
283
309
|
add_subscription_information(parameters, options)
|
|
284
310
|
|
|
285
|
-
post(
|
|
286
|
-
:
|
|
287
|
-
|
|
288
|
-
:minChargebackProbability => 100
|
|
289
|
-
}))
|
|
311
|
+
post(:update, "AutoBill") do |xml|
|
|
312
|
+
add_hash(xml, autobill: parameters, validatePaymentMethod: false, minChargebackProbability: 100)
|
|
313
|
+
end
|
|
290
314
|
end
|
|
291
315
|
|
|
292
316
|
def check_subscription(vindicia_transaction)
|
|
@@ -71,18 +71,10 @@ module ActiveMerchant #:nodoc:
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
def headers(options = {})
|
|
74
|
-
@@ua ||= JSON.dump({
|
|
75
|
-
:bindings_version => ActiveMerchant::VERSION,
|
|
76
|
-
:lang => 'ruby',
|
|
77
|
-
:lang_version => "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})",
|
|
78
|
-
:platform => RUBY_PLATFORM,
|
|
79
|
-
:publisher => 'active_merchant'
|
|
80
|
-
})
|
|
81
|
-
|
|
82
74
|
{
|
|
83
75
|
"Authorization" => "Basic " + Base64.encode64(@api_key.to_s + ":").strip,
|
|
84
76
|
"User-Agent" => "Webpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
|
|
85
|
-
"X-Webpay-Client-User-Agent" =>
|
|
77
|
+
"X-Webpay-Client-User-Agent" => user_agent,
|
|
86
78
|
"X-Webpay-Client-User-Metadata" => {:ip => options[:ip]}.to_json
|
|
87
79
|
}
|
|
88
80
|
end
|
|
@@ -44,8 +44,16 @@ module ActiveMerchant #:nodoc:
|
|
|
44
44
|
super
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
# Authorization - the second parameter may be a CreditCard or
|
|
48
|
+
# a String which represents a GuWID reference to an earlier
|
|
49
|
+
# transaction. If a GuWID is given, rather than a CreditCard,
|
|
50
|
+
# then then the :recurring option will be forced to "Repeated"
|
|
51
|
+
def authorize(money, payment_method, options = {})
|
|
52
|
+
if payment_method.respond_to?(:number)
|
|
53
|
+
options[:credit_card] = payment_method
|
|
54
|
+
else
|
|
55
|
+
options[:preauthorization] = payment_method
|
|
56
|
+
end
|
|
49
57
|
commit(:preauthorization, money, options)
|
|
50
58
|
end
|
|
51
59
|
|
|
@@ -54,8 +62,16 @@ module ActiveMerchant #:nodoc:
|
|
|
54
62
|
commit(:capture, money, options)
|
|
55
63
|
end
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
# Purchase - the second parameter may be a CreditCard or
|
|
66
|
+
# a String which represents a GuWID reference to an earlier
|
|
67
|
+
# transaction. If a GuWID is given, rather than a CreditCard,
|
|
68
|
+
# then then the :recurring option will be forced to "Repeated"
|
|
69
|
+
def purchase(money, payment_method, options = {})
|
|
70
|
+
if payment_method.respond_to?(:number)
|
|
71
|
+
options[:credit_card] = payment_method
|
|
72
|
+
else
|
|
73
|
+
options[:preauthorization] = payment_method
|
|
74
|
+
end
|
|
59
75
|
commit(:purchase, money, options)
|
|
60
76
|
end
|
|
61
77
|
|
|
@@ -69,6 +85,46 @@ module ActiveMerchant #:nodoc:
|
|
|
69
85
|
commit(:bookback, money, options)
|
|
70
86
|
end
|
|
71
87
|
|
|
88
|
+
# Store card - Wirecard supports the notion of "Recurring
|
|
89
|
+
# Transactions" by allowing the merchant to provide a reference
|
|
90
|
+
# to an earlier transaction (the GuWID) rather than a credit
|
|
91
|
+
# card. A reusable reference (GuWID) can be obtained by sending
|
|
92
|
+
# a purchase or authorization transaction with the element
|
|
93
|
+
# "RECURRING_TRANSACTION/Type" set to "Initial". Subsequent
|
|
94
|
+
# transactions can then use the GuWID in place of a credit
|
|
95
|
+
# card by setting "RECURRING_TRANSACTION/Type" to "Repeated".
|
|
96
|
+
#
|
|
97
|
+
# This implementation of card store utilizes a Wirecard
|
|
98
|
+
# "Authorization Check" (a Preauthorization that is automatically
|
|
99
|
+
# reversed). It defaults to a check amount of "100" (i.e.
|
|
100
|
+
# $1.00) but this can be overriden (see below).
|
|
101
|
+
#
|
|
102
|
+
# IMPORTANT: In order to reuse the stored reference, the
|
|
103
|
+
# +authorization+ from the response should be saved by
|
|
104
|
+
# your application code.
|
|
105
|
+
#
|
|
106
|
+
# ==== Options specific to +store+
|
|
107
|
+
#
|
|
108
|
+
# * <tt>:amount</tt> -- The amount, in cents, that should be
|
|
109
|
+
# "validated" by the Authorization Check. This amount will
|
|
110
|
+
# be reserved and then reversed. Default is 100.
|
|
111
|
+
#
|
|
112
|
+
# Note: This is not the only way to achieve a card store
|
|
113
|
+
# operation at Wirecard. Any +purchase+ or +authorize+
|
|
114
|
+
# can be sent with +options[:recurring] = 'Initial'+ to make
|
|
115
|
+
# the returned authorization/GuWID usable in later transactions
|
|
116
|
+
# with +options[:recurring] = 'Repeated'+.
|
|
117
|
+
def store(creditcard, options = {})
|
|
118
|
+
options[:credit_card] = creditcard
|
|
119
|
+
options[:recurring] = 'Initial'
|
|
120
|
+
money = options.delete(:amount) || 100
|
|
121
|
+
# Amex does not support authorization_check
|
|
122
|
+
if creditcard.brand == 'american_express'
|
|
123
|
+
commit(:preauthorization, money, options)
|
|
124
|
+
else
|
|
125
|
+
commit(:authorization_check, money, options)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
72
128
|
|
|
73
129
|
private
|
|
74
130
|
def clean_description(description)
|
|
@@ -90,6 +146,13 @@ module ActiveMerchant #:nodoc:
|
|
|
90
146
|
options[:billing_address][:email] = options[:email] if options[:email]
|
|
91
147
|
end
|
|
92
148
|
|
|
149
|
+
# If a GuWID (string-based reference) is passed rather than a
|
|
150
|
+
# credit card, then the :recurring type needs to be forced to
|
|
151
|
+
# "Repeated"
|
|
152
|
+
def setup_recurring_flag(options)
|
|
153
|
+
options[:recurring] = 'Repeated' if options[:preauthorization].present?
|
|
154
|
+
end
|
|
155
|
+
|
|
93
156
|
# Contact WireCard, make the XML request, and parse the
|
|
94
157
|
# reply into a Response object
|
|
95
158
|
def commit(action, money, options)
|
|
@@ -107,8 +170,8 @@ module ActiveMerchant #:nodoc:
|
|
|
107
170
|
Response.new(success, message, response,
|
|
108
171
|
:test => test?,
|
|
109
172
|
:authorization => authorization,
|
|
110
|
-
:avs_result => { :code => response
|
|
111
|
-
:cvv_result => response[:
|
|
173
|
+
:avs_result => { :code => avs_code(response, options) },
|
|
174
|
+
:cvv_result => response[:CVCResponseCode]
|
|
112
175
|
)
|
|
113
176
|
rescue ResponseError => e
|
|
114
177
|
if e.response.code == "401"
|
|
@@ -146,10 +209,18 @@ module ActiveMerchant #:nodoc:
|
|
|
146
209
|
xml.tag! 'FunctionID', clean_description(options[:description])
|
|
147
210
|
xml.tag! 'CC_TRANSACTION' do
|
|
148
211
|
xml.tag! 'TransactionID', options[:order_id]
|
|
212
|
+
xml.tag! 'CommerceType', options[:commerce_type] if options[:commerce_type]
|
|
149
213
|
case options[:action]
|
|
150
|
-
when :preauthorization, :purchase
|
|
214
|
+
when :preauthorization, :purchase, :authorization_check
|
|
215
|
+
setup_recurring_flag(options)
|
|
151
216
|
add_invoice(xml, money, options)
|
|
152
|
-
|
|
217
|
+
|
|
218
|
+
if options[:credit_card]
|
|
219
|
+
add_creditcard(xml, options[:credit_card])
|
|
220
|
+
else
|
|
221
|
+
xml.tag! 'GuWID', options[:preauthorization]
|
|
222
|
+
end
|
|
223
|
+
|
|
153
224
|
add_address(xml, options[:billing_address])
|
|
154
225
|
when :capture, :bookback
|
|
155
226
|
xml.tag! 'GuWID', options[:preauthorization]
|
|
@@ -227,7 +298,7 @@ module ActiveMerchant #:nodoc:
|
|
|
227
298
|
if root = REXML::XPath.first(xml, "#{basepath}/W_JOB")
|
|
228
299
|
parse_response(response, root)
|
|
229
300
|
elsif root = REXML::XPath.first(xml, "//ERROR")
|
|
230
|
-
|
|
301
|
+
parse_error_only_response(response, root)
|
|
231
302
|
else
|
|
232
303
|
response[:Message] = "No valid XML response message received. \
|
|
233
304
|
Propably wrong credentials supplied with HTTP header."
|
|
@@ -236,6 +307,12 @@ module ActiveMerchant #:nodoc:
|
|
|
236
307
|
response
|
|
237
308
|
end
|
|
238
309
|
|
|
310
|
+
def parse_error_only_response(response, root)
|
|
311
|
+
error_code = REXML::XPath.first(root, "Number")
|
|
312
|
+
response[:ErrorCode] = error_code.text if error_code
|
|
313
|
+
response[:Message] = parse_error(root)
|
|
314
|
+
end
|
|
315
|
+
|
|
239
316
|
# Parse the <ProcessingStatus> Element which contains all important information
|
|
240
317
|
def parse_response(response, root)
|
|
241
318
|
status = nil
|
|
@@ -253,7 +330,14 @@ module ActiveMerchant #:nodoc:
|
|
|
253
330
|
end
|
|
254
331
|
|
|
255
332
|
status.elements.to_a.each do |node|
|
|
256
|
-
|
|
333
|
+
if (node.elements.size == 0)
|
|
334
|
+
response[node.name.to_sym] = (node.text || '').strip
|
|
335
|
+
else
|
|
336
|
+
node.elements.each do |childnode|
|
|
337
|
+
name = "#{node.name}_#{childnode.name}"
|
|
338
|
+
response[name.to_sym] = (childnode.text || '').strip
|
|
339
|
+
end
|
|
340
|
+
end
|
|
257
341
|
end
|
|
258
342
|
|
|
259
343
|
error_code = REXML::XPath.first(status, "ERROR/Number")
|
|
@@ -292,7 +376,7 @@ module ActiveMerchant #:nodoc:
|
|
|
292
376
|
# Convert all messages to a single string
|
|
293
377
|
string = ''
|
|
294
378
|
errors.each do |error|
|
|
295
|
-
string << error[:Message]
|
|
379
|
+
string << error[:Message] if error[:Message]
|
|
296
380
|
error[:Advice].each_with_index do |advice, index|
|
|
297
381
|
string << ' (' if index == 0
|
|
298
382
|
string << "#{index+1}. #{advice}"
|
|
@@ -303,6 +387,28 @@ module ActiveMerchant #:nodoc:
|
|
|
303
387
|
string
|
|
304
388
|
end
|
|
305
389
|
|
|
390
|
+
# Amex have different AVS response codes
|
|
391
|
+
AMEX_TRANSLATED_AVS_CODES = {
|
|
392
|
+
"A" => "B", # CSC and Address Matched
|
|
393
|
+
"F" => "D", # All Data Matched
|
|
394
|
+
"N" => "I", # CSC Match
|
|
395
|
+
"U" => "U", # Data Not Checked
|
|
396
|
+
"Y" => "D", # All Data Matched
|
|
397
|
+
"Z" => "P", # CSC and Postcode Matched
|
|
398
|
+
"F" => "D" # Street address and zip code match
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
# Amex have different AVS response codes to visa etc
|
|
402
|
+
def avs_code(response, options)
|
|
403
|
+
if response.has_key?(:AVS_ProviderResultCode)
|
|
404
|
+
if options[:credit_card].present? && ActiveMerchant::Billing::CreditCard.brand?(options[:credit_card].number) == "american_express"
|
|
405
|
+
AMEX_TRANSLATED_AVS_CODES[response[:AVS_ProviderResultCode]]
|
|
406
|
+
else
|
|
407
|
+
response[:AVS_ProviderResultCode]
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
end
|
|
411
|
+
|
|
306
412
|
# Encode login and password in Base64 to supply as HTTP header
|
|
307
413
|
# (for http basic authentication)
|
|
308
414
|
def encoded_credentials
|
|
@@ -7,9 +7,9 @@ module ActiveMerchant #:nodoc:
|
|
|
7
7
|
self.default_currency = 'GBP'
|
|
8
8
|
self.money_format = :cents
|
|
9
9
|
self.supported_countries = %w(HK US GB AU AD BE CH CY CZ DE DK ES FI FR GI GR HU IE IL IT LI LU MC MT NL NO NZ PL PT SE SG SI SM TR UM VA)
|
|
10
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :laser]
|
|
10
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :laser, :switch]
|
|
11
11
|
self.homepage_url = 'http://www.worldpay.com/'
|
|
12
|
-
self.display_name = '
|
|
12
|
+
self.display_name = 'Worldpay'
|
|
13
13
|
|
|
14
14
|
CARD_CODES = {
|
|
15
15
|
'visa' => 'VISA-SSL',
|
|
@@ -19,7 +19,8 @@ module ActiveMerchant #:nodoc:
|
|
|
19
19
|
'jcb' => 'JCB-SSL',
|
|
20
20
|
'maestro' => 'MAESTRO-SSL',
|
|
21
21
|
'laser' => 'LASER-SSL',
|
|
22
|
-
'diners_club' => 'DINERS-SSL'
|
|
22
|
+
'diners_club' => 'DINERS-SSL',
|
|
23
|
+
'switch' => 'MAESTRO-SSL'
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
def initialize(options = {})
|
|
@@ -88,8 +89,8 @@ module ActiveMerchant #:nodoc:
|
|
|
88
89
|
|
|
89
90
|
def build_request
|
|
90
91
|
xml = Builder::XmlMarkup.new :indent => 2
|
|
91
|
-
xml.instruct! :xml, :encoding => '
|
|
92
|
-
xml.declare! :DOCTYPE, :paymentService, :PUBLIC, "-//WorldPay//DTD WorldPay PaymentService v1//EN", "http://dtd.
|
|
92
|
+
xml.instruct! :xml, :encoding => 'UTF-8'
|
|
93
|
+
xml.declare! :DOCTYPE, :paymentService, :PUBLIC, "-//WorldPay//DTD WorldPay PaymentService v1//EN", "http://dtd.worldpay.com/paymentService_v1.dtd"
|
|
93
94
|
xml.tag! 'paymentService', 'version' => "1.4", 'merchantCode' => @options[:login] do
|
|
94
95
|
yield xml
|
|
95
96
|
end
|
|
@@ -126,6 +127,7 @@ module ActiveMerchant #:nodoc:
|
|
|
126
127
|
end
|
|
127
128
|
end
|
|
128
129
|
add_payment_method(xml, money, payment_method, options)
|
|
130
|
+
add_email(xml, options)
|
|
129
131
|
end
|
|
130
132
|
end
|
|
131
133
|
end
|
|
@@ -174,8 +176,14 @@ module ActiveMerchant #:nodoc:
|
|
|
174
176
|
|
|
175
177
|
def add_payment_method(xml, amount, payment_method, options)
|
|
176
178
|
if payment_method.is_a?(String)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
if options[:merchant_code]
|
|
180
|
+
xml.tag! 'payAsOrder', 'orderCode' => payment_method, 'merchantCode' => options[:merchant_code] do
|
|
181
|
+
add_amount(xml, amount, options)
|
|
182
|
+
end
|
|
183
|
+
else
|
|
184
|
+
xml.tag! 'payAsOrder', 'orderCode' => payment_method do
|
|
185
|
+
add_amount(xml, amount, options)
|
|
186
|
+
end
|
|
179
187
|
end
|
|
180
188
|
else
|
|
181
189
|
xml.tag! 'paymentDetails' do
|
|
@@ -188,38 +196,58 @@ module ActiveMerchant #:nodoc:
|
|
|
188
196
|
xml.tag! 'cardHolderName', payment_method.name
|
|
189
197
|
xml.tag! 'cvc', payment_method.verification_value
|
|
190
198
|
|
|
191
|
-
add_address(xml,
|
|
199
|
+
add_address(xml, (options[:billing_address] || options[:address]))
|
|
200
|
+
end
|
|
201
|
+
if options[:ip]
|
|
202
|
+
xml.tag! 'session', 'shopperIPAddress' => options[:ip]
|
|
192
203
|
end
|
|
193
204
|
end
|
|
194
205
|
end
|
|
195
206
|
end
|
|
196
207
|
|
|
197
|
-
def
|
|
198
|
-
return
|
|
208
|
+
def add_email(xml, options)
|
|
209
|
+
return unless options[:email]
|
|
210
|
+
xml.tag! 'shopper' do
|
|
211
|
+
xml.tag! 'shopperEmailAddress', options[:email]
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def add_address(xml, address)
|
|
216
|
+
address = address_with_defaults(address)
|
|
199
217
|
|
|
200
|
-
xml.tag!
|
|
218
|
+
xml.tag! 'cardAddress' do
|
|
201
219
|
xml.tag! 'address' do
|
|
202
220
|
if m = /^\s*([^\s]+)\s+(.+)$/.match(address[:name])
|
|
203
221
|
xml.tag! 'firstName', m[1]
|
|
204
222
|
xml.tag! 'lastName', m[2]
|
|
205
223
|
end
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
end
|
|
212
|
-
xml.tag! 'houseName', address[:address2] if address[:address2]
|
|
213
|
-
xml.tag! 'houseNumber', house_number if house_number.present?
|
|
214
|
-
xml.tag! 'postalCode', (address[:zip].present? ? address[:zip] : "0000")
|
|
215
|
-
xml.tag! 'city', address[:city] if address[:city]
|
|
216
|
-
xml.tag! 'state', (address[:state].present? ? address[:state] : 'N/A')
|
|
224
|
+
xml.tag! 'address1', address[:address1]
|
|
225
|
+
xml.tag! 'address2', address[:address2] if address[:address2]
|
|
226
|
+
xml.tag! 'postalCode', address[:zip]
|
|
227
|
+
xml.tag! 'city', address[:city]
|
|
228
|
+
xml.tag! 'state', address[:state]
|
|
217
229
|
xml.tag! 'countryCode', address[:country]
|
|
218
230
|
xml.tag! 'telephoneNumber', address[:phone] if address[:phone]
|
|
219
231
|
end
|
|
220
232
|
end
|
|
221
233
|
end
|
|
222
234
|
|
|
235
|
+
def address_with_defaults(address)
|
|
236
|
+
address ||= {}
|
|
237
|
+
address.delete_if { |_, v| v.blank? }
|
|
238
|
+
address.reverse_merge!(default_address)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
def default_address
|
|
242
|
+
{
|
|
243
|
+
address1: 'N/A',
|
|
244
|
+
zip: '0000',
|
|
245
|
+
city: 'N/A',
|
|
246
|
+
state: 'N/A',
|
|
247
|
+
country: 'US'
|
|
248
|
+
}
|
|
249
|
+
end
|
|
250
|
+
|
|
223
251
|
def parse(action, xml)
|
|
224
252
|
parse_element({:action => action}, REXML::Document.new(xml))
|
|
225
253
|
end
|