activemerchant 1.43.3 → 1.44.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -557,6 +557,7 @@ module ActiveMerchant #:nodoc:
|
|
557
557
|
add_check(xml, payment_method_or_reference)
|
558
558
|
else
|
559
559
|
add_address(xml, payment_method_or_reference, options[:billing_address], options)
|
560
|
+
add_address(xml, payment_method_or_reference, options[:shipping_address], options, true)
|
560
561
|
add_purchase_data(xml, money, true, options)
|
561
562
|
add_creditcard(xml, payment_method_or_reference)
|
562
563
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/core_ext/string/access"
|
2
|
+
|
1
3
|
module ActiveMerchant
|
2
4
|
module Billing
|
3
5
|
class DataCashGateway < Gateway
|
@@ -138,7 +140,7 @@ module ActiveMerchant
|
|
138
140
|
# * <tt>:address</tt>:: billing address for card
|
139
141
|
def credit(money, reference_or_credit_card, options = {})
|
140
142
|
if reference_or_credit_card.is_a?(String)
|
141
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
143
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
142
144
|
refund(money, reference_or_credit_card)
|
143
145
|
else
|
144
146
|
request = build_refund_request(money, reference_or_credit_card, options)
|
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
|
|
36
36
|
|
37
37
|
def credit(money, identification_or_credit_card, options = {})
|
38
38
|
if identification_or_credit_card.is_a?(String)
|
39
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
39
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
40
40
|
# Perform authorization reversal
|
41
41
|
refund(money, identification_or_credit_card, options)
|
42
42
|
else
|
@@ -54,7 +54,7 @@ module ActiveMerchant #:nodoc:
|
|
54
54
|
|
55
55
|
def void(identification, options = {})
|
56
56
|
requires!(options, :order_id)
|
57
|
-
original_transaction_id,
|
57
|
+
original_transaction_id, _ = identification.split(";")
|
58
58
|
commit(:void_transaction, {:reference_number => format_reference_number(options[:order_id]), :transaction_id => original_transaction_id})
|
59
59
|
end
|
60
60
|
|
@@ -81,7 +81,7 @@ module ActiveMerchant #:nodoc:
|
|
81
81
|
|
82
82
|
requires!(options, :order_id)
|
83
83
|
|
84
|
-
|
84
|
+
{
|
85
85
|
:reference_number => format_reference_number(options[:order_id]),
|
86
86
|
:transaction_amount => amount(money),
|
87
87
|
:original_transaction_amount => original_transaction_amount,
|
@@ -197,17 +197,6 @@ module ActiveMerchant #:nodoc:
|
|
197
197
|
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
198
198
|
end
|
199
199
|
|
200
|
-
# Make a ruby type out of the response string
|
201
|
-
def normalize(field)
|
202
|
-
case field
|
203
|
-
when "true" then true
|
204
|
-
when "false" then false
|
205
|
-
when "" then nil
|
206
|
-
when "null" then nil
|
207
|
-
else field
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
200
|
def actions
|
212
201
|
ACTIONS
|
213
202
|
end
|
@@ -47,7 +47,9 @@ module ActiveMerchant #:nodoc:
|
|
47
47
|
:refund => 'CCRETURN',
|
48
48
|
:authorize => 'CCAUTHONLY',
|
49
49
|
:capture => 'CCFORCE',
|
50
|
-
:void => '
|
50
|
+
:void => 'CCDELETE',
|
51
|
+
:store => 'CCGETTOKEN',
|
52
|
+
:update => 'CCUPDATETOKEN',
|
51
53
|
}
|
52
54
|
|
53
55
|
# Initialize the Gateway
|
@@ -67,11 +69,15 @@ module ActiveMerchant #:nodoc:
|
|
67
69
|
end
|
68
70
|
|
69
71
|
# Make a purchase
|
70
|
-
def purchase(money,
|
72
|
+
def purchase(money, payment_method, options = {})
|
71
73
|
form = {}
|
72
74
|
add_salestax(form, options)
|
73
75
|
add_invoice(form, options)
|
74
|
-
|
76
|
+
if payment_method.is_a?(String)
|
77
|
+
add_token(form, payment_method)
|
78
|
+
else
|
79
|
+
add_creditcard(form, payment_method)
|
80
|
+
end
|
75
81
|
add_address(form, options)
|
76
82
|
add_customer_data(form, options)
|
77
83
|
add_test_mode(form, options)
|
@@ -166,8 +172,36 @@ module ActiveMerchant #:nodoc:
|
|
166
172
|
commit(:credit, money, form)
|
167
173
|
end
|
168
174
|
|
175
|
+
def verify(credit_card, options = {})
|
176
|
+
MultiResponse.run(:use_first_response) do |r|
|
177
|
+
r.process { authorize(100, credit_card, options) }
|
178
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def store(creditcard, options = {})
|
183
|
+
form = {}
|
184
|
+
add_creditcard(form, creditcard)
|
185
|
+
add_address(form, options)
|
186
|
+
add_customer_data(form, options)
|
187
|
+
add_test_mode(form, options)
|
188
|
+
add_verification(form, options)
|
189
|
+
form[:add_token] = 'Y'
|
190
|
+
commit(:store, nil, form)
|
191
|
+
end
|
192
|
+
|
193
|
+
def update(token, creditcard, options = {})
|
194
|
+
form = {}
|
195
|
+
add_token(form, token)
|
196
|
+
add_creditcard(form, creditcard)
|
197
|
+
add_address(form, options)
|
198
|
+
add_customer_data(form, options)
|
199
|
+
add_test_mode(form, options)
|
200
|
+
commit(:update, nil, form)
|
201
|
+
end
|
169
202
|
|
170
203
|
private
|
204
|
+
|
171
205
|
def add_invoice(form,options)
|
172
206
|
form[:invoice_number] = (options[:order_id] || options[:invoice]).to_s.slice(0, 10)
|
173
207
|
form[:description] = options[:description].to_s.slice(0, 255)
|
@@ -197,6 +231,10 @@ module ActiveMerchant #:nodoc:
|
|
197
231
|
form[:last_name] = creditcard.last_name.to_s.slice(0, 30)
|
198
232
|
end
|
199
233
|
|
234
|
+
def add_token(form, token)
|
235
|
+
form[:token] = token
|
236
|
+
end
|
237
|
+
|
200
238
|
def add_verification_value(form, creditcard)
|
201
239
|
form[:cvv2cvc2] = creditcard.verification_value
|
202
240
|
form[:cvv2cvc2_indicator] = '1'
|
@@ -211,12 +249,6 @@ module ActiveMerchant #:nodoc:
|
|
211
249
|
form[:salestax] = options[:tax] if options[:tax].present?
|
212
250
|
end
|
213
251
|
|
214
|
-
def expdate(creditcard)
|
215
|
-
year = sprintf("%.4i", creditcard.year)
|
216
|
-
month = sprintf("%.2i", creditcard.month)
|
217
|
-
"#{month}#{year[2..3]}"
|
218
|
-
end
|
219
|
-
|
220
252
|
def add_address(form,options)
|
221
253
|
billing_address = options[:billing_address] || options[:address]
|
222
254
|
|
@@ -245,6 +277,10 @@ module ActiveMerchant #:nodoc:
|
|
245
277
|
end
|
246
278
|
end
|
247
279
|
|
280
|
+
def add_verification(form, options)
|
281
|
+
form[:verify] = 'Y' if options[:verify]
|
282
|
+
end
|
283
|
+
|
248
284
|
def parse_first_and_last_name(value)
|
249
285
|
name = value.to_s.split(' ')
|
250
286
|
|
@@ -106,7 +106,7 @@ module ActiveMerchant #:nodoc:
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def credit(money, identification, options = {})
|
109
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
109
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
110
110
|
refund(money, identification, options)
|
111
111
|
end
|
112
112
|
|
@@ -268,7 +268,7 @@ module ActiveMerchant #:nodoc:
|
|
268
268
|
|
269
269
|
# Limited to 20 digits max
|
270
270
|
def format_order_number(number)
|
271
|
-
number.to_s.gsub(/[^\
|
271
|
+
number.to_s.gsub(/[^\w]/, '').rjust(4, "0")[0...20]
|
272
272
|
end
|
273
273
|
end
|
274
274
|
end
|
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
|
|
8
8
|
self.live_url = 'https://www.eway.com.au'
|
9
9
|
|
10
10
|
self.money_format = :cents
|
11
|
-
self.supported_countries = ['AU'
|
11
|
+
self.supported_countries = ['AU']
|
12
12
|
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
13
13
|
self.homepage_url = 'http://www.eway.com.au/'
|
14
14
|
self.display_name = 'eWAY'
|
@@ -136,17 +136,6 @@ module ActiveMerchant #:nodoc:
|
|
136
136
|
MESSAGES[message[0,2]] || message
|
137
137
|
end
|
138
138
|
|
139
|
-
# Make a ruby type out of the response string
|
140
|
-
def normalize(field)
|
141
|
-
case field
|
142
|
-
when "true" then true
|
143
|
-
when "false" then false
|
144
|
-
when "" then nil
|
145
|
-
when "null" then nil
|
146
|
-
else field
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
139
|
def purchase_url(cvn)
|
151
140
|
suffix = test? ? 'xmltest/testpage.asp' : 'xmlpayment.asp'
|
152
141
|
gateway_part = cvn ? 'gateway_cvn' : 'gateway'
|
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
|
|
150
150
|
def parse(body)
|
151
151
|
reply = {}
|
152
152
|
xml = REXML::Document.new(body)
|
153
|
-
|
153
|
+
if root = REXML::XPath.first(xml, "//soap:Fault") then
|
154
154
|
reply=parse_fault(root)
|
155
155
|
else
|
156
156
|
if root = REXML::XPath.first(xml, '//ProcessPaymentResponse/ewayResponse') then
|
@@ -1,5 +1,4 @@
|
|
1
|
-
require
|
2
|
-
require "cgi"
|
1
|
+
require 'json'
|
3
2
|
|
4
3
|
module ActiveMerchant #:nodoc:
|
5
4
|
module Billing #:nodoc:
|
@@ -8,10 +7,10 @@ module ActiveMerchant #:nodoc:
|
|
8
7
|
self.live_url = "https://api.ewaypayments.com/"
|
9
8
|
|
10
9
|
self.money_format = :cents
|
11
|
-
self.supported_countries = [
|
10
|
+
self.supported_countries = ['AU', 'NZ', 'GB']
|
12
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
13
12
|
self.homepage_url = "http://www.eway.com.au/"
|
14
|
-
self.display_name = "eWAY Rapid 3.
|
13
|
+
self.display_name = "eWAY Rapid 3.1"
|
15
14
|
self.default_currency = "AUD"
|
16
15
|
|
17
16
|
def initialize(options = {})
|
@@ -19,203 +18,240 @@ module ActiveMerchant #:nodoc:
|
|
19
18
|
super
|
20
19
|
end
|
21
20
|
|
22
|
-
# Public: Run a purchase transaction.
|
23
|
-
# redirect as an API endpoint in order to conform to the standard
|
24
|
-
# ActiveMerchant #purchase API.
|
21
|
+
# Public: Run a purchase transaction.
|
25
22
|
#
|
26
|
-
# amount
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
23
|
+
# amount - The monetary amount of the transaction in cents.
|
24
|
+
# payment_method - The payment method or authorization token returned from store.
|
25
|
+
# options - A standard ActiveMerchant options hash:
|
26
|
+
# :transaction_type - One of: Purchase (default), MOTO
|
27
|
+
# or Recurring. For stored card payments (aka - TokenPayments),
|
28
|
+
# this must be either MOTO or Recurring.
|
29
|
+
# :order_id - A merchant-supplied identifier for the
|
30
|
+
# transaction (optional).
|
31
|
+
# :description - A merchant-supplied description of the
|
32
|
+
# transaction (optional).
|
33
|
+
# :currency - Three letter currency code for the
|
34
|
+
# transaction (default: "AUD")
|
35
|
+
# :billing_address - Standard ActiveMerchant address hash
|
36
|
+
# (optional).
|
37
|
+
# :shipping_address - Standard ActiveMerchant address hash
|
38
|
+
# (optional).
|
39
|
+
# :ip - The ip of the consumer initiating the
|
40
|
+
# transaction (optional).
|
41
|
+
# :application_id - A string identifying the application
|
42
|
+
# submitting the transaction
|
43
|
+
# (default: "https://github.com/Shopify/active_merchant")
|
43
44
|
#
|
44
|
-
# Returns an ActiveMerchant::Billing::Response object
|
45
|
+
# Returns an ActiveMerchant::Billing::Response object where authorization is the Transaction ID on success
|
45
46
|
def purchase(amount, payment_method, options={})
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
r.process{run_purchase(r.authorization, payment_method, r.params["formactionurl"])}
|
53
|
-
r.process{status(r.authorization)}
|
54
|
-
end
|
47
|
+
params = {}
|
48
|
+
add_metadata(params, options)
|
49
|
+
add_invoice(params, amount, options)
|
50
|
+
add_customer_data(params, options)
|
51
|
+
add_credit_card(params, payment_method, options)
|
52
|
+
commit(url_for('Transaction'), params)
|
55
53
|
end
|
56
54
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
# (optional).
|
74
|
-
# :ip - The ip of the consumer initiating the
|
75
|
-
# transaction (optional).
|
76
|
-
# :application_id - A string identifying the application
|
77
|
-
# submitting the transaction
|
78
|
-
# (default: "https://github.com/Shopify/active_merchant")
|
79
|
-
#
|
80
|
-
# Returns an EwayRapidResponse object, which conforms to the
|
81
|
-
# ActiveMerchant::Billing::Response API, but also exposes #form_url.
|
82
|
-
def setup_purchase(amount, options={})
|
83
|
-
requires!(options, :redirect_url)
|
84
|
-
request = build_xml_request("CreateAccessCodeRequest") do |doc|
|
85
|
-
add_metadata(doc, options)
|
86
|
-
add_invoice(doc, amount, options)
|
87
|
-
add_customer_data(doc, options)
|
88
|
-
end
|
55
|
+
def authorize(amount, payment_method, options={})
|
56
|
+
params = {}
|
57
|
+
add_metadata(params, options)
|
58
|
+
add_invoice(params, amount, options)
|
59
|
+
add_customer_data(params, options)
|
60
|
+
add_credit_card(params, payment_method, options)
|
61
|
+
commit(url_for('Authorisation'), params)
|
62
|
+
end
|
63
|
+
|
64
|
+
def capture(amount, identification, options = {})
|
65
|
+
params = {}
|
66
|
+
add_metadata(params, options)
|
67
|
+
add_invoice(params, amount, options)
|
68
|
+
add_reference(params, identification)
|
69
|
+
commit(url_for("CapturePayment"), params)
|
70
|
+
end
|
89
71
|
|
90
|
-
|
72
|
+
def void(identification, options = {})
|
73
|
+
params = {}
|
74
|
+
add_reference(params, identification)
|
75
|
+
commit(url_for("CancelAuthorisation"), params)
|
91
76
|
end
|
92
77
|
|
93
|
-
# Public:
|
78
|
+
# Public: Refund a transaction.
|
94
79
|
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
80
|
+
# amount - The monetary amount of the transaction in cents
|
81
|
+
# identification - The transaction id which is returned in the
|
82
|
+
# authorization of the successful purchase transaction
|
83
|
+
# options - A standard ActiveMerchant options hash:
|
84
|
+
# :order_id - A merchant-supplied identifier for the
|
85
|
+
# transaction (optional).
|
86
|
+
# :description - A merchant-supplied description of the
|
87
|
+
# transaction (optional).
|
88
|
+
# :currency - Three letter currency code for the
|
89
|
+
# transaction (default: "AUD")
|
90
|
+
# :billing_address - Standard ActiveMerchant address hash
|
91
|
+
# (optional).
|
92
|
+
# :shipping_address - Standard ActiveMerchant address hash
|
93
|
+
# (optional).
|
94
|
+
# :ip - The ip of the consumer initiating the
|
95
|
+
# transaction (optional).
|
96
|
+
# :application_id - A string identifying the application
|
97
|
+
# submitting the transaction
|
98
|
+
# (default: "https://github.com/Shopify/active_merchant")
|
98
99
|
#
|
99
|
-
# Returns an
|
100
|
-
def
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
100
|
+
# Returns an ActiveMerchant::Billing::Response object
|
101
|
+
def refund(amount, identification, options = {})
|
102
|
+
params = {}
|
103
|
+
add_metadata(params, options)
|
104
|
+
add_invoice(params, amount, options, "Refund")
|
105
|
+
add_reference(params["Refund"], identification)
|
106
|
+
add_customer_data(params, options)
|
107
|
+
commit(url_for("Transaction/#{identification}/Refund"), params)
|
105
108
|
end
|
106
109
|
|
107
110
|
# Public: Store card details and return a valid token
|
108
111
|
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
112
|
+
# payment_method - The payment method or nil if :customer_token is provided
|
113
|
+
# options - A supplemented ActiveMerchant options hash:
|
114
|
+
# :order_id - A merchant-supplied identifier for the
|
115
|
+
# transaction (optional).
|
116
|
+
# :description - A merchant-supplied description of the
|
117
|
+
# transaction (optional).
|
118
|
+
# :billing_address - Standard ActiveMerchant address hash
|
119
|
+
# (required).
|
120
|
+
# :ip - The ip of the consumer initiating the
|
121
|
+
# transaction (optional).
|
122
|
+
# :application_id - A string identifying the application
|
123
|
+
# submitting the transaction
|
124
|
+
# (default: "https://github.com/Shopify/active_merchant")
|
125
|
+
#
|
126
|
+
# Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
|
119
127
|
def store(payment_method, options = {})
|
120
128
|
requires!(options, :billing_address)
|
121
|
-
|
129
|
+
params = {}
|
130
|
+
add_metadata(params, options)
|
131
|
+
add_invoice(params, 0, options)
|
132
|
+
add_customer_data(params, options)
|
133
|
+
add_credit_card(params, payment_method, options)
|
134
|
+
params['Method'] = 'CreateTokenCustomer'
|
135
|
+
commit(url_for("Transaction"), params)
|
122
136
|
end
|
123
137
|
|
124
|
-
|
138
|
+
# Public: Update a customer's data
|
139
|
+
#
|
140
|
+
# customer_token - The customer token returned in the authorization of
|
141
|
+
# a successful store transaction.
|
142
|
+
# payment_method - The payment method or nil if :customer_token is provided
|
143
|
+
# options - A supplemented ActiveMerchant options hash:
|
144
|
+
# :order_id - A merchant-supplied identifier for the
|
145
|
+
# transaction (optional).
|
146
|
+
# :description - A merchant-supplied description of the
|
147
|
+
# transaction (optional).
|
148
|
+
# :billing_address - Standard ActiveMerchant address hash
|
149
|
+
# (optional).
|
150
|
+
# :ip - The ip of the consumer initiating the
|
151
|
+
# transaction (optional).
|
152
|
+
# :application_id - A string identifying the application
|
153
|
+
# submitting the transaction
|
154
|
+
# (default: "https://github.com/Shopify/active_merchant")
|
155
|
+
#
|
156
|
+
# Returns an ActiveMerchant::Billing::Response object where the authorization is the customer_token on success
|
157
|
+
def update(customer_token, payment_method, options = {})
|
158
|
+
params = {}
|
159
|
+
add_metadata(params, options)
|
160
|
+
add_invoice(params, 0, options)
|
161
|
+
add_customer_data(params, options)
|
162
|
+
add_credit_card(params, payment_method, options)
|
163
|
+
add_customer_token(params, customer_token)
|
164
|
+
params['Method'] = 'UpdateTokenCustomer'
|
165
|
+
commit(url_for("Transaction"), params)
|
166
|
+
end
|
125
167
|
|
126
|
-
|
127
|
-
post = {
|
128
|
-
"accesscode" => identification
|
129
|
-
}
|
130
|
-
add_credit_card(post, payment_method)
|
168
|
+
private
|
131
169
|
|
132
|
-
|
170
|
+
def add_metadata(params, options)
|
171
|
+
params['RedirectUrl'] = options[:redirect_url] || 'http://example.com'
|
172
|
+
params['CustomerIP'] = options[:ip] if options[:ip]
|
173
|
+
params['TransactionType'] = options[:transaction_type] || 'Purchase'
|
174
|
+
params['DeviceID'] = options[:application_id] || application_id
|
133
175
|
end
|
134
176
|
|
135
|
-
def
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
177
|
+
def add_invoice(params, money, options, key = "Payment")
|
178
|
+
currency_code = options[:currency] || currency(money)
|
179
|
+
params[key] = {
|
180
|
+
'TotalAmount' => localized_amount(money, currency_code),
|
181
|
+
'InvoiceReference' => truncate(options[:order_id]),
|
182
|
+
'InvoiceDescription' => truncate(options[:description], 64),
|
183
|
+
'CurrencyCode' => currency_code,
|
184
|
+
}
|
140
185
|
end
|
141
186
|
|
142
|
-
def
|
143
|
-
|
144
|
-
currency_code = options[:currency] || currency(money)
|
145
|
-
doc.TotalAmount localized_amount(money, currency_code)
|
146
|
-
doc.InvoiceReference options[:order_id]
|
147
|
-
doc.InvoiceDescription options[:description]
|
148
|
-
doc.CurrencyCode currency_code
|
149
|
-
end
|
187
|
+
def add_reference(params, reference)
|
188
|
+
params['TransactionID'] = reference
|
150
189
|
end
|
151
190
|
|
152
|
-
def add_customer_data(
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
add_address(doc, options[:shipping_address], {:skip_company => true})
|
158
|
-
end
|
191
|
+
def add_customer_data(params, options)
|
192
|
+
params['Customer'] ||= {}
|
193
|
+
add_address(params['Customer'], (options[:billing_address] || options[:address]), {:email => options[:email]})
|
194
|
+
params['ShippingAddress'] = {}
|
195
|
+
add_address(params['ShippingAddress'], options[:shipping_address], {:skip_company => true})
|
159
196
|
end
|
160
197
|
|
161
|
-
def add_address(
|
198
|
+
def add_address(params, address, options={})
|
162
199
|
return unless address
|
163
|
-
if name = address[:name]
|
164
|
-
parts = name.split(/\s+/)
|
165
|
-
doc.FirstName parts.shift if parts.size > 1
|
166
|
-
doc.LastName parts.join(" ")
|
167
|
-
end
|
168
|
-
doc.Title address[:title]
|
169
|
-
doc.CompanyName address[:company] unless options[:skip_company]
|
170
|
-
doc.Street1 address[:address1]
|
171
|
-
doc.Street2 address[:address2]
|
172
|
-
doc.City address[:city]
|
173
|
-
doc.State address[:state]
|
174
|
-
doc.PostalCode address[:zip]
|
175
|
-
doc.Country address[:country].to_s.downcase
|
176
|
-
doc.Phone address[:phone]
|
177
|
-
doc.Fax address[:fax]
|
178
|
-
doc.Email options[:email]
|
179
|
-
end
|
180
200
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
201
|
+
if address[:name]
|
202
|
+
parts = address[:name].split(/\s+/)
|
203
|
+
params['FirstName'] = parts.shift if parts.size > 1
|
204
|
+
params['LastName'] = parts.join(" ")
|
205
|
+
end
|
206
|
+
params['Title'] = address[:title]
|
207
|
+
params['CompanyName'] = address[:company] unless options[:skip_company]
|
208
|
+
params['Street1'] = truncate(address[:address1])
|
209
|
+
params['Street2'] = truncate(address[:address2])
|
210
|
+
params['City'] = truncate(address[:city])
|
211
|
+
params['State'] = address[:state]
|
212
|
+
params['PostalCode'] = address[:zip]
|
213
|
+
params['Country'] = address[:country].to_s.downcase
|
214
|
+
params['Phone'] = address[:phone]
|
215
|
+
params['Fax'] = address[:fax]
|
216
|
+
params['Email'] = options[:email]
|
187
217
|
end
|
188
218
|
|
189
|
-
def
|
190
|
-
|
191
|
-
|
192
|
-
|
219
|
+
def add_credit_card(params, credit_card, options)
|
220
|
+
return unless credit_card
|
221
|
+
params['Customer'] ||= {}
|
222
|
+
if credit_card.respond_to? :number
|
223
|
+
params['Method'] = 'ProcessPayment'
|
224
|
+
card_details = params['Customer']['CardDetails'] = {}
|
225
|
+
card_details['Name'] = truncate(credit_card.name)
|
226
|
+
card_details['Number'] = credit_card.number
|
227
|
+
card_details['ExpiryMonth'] = "%02d" % (credit_card.month || 0)
|
228
|
+
card_details['ExpiryYear'] = "%02d" % (credit_card.year || 0)
|
229
|
+
card_details['CVN'] = credit_card.verification_value
|
230
|
+
else
|
231
|
+
params['Method'] = 'TokenPayment'
|
232
|
+
add_customer_token(params, credit_card)
|
193
233
|
end
|
194
|
-
builder.to_xml
|
195
234
|
end
|
196
235
|
|
197
|
-
def
|
198
|
-
|
199
|
-
|
200
|
-
request << "EWAY_#{key.upcase}=#{CGI.escape(value.to_s)}"
|
201
|
-
end
|
202
|
-
request.join("&")
|
236
|
+
def add_customer_token(params, token)
|
237
|
+
params['Customer'] ||= {}
|
238
|
+
params['Customer']['TokenCustomerID'] = token
|
203
239
|
end
|
204
240
|
|
205
241
|
def url_for(action)
|
206
|
-
(test? ? test_url : live_url) + action
|
242
|
+
(test? ? test_url : live_url) + action
|
207
243
|
end
|
208
244
|
|
209
|
-
def commit(url,
|
245
|
+
def commit(url, params)
|
210
246
|
headers = {
|
211
247
|
"Authorization" => ("Basic " + Base64.strict_encode64(@options[:login].to_s + ":" + @options[:password].to_s).chomp),
|
212
|
-
"Content-Type" => "
|
248
|
+
"Content-Type" => "application/json"
|
213
249
|
}
|
214
|
-
|
250
|
+
request = params.to_json
|
215
251
|
raw = parse(ssl_post(url, request, headers))
|
216
252
|
|
217
253
|
succeeded = success?(raw)
|
218
|
-
|
254
|
+
ActiveMerchant::Billing::Response.new(
|
219
255
|
succeeded,
|
220
256
|
message_from(succeeded, raw),
|
221
257
|
raw,
|
@@ -225,56 +261,32 @@ module ActiveMerchant #:nodoc:
|
|
225
261
|
:cvv_result => cvv_result_from(raw)
|
226
262
|
)
|
227
263
|
rescue ActiveMerchant::ResponseError => e
|
228
|
-
return
|
229
|
-
end
|
230
|
-
|
231
|
-
def commit_form(url, request, parameters)
|
232
|
-
http_response = raw_ssl_request(:post, url, request)
|
233
|
-
|
234
|
-
success = (http_response.code.to_s == "302")
|
235
|
-
message = (success ? "Succeeded" : http_response.body)
|
236
|
-
authorization = parameters[:identification] if success
|
237
|
-
|
238
|
-
Response.new(success, message, {:location => http_response["Location"]}, :authorization => authorization, :test => test?)
|
264
|
+
return ActiveMerchant::Billing::Response.new(false, e.response.message, {:status_code => e.response.code}, :test => test?)
|
239
265
|
end
|
240
266
|
|
241
|
-
def parse(
|
242
|
-
|
243
|
-
|
244
|
-
doc = Nokogiri::XML(xml)
|
245
|
-
doc.root.xpath("*").each do |node|
|
246
|
-
if (node.elements.size == 0)
|
247
|
-
response[node.name.downcase.to_sym] = node.text
|
248
|
-
else
|
249
|
-
node.elements.each do |childnode|
|
250
|
-
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
251
|
-
response[name.to_sym] = childnode.text
|
252
|
-
end
|
253
|
-
end
|
254
|
-
end unless doc.root.nil?
|
255
|
-
|
256
|
-
response
|
267
|
+
def parse(data)
|
268
|
+
JSON.parse(data)
|
257
269
|
end
|
258
270
|
|
259
271
|
def success?(response)
|
260
|
-
if response[
|
261
|
-
false
|
262
|
-
elsif response[:responsecode] == "00"
|
272
|
+
if response['ResponseCode'] == "00"
|
263
273
|
true
|
264
|
-
elsif response[
|
265
|
-
(response[
|
274
|
+
elsif response['TransactionStatus']
|
275
|
+
(response['TransactionStatus'] == true)
|
276
|
+
elsif response["Succeeded"]
|
277
|
+
(response["Succeeded"] == true)
|
266
278
|
else
|
267
|
-
|
279
|
+
false
|
268
280
|
end
|
269
281
|
end
|
270
282
|
|
271
283
|
def message_from(succeeded, response)
|
272
|
-
if response[
|
273
|
-
(MESSAGES[response[
|
274
|
-
elsif response[
|
275
|
-
ActiveMerchant::Billing::EwayGateway::MESSAGES[response[
|
276
|
-
elsif response[
|
277
|
-
(MESSAGES[response[
|
284
|
+
if response['Errors']
|
285
|
+
(MESSAGES[response['Errors']] || response['Errors'])
|
286
|
+
elsif response['Responsecode']
|
287
|
+
ActiveMerchant::Billing::EwayGateway::MESSAGES[response['ResponseCode']]
|
288
|
+
elsif response['ResponseMessage']
|
289
|
+
(MESSAGES[response['ResponseMessage']] || response['ResponseMessage'])
|
278
290
|
elsif succeeded
|
279
291
|
"Succeeded"
|
280
292
|
else
|
@@ -283,11 +295,14 @@ module ActiveMerchant #:nodoc:
|
|
283
295
|
end
|
284
296
|
|
285
297
|
def authorization_from(response)
|
286
|
-
|
298
|
+
# Note: TransactionID is always null for store requests, but TokenCustomerID is also sent back for purchase from
|
299
|
+
# stored card transactions so we give precendence to TransactionID
|
300
|
+
response['TransactionID'] || response['Customer']['TokenCustomerID']
|
287
301
|
end
|
288
302
|
|
289
303
|
def avs_result_from(response)
|
290
|
-
|
304
|
+
verification = response['Verification'] || {}
|
305
|
+
code = case verification['Address']
|
291
306
|
when "Valid"
|
292
307
|
"M"
|
293
308
|
when "Invalid"
|
@@ -299,7 +314,8 @@ module ActiveMerchant #:nodoc:
|
|
299
314
|
end
|
300
315
|
|
301
316
|
def cvv_result_from(response)
|
302
|
-
|
317
|
+
verification = response['Verification'] || {}
|
318
|
+
case verification['CVN']
|
303
319
|
when "Valid"
|
304
320
|
"M"
|
305
321
|
when "Invalid"
|
@@ -309,16 +325,30 @@ module ActiveMerchant #:nodoc:
|
|
309
325
|
end
|
310
326
|
end
|
311
327
|
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
end
|
328
|
+
def truncate(value, max_size = 50)
|
329
|
+
return nil unless value
|
330
|
+
value.to_s[0, max_size]
|
316
331
|
end
|
317
332
|
|
318
333
|
MESSAGES = {
|
334
|
+
'A2000' => 'Transaction Approved Successful',
|
335
|
+
'A2008' => 'Honour With Identification Successful',
|
336
|
+
'A2010' => 'Approved For Partial Amount Successful',
|
337
|
+
'A2011' => 'Approved, VIP Successful',
|
338
|
+
'A2016' => 'Approved, Update Track 3 Successful',
|
339
|
+
'S5000' => 'System Error',
|
340
|
+
'S5085' => 'Started 3dSecure',
|
341
|
+
'S5086' => 'Routed 3dSecure',
|
342
|
+
'S5087' => 'Completed 3dSecure',
|
343
|
+
'S5088' => 'PayPal Transaction Created',
|
344
|
+
'S5099' => 'Incomplete (Access Code in progress/incomplete)',
|
345
|
+
'S5010' => 'Unknown error returned by gateway',
|
319
346
|
'V6000' => 'Validation error',
|
320
347
|
'V6001' => 'Invalid CustomerIP',
|
321
348
|
'V6002' => 'Invalid DeviceID',
|
349
|
+
'V6003' => 'Invalid Request PartnerID',
|
350
|
+
'V6004' => 'Invalid Request Method',
|
351
|
+
'V6010' => 'Invalid TransactionType, account not certified for eCome only MOTO or Recurring available',
|
322
352
|
'V6011' => 'Invalid Payment TotalAmount',
|
323
353
|
'V6012' => 'Invalid Payment InvoiceDescription',
|
324
354
|
'V6013' => 'Invalid Payment InvoiceNumber',
|
@@ -385,7 +415,8 @@ module ActiveMerchant #:nodoc:
|
|
385
415
|
'V6107' => 'Invalid EWAY_ACCESSCODE',
|
386
416
|
'V6108' => 'Invalid CustomerHostAddress',
|
387
417
|
'V6109' => 'Invalid UserAgent',
|
388
|
-
'V6110' => 'Invalid EWAY_CARDNUMBER'
|
418
|
+
'V6110' => 'Invalid EWAY_CARDNUMBER',
|
419
|
+
'V6111' => 'Unauthorised API Access, Account Not PCI Certified'
|
389
420
|
}
|
390
421
|
end
|
391
422
|
end
|