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
|
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def capture(money, authorization, options={})
|
|
52
|
-
transaction_id,
|
|
52
|
+
transaction_id, _ = split_authorization(authorization)
|
|
53
53
|
|
|
54
54
|
request = build_xml_request do |doc|
|
|
55
55
|
add_authentication(doc)
|
|
@@ -63,12 +63,12 @@ module ActiveMerchant #:nodoc:
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def credit(money, authorization, options = {})
|
|
66
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
66
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
67
67
|
refund(money, authorization, options)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def refund(money, authorization, options={})
|
|
71
|
-
transaction_id,
|
|
71
|
+
transaction_id, _ = split_authorization(authorization)
|
|
72
72
|
|
|
73
73
|
request = build_xml_request do |doc|
|
|
74
74
|
add_authentication(doc)
|
|
@@ -81,6 +81,13 @@ module ActiveMerchant #:nodoc:
|
|
|
81
81
|
commit(:credit, request)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
def verify(creditcard, options = {})
|
|
85
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
86
|
+
r.process { authorize(0, creditcard, options) }
|
|
87
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
84
91
|
def void(authorization, options={})
|
|
85
92
|
transaction_id, kind = split_authorization(authorization)
|
|
86
93
|
|
|
@@ -299,7 +306,6 @@ module ActiveMerchant #:nodoc:
|
|
|
299
306
|
'Content-Type' => 'text/xml'
|
|
300
307
|
}
|
|
301
308
|
end
|
|
302
|
-
|
|
303
309
|
end
|
|
304
310
|
end
|
|
305
311
|
end
|
|
@@ -77,6 +77,7 @@ module ActiveMerchant #:nodoc:
|
|
|
77
77
|
def add_aux_data(post, options)
|
|
78
78
|
post[:processorID] = (test? ? 1 : 4) # test: 1, redecard: 2, cielo: 4
|
|
79
79
|
post[:referenceNum] = options[:order_id]
|
|
80
|
+
post[:installments] = options[:installments] if options.has_key?(:installments) && options[:installments] > 1 # only send installments if it is a deferred payment
|
|
80
81
|
end
|
|
81
82
|
|
|
82
83
|
def add_amount(post, money)
|
|
@@ -136,6 +137,12 @@ module ActiveMerchant #:nodoc:
|
|
|
136
137
|
}
|
|
137
138
|
xml.payment {
|
|
138
139
|
xml.chargeTotal params[:amount]
|
|
140
|
+
if params[:installments].present?
|
|
141
|
+
xml.creditInstallment {
|
|
142
|
+
xml.numberOfInstallments params[:installments]
|
|
143
|
+
xml.chargeInterest 'N'
|
|
144
|
+
}
|
|
145
|
+
end
|
|
139
146
|
}
|
|
140
147
|
xml.billing {
|
|
141
148
|
xml.name params[:billing_name]
|
|
@@ -148,12 +148,6 @@ module ActiveMerchant #:nodoc:
|
|
|
148
148
|
)
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
-
def expdate(creditcard)
|
|
152
|
-
year = sprintf("%.4i", creditcard.year)
|
|
153
|
-
month = sprintf("%.2i", creditcard.month)
|
|
154
|
-
"#{month}#{year[-2..-1]}"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
151
|
def message_from(response)
|
|
158
152
|
if response["error_code"] == "000"
|
|
159
153
|
"This transaction has been approved"
|
|
@@ -105,7 +105,7 @@ module ActiveMerchant #:nodoc:
|
|
|
105
105
|
# * <tt>:order_id</tt> - A unique reference for this order (required when performing a non-referenced credit)
|
|
106
106
|
def credit(money, identification, options = {})
|
|
107
107
|
if identification.is_a?(String)
|
|
108
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
108
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
109
109
|
refund(money, identification, options)
|
|
110
110
|
else
|
|
111
111
|
perform_credit(money, identification, options)
|
|
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
|
|
|
151
151
|
def build_purchase_request(action, money, credit_card, options)
|
|
152
152
|
requires!(options, :order_id)
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
soap_request(action) do |xml|
|
|
155
155
|
add_invoice(xml, options)
|
|
156
156
|
add_amount(xml, money)
|
|
157
157
|
add_credit_card(xml, credit_card)
|
|
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
|
162
162
|
def build_capture_request(action, money, identification, options)
|
|
163
163
|
reference, options[:order_id] = split_reference(identification)
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
soap_request(action) do |xml|
|
|
166
166
|
add_reference(xml, reference)
|
|
167
167
|
add_invoice(xml, options)
|
|
168
168
|
add_amount(xml, money)
|
|
@@ -199,13 +199,6 @@ module ActiveMerchant #:nodoc:
|
|
|
199
199
|
xml.tag! "strName", @options[:name]
|
|
200
200
|
end
|
|
201
201
|
|
|
202
|
-
def expdate(credit_card)
|
|
203
|
-
year = sprintf("%.4i", credit_card.year)
|
|
204
|
-
month = sprintf("%.2i", credit_card.month)
|
|
205
|
-
|
|
206
|
-
"#{month}#{year[-2..-1]}"
|
|
207
|
-
end
|
|
208
|
-
|
|
209
202
|
def add_invoice(xml, options)
|
|
210
203
|
xml.tag! "strOrderNumber", options[:order_id].to_s.gsub(/[^\w]/, '').slice(0, 25)
|
|
211
204
|
end
|
|
@@ -279,7 +272,7 @@ module ActiveMerchant #:nodoc:
|
|
|
279
272
|
|
|
280
273
|
response[:message] = response["faultstring"].to_s.gsub("\n", " ")
|
|
281
274
|
response
|
|
282
|
-
rescue REXML::ParseException
|
|
275
|
+
rescue REXML::ParseException
|
|
283
276
|
response[:http_body] = http_response.body
|
|
284
277
|
response[:message] = "Failed to parse the failed response"
|
|
285
278
|
response
|
|
@@ -129,7 +129,7 @@ module ActiveMerchant #:nodoc:
|
|
|
129
129
|
def build_purchase_request(action, money, payment_source, options)
|
|
130
130
|
requires!(options, :order_id)
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
soap_request(action) do |xml|
|
|
133
133
|
add_invoice(xml, options)
|
|
134
134
|
add_amount(xml, money)
|
|
135
135
|
add_payment_source(xml, payment_source)
|
|
@@ -140,20 +140,13 @@ module ActiveMerchant #:nodoc:
|
|
|
140
140
|
def build_capture_request(action, money, identification, options)
|
|
141
141
|
reference, options[:order_id] = split_reference(identification)
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
soap_request(action) do |xml|
|
|
144
144
|
add_reference_token(xml, reference)
|
|
145
145
|
add_invoice(xml, options)
|
|
146
146
|
add_amount(xml, money)
|
|
147
147
|
end
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
def expdate(credit_card)
|
|
151
|
-
year = sprintf("%.4i", credit_card.year)
|
|
152
|
-
month = sprintf("%.2i", credit_card.month)
|
|
153
|
-
|
|
154
|
-
"#{month}#{year[-2..-1]}"
|
|
155
|
-
end
|
|
156
|
-
|
|
157
150
|
def add_invoice(xml, options)
|
|
158
151
|
xml.tag! "invoiceNumber", options[:order_id].to_s.gsub(/[^\w]/, '').slice(0, 25)
|
|
159
152
|
end
|
|
@@ -234,7 +227,7 @@ module ActiveMerchant #:nodoc:
|
|
|
234
227
|
|
|
235
228
|
response[:message] = response["ErrorMessage"].to_s.gsub("\n", " ")
|
|
236
229
|
response
|
|
237
|
-
rescue REXML::ParseException
|
|
230
|
+
rescue REXML::ParseException
|
|
238
231
|
response[:http_body] = http_response.body
|
|
239
232
|
response[:message] = "Failed to parse the failed response"
|
|
240
233
|
response
|
|
@@ -208,13 +208,6 @@ module ActiveMerchant #:nodoc:
|
|
|
208
208
|
xml.tag! 'CVVData', credit_card.verification_value if(include_cvv && credit_card.verification_value)
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
def expdate(credit_card)
|
|
212
|
-
year = sprintf("%.4i", credit_card.year)
|
|
213
|
-
month = sprintf("%.2i", credit_card.month)
|
|
214
|
-
|
|
215
|
-
"#{month}#{year[-2..-1]}"
|
|
216
|
-
end
|
|
217
|
-
|
|
218
211
|
def add_address(xml, options)
|
|
219
212
|
if billing_address = options[:billing_address] || options[:address]
|
|
220
213
|
xml.tag! 'AVS' do
|
|
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
|
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
def credit(money, identification, options = {})
|
|
153
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
153
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
154
154
|
refund(money, identification, options)
|
|
155
155
|
end
|
|
156
156
|
|
|
@@ -284,17 +284,6 @@ module ActiveMerchant #:nodoc:
|
|
|
284
284
|
end
|
|
285
285
|
end
|
|
286
286
|
|
|
287
|
-
# Make a ruby type out of the response string
|
|
288
|
-
def normalize(field)
|
|
289
|
-
case field
|
|
290
|
-
when "true" then true
|
|
291
|
-
when "false" then false
|
|
292
|
-
when "" then nil
|
|
293
|
-
when "null" then nil
|
|
294
|
-
else field
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
|
-
|
|
298
287
|
def message_from(results)
|
|
299
288
|
if results[:response_code] == DECLINED
|
|
300
289
|
return CVVResult.messages[ results[:card_code] ] if CARD_CODE_ERRORS.include?(results[:card_code])
|
|
@@ -306,17 +295,9 @@ module ActiveMerchant #:nodoc:
|
|
|
306
295
|
(results[:response_reason_text] ? results[:response_reason_text].chomp('.') : '')
|
|
307
296
|
end
|
|
308
297
|
|
|
309
|
-
def expdate(creditcard)
|
|
310
|
-
year = sprintf("%.4i", creditcard.year)
|
|
311
|
-
month = sprintf("%.2i", creditcard.month)
|
|
312
|
-
|
|
313
|
-
"#{month}#{year[-2..-1]}"
|
|
314
|
-
end
|
|
315
|
-
|
|
316
298
|
def split(response)
|
|
317
299
|
response[1..-2].split(/\$,\$/)
|
|
318
300
|
end
|
|
319
|
-
|
|
320
301
|
end
|
|
321
302
|
end
|
|
322
303
|
end
|
|
@@ -33,6 +33,7 @@ module ActiveMerchant #:nodoc:
|
|
|
33
33
|
def initialize(options = {})
|
|
34
34
|
requires!(options, :login, :password)
|
|
35
35
|
@cvv_enabled = options[:cvv_enabled]
|
|
36
|
+
@avs_enabled = options[:avs_enabled]
|
|
36
37
|
options = { :crypt_type => 7 }.merge(options)
|
|
37
38
|
super
|
|
38
39
|
end
|
|
@@ -45,10 +46,10 @@ module ActiveMerchant #:nodoc:
|
|
|
45
46
|
def authorize(money, creditcard_or_datakey, options = {})
|
|
46
47
|
requires!(options, :order_id)
|
|
47
48
|
post = {}
|
|
48
|
-
add_payment_source(post, creditcard_or_datakey)
|
|
49
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
|
49
50
|
post[:amount] = amount(money)
|
|
50
51
|
post[:order_id] = options[:order_id]
|
|
51
|
-
post[:
|
|
52
|
+
post[:address] = options[:billing_address] || options[:address]
|
|
52
53
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
|
53
54
|
action = (post[:data_key].blank?) ? 'preauth' : 'res_preauth_cc'
|
|
54
55
|
commit(action, post)
|
|
@@ -61,10 +62,10 @@ module ActiveMerchant #:nodoc:
|
|
|
61
62
|
def purchase(money, creditcard_or_datakey, options = {})
|
|
62
63
|
requires!(options, :order_id)
|
|
63
64
|
post = {}
|
|
64
|
-
add_payment_source(post, creditcard_or_datakey)
|
|
65
|
+
add_payment_source(post, creditcard_or_datakey, options)
|
|
65
66
|
post[:amount] = amount(money)
|
|
66
67
|
post[:order_id] = options[:order_id]
|
|
67
|
-
post[:
|
|
68
|
+
post[:address] = options[:billing_address] || options[:address]
|
|
68
69
|
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
|
|
69
70
|
action = (post[:data_key].blank?) ? 'purchase' : 'res_purchase_cc'
|
|
70
71
|
commit(action, post)
|
|
@@ -111,7 +112,7 @@ module ActiveMerchant #:nodoc:
|
|
|
111
112
|
# Moneris interface consistent with other gateways. (See +capture+ for
|
|
112
113
|
# details.)
|
|
113
114
|
def credit(money, authorization, options = {})
|
|
114
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
115
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
115
116
|
refund(money, authorization, options)
|
|
116
117
|
end
|
|
117
118
|
|
|
@@ -148,13 +149,15 @@ module ActiveMerchant #:nodoc:
|
|
|
148
149
|
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
|
|
149
150
|
end
|
|
150
151
|
|
|
151
|
-
def add_payment_source(post, source)
|
|
152
|
+
def add_payment_source(post, source, options)
|
|
152
153
|
if source.is_a?(String)
|
|
153
154
|
post[:data_key] = source
|
|
155
|
+
post[:cust_id] = options[:customer]
|
|
154
156
|
else
|
|
155
157
|
post[:pan] = source.number
|
|
156
158
|
post[:expdate] = expdate(source)
|
|
157
159
|
post[:cvd_value] = source.verification_value if source.verification_value?
|
|
160
|
+
post[:cust_id] = options[:customer] || source.name
|
|
158
161
|
end
|
|
159
162
|
end
|
|
160
163
|
|
|
@@ -185,7 +188,8 @@ module ActiveMerchant #:nodoc:
|
|
|
185
188
|
|
|
186
189
|
Response.new(successful?(response), message_from(response[:message]), response,
|
|
187
190
|
:test => test?,
|
|
188
|
-
:
|
|
191
|
+
:avs_result => { :code => response[:avs_result_code] },
|
|
192
|
+
:cvv_result => response[:cvd_result_code] && response[:cvd_result_code][-1,1],
|
|
189
193
|
:authorization => authorization_from(response)
|
|
190
194
|
)
|
|
191
195
|
end
|
|
@@ -233,8 +237,11 @@ module ActiveMerchant #:nodoc:
|
|
|
233
237
|
|
|
234
238
|
# Must add the elements in the correct order
|
|
235
239
|
actions[action].each do |key|
|
|
236
|
-
|
|
237
|
-
|
|
240
|
+
case key
|
|
241
|
+
when :avs_info
|
|
242
|
+
transaction.add_element(avs_element(parameters[:address])) if @avs_enabled && parameters[:address]
|
|
243
|
+
when :cvd_info
|
|
244
|
+
transaction.add_element(cvd_element(parameters[:cvd_value])) if @cvv_enabled
|
|
238
245
|
else
|
|
239
246
|
transaction.add_element(key.to_s).text = parameters[key] unless parameters[key].blank?
|
|
240
247
|
end
|
|
@@ -243,6 +250,17 @@ module ActiveMerchant #:nodoc:
|
|
|
243
250
|
transaction
|
|
244
251
|
end
|
|
245
252
|
|
|
253
|
+
def avs_element(address)
|
|
254
|
+
full_address = "#{address[:address1]} #{address[:address2]}"
|
|
255
|
+
tokens = full_address.split(/\s+/)
|
|
256
|
+
|
|
257
|
+
element = REXML::Element.new('avs_info')
|
|
258
|
+
element.add_element('avs_street_number').text = tokens.select{|x| x =~ /\d/}.join(' ')
|
|
259
|
+
element.add_element('avs_street_name').text = tokens.reject{|x| x =~ /\d/}.join(' ')
|
|
260
|
+
element.add_element('avs_zipcode').text = address[:zip]
|
|
261
|
+
element
|
|
262
|
+
end
|
|
263
|
+
|
|
246
264
|
def cvd_element(cvd_value)
|
|
247
265
|
element = REXML::Element.new('cvd_info')
|
|
248
266
|
if cvd_value
|
|
@@ -259,20 +277,10 @@ module ActiveMerchant #:nodoc:
|
|
|
259
277
|
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
|
260
278
|
end
|
|
261
279
|
|
|
262
|
-
# Make a Ruby type out of the response string
|
|
263
|
-
def normalize(field)
|
|
264
|
-
case field
|
|
265
|
-
when "true" then true
|
|
266
|
-
when "false" then false
|
|
267
|
-
when '', "null" then nil
|
|
268
|
-
else field
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
|
|
272
280
|
def actions
|
|
273
281
|
{
|
|
274
|
-
"purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :cvd_info],
|
|
275
|
-
"preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :cvd_info],
|
|
282
|
+
"purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info],
|
|
283
|
+
"preauth" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type, :avs_info, :cvd_info],
|
|
276
284
|
"command" => [:order_id],
|
|
277
285
|
"refund" => [:order_id, :amount, :txn_number, :crypt_type],
|
|
278
286
|
"indrefund" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
|
@@ -71,7 +71,7 @@ module ActiveMerchant #:nodoc:
|
|
|
71
71
|
# Moneris interface consistent with other gateways. (See +capture+ for
|
|
72
72
|
# details.)
|
|
73
73
|
def credit(money, authorization, options = {})
|
|
74
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
74
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
75
75
|
refund(money, authorization, options)
|
|
76
76
|
end
|
|
77
77
|
|
|
@@ -178,16 +178,6 @@ module ActiveMerchant #:nodoc:
|
|
|
178
178
|
message.gsub(/[^\w]/, ' ').split.join(" ").capitalize
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
# Make a Ruby type out of the response string
|
|
182
|
-
def normalize(field)
|
|
183
|
-
case field
|
|
184
|
-
when "true" then true
|
|
185
|
-
when "false" then false
|
|
186
|
-
when '', "null" then nil
|
|
187
|
-
else field
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
|
|
191
181
|
def actions
|
|
192
182
|
{
|
|
193
183
|
"us_purchase" => [:order_id, :cust_id, :amount, :pan, :expdate, :crypt_type],
|
|
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def credit(money, authorization, options = {})
|
|
53
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
53
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
54
54
|
refund(money, authorization, options)
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -99,12 +99,6 @@ module ActiveMerchant #:nodoc:
|
|
|
99
99
|
post[:cvv] = creditcard.verification_value
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
def expdate(creditcard)
|
|
103
|
-
year = sprintf("%.4i", creditcard.year)
|
|
104
|
-
month = sprintf("%.2i", creditcard.month)
|
|
105
|
-
"#{month}#{year[-2..-1]}"
|
|
106
|
-
end
|
|
107
|
-
|
|
108
102
|
def parse(body)
|
|
109
103
|
body.split('&').inject({}) do |memo, x|
|
|
110
104
|
k, v = x.split('=')
|
|
@@ -119,7 +113,6 @@ module ActiveMerchant #:nodoc:
|
|
|
119
113
|
data = ssl_post(self.live_url, post_data(action, parameters))
|
|
120
114
|
response = parse(data)
|
|
121
115
|
message = message_from(response)
|
|
122
|
-
test_mode = test?
|
|
123
116
|
|
|
124
117
|
Response.new(success?(response), message, response,
|
|
125
118
|
:test => test?,
|
|
@@ -16,28 +16,21 @@ module ActiveMerchant #:nodoc:
|
|
|
16
16
|
self.live_periodic_url = 'https://transact.nab.com.au/xmlapi/periodic'
|
|
17
17
|
|
|
18
18
|
self.supported_countries = ['AU']
|
|
19
|
-
|
|
20
|
-
# The card types supported by the payment gateway
|
|
21
|
-
# Note that support for Diners, Amex, and JCB require extra
|
|
22
|
-
# steps in setting up your account, as detailed in the NAB Transact API
|
|
23
19
|
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
|
|
24
20
|
|
|
25
21
|
self.homepage_url = 'http://transact.nab.com.au'
|
|
26
22
|
self.display_name = 'NAB Transact'
|
|
27
|
-
|
|
28
|
-
cattr_accessor :request_timeout
|
|
29
|
-
self.request_timeout = 60
|
|
30
|
-
|
|
31
23
|
self.money_format = :cents
|
|
32
24
|
self.default_currency = 'AUD'
|
|
33
25
|
|
|
34
26
|
#Transactions currently accepted by NAB Transact XML API
|
|
35
27
|
TRANSACTIONS = {
|
|
36
|
-
:purchase => 0,
|
|
37
|
-
:refund => 4,
|
|
38
|
-
:void => 6,
|
|
39
|
-
:
|
|
40
|
-
:
|
|
28
|
+
:purchase => 0, #Standard Payment
|
|
29
|
+
:refund => 4, #Refund
|
|
30
|
+
:void => 6, #Client Reversal (Void)
|
|
31
|
+
:unmatched_refund => 666, #Unmatched Refund
|
|
32
|
+
:authorization => 10, #Preauthorise
|
|
33
|
+
:capture => 11 #Preauthorise Complete (Advice)
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
PERIODIC_TYPES = {
|
|
@@ -66,6 +59,10 @@ module ActiveMerchant #:nodoc:
|
|
|
66
59
|
end
|
|
67
60
|
end
|
|
68
61
|
|
|
62
|
+
def credit(money, credit_card, options = {})
|
|
63
|
+
commit :unmatched_refund, build_purchase_request(money, credit_card, options)
|
|
64
|
+
end
|
|
65
|
+
|
|
69
66
|
def refund(money, authorization, options = {})
|
|
70
67
|
commit :refund, build_reference_request(money, authorization, options)
|
|
71
68
|
end
|
|
@@ -140,7 +137,7 @@ module ActiveMerchant #:nodoc:
|
|
|
140
137
|
xml.instruct!
|
|
141
138
|
xml.tag! 'NABTransactMessage' do
|
|
142
139
|
xml.tag! 'MessageInfo' do
|
|
143
|
-
xml.tag! 'messageID',
|
|
140
|
+
xml.tag! 'messageID', SecureRandom.hex(15)
|
|
144
141
|
xml.tag! 'messageTimestamp', generate_timestamp
|
|
145
142
|
xml.tag! 'timeoutValue', request_timeout
|
|
146
143
|
xml.tag! 'apiVersion', API_VERSION
|
|
@@ -191,7 +188,7 @@ module ActiveMerchant #:nodoc:
|
|
|
191
188
|
xml.instruct!
|
|
192
189
|
xml.tag! 'NABTransactMessage' do
|
|
193
190
|
xml.tag! 'MessageInfo' do
|
|
194
|
-
xml.tag! 'messageID',
|
|
191
|
+
xml.tag! 'messageID', SecureRandom.hex(15)
|
|
195
192
|
xml.tag! 'messageTimestamp', generate_timestamp
|
|
196
193
|
xml.tag! 'timeoutValue', request_timeout
|
|
197
194
|
xml.tag! 'apiVersion', PERIODIC_API_VERSION
|
|
@@ -274,6 +271,10 @@ module ActiveMerchant #:nodoc:
|
|
|
274
271
|
time.strftime("%Y%d%m%H%M%S#{time.usec}+000")
|
|
275
272
|
end
|
|
276
273
|
|
|
274
|
+
def request_timeout
|
|
275
|
+
@options[:request_timeout] || 60
|
|
276
|
+
end
|
|
277
|
+
|
|
277
278
|
end
|
|
278
279
|
end
|
|
279
280
|
end
|