activemerchant 1.43.3 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG +133 -3
- data/CONTRIBUTORS +25 -0
- data/README.md +14 -39
- data/lib/active_merchant.rb +43 -2
- data/lib/active_merchant/billing.rb +3 -1
- data/lib/active_merchant/billing/base.rb +10 -2
- data/lib/active_merchant/billing/check.rb +29 -22
- data/lib/active_merchant/billing/compatibility.rb +120 -0
- data/lib/active_merchant/billing/credit_card.rb +129 -60
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +60 -43
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +46 -11
- data/lib/active_merchant/billing/gateways/adyen.rb +205 -0
- data/lib/active_merchant/billing/gateways/app55.rb +1 -9
- data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -391
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +20 -4
- data/lib/active_merchant/billing/gateways/balanced.rb +127 -367
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream.rb +25 -6
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -3
- data/lib/active_merchant/billing/gateways/blue_pay.rb +11 -3
- data/lib/active_merchant/billing/gateways/bogus.rb +1 -13
- data/lib/active_merchant/billing/gateways/borgun.rb +211 -0
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +31 -13
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +184 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +45 -0
- data/lib/active_merchant/billing/gateways/certo_direct.rb +3 -2
- data/lib/active_merchant/billing/gateways/commercegate.rb +143 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +56 -81
- data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +3 -1
- data/lib/active_merchant/billing/gateways/efsnet.rb +3 -14
- data/lib/active_merchant/billing/gateways/elavon.rb +45 -9
- data/lib/active_merchant/billing/gateways/epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/eway.rb +1 -12
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +233 -202
- data/lib/active_merchant/billing/gateways/exact.rb +1 -1
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +1 -1
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -8
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -1
- data/lib/active_merchant/billing/gateways/first_pay.rb +108 -124
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +43 -13
- data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
- data/lib/active_merchant/billing/gateways/hps.rb +281 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +1 -4
- data/lib/active_merchant/billing/gateways/inspire.rb +0 -8
- data/lib/active_merchant/billing/gateways/iridium.rb +25 -3
- data/lib/active_merchant/billing/gateways/jetpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -13
- data/lib/active_merchant/billing/gateways/litle.rb +10 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +7 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -6
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +4 -11
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -10
- data/lib/active_merchant/billing/gateways/mercury.rb +0 -7
- data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -20
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/moneris.rb +29 -21
- data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -11
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -8
- data/lib/active_merchant/billing/gateways/nab_transact.rb +16 -15
- data/lib/active_merchant/billing/gateways/net_registry.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbilling.rb +0 -7
- data/lib/active_merchant/billing/gateways/network_merchants.rb +21 -18
- data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
- data/lib/active_merchant/billing/gateways/openpay.rb +1 -8
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +34 -23
- data/lib/active_merchant/billing/gateways/orbital.rb +121 -4
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +2 -9
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -13
- data/lib/active_merchant/billing/gateways/pay_secure.rb +0 -7
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -9
- data/lib/active_merchant/billing/gateways/payex.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +15 -15
- data/lib/active_merchant/billing/gateways/payflow_express.rb +19 -19
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +7 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +25 -14
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +16 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +3 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +25 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -8
- data/lib/active_merchant/billing/gateways/pin.rb +39 -7
- data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -12
- data/lib/active_merchant/billing/gateways/psigate.rb +1 -12
- data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +2 -2
- data/lib/active_merchant/billing/gateways/quickpay.rb +17 -15
- data/lib/active_merchant/billing/gateways/realex.rb +3 -12
- data/lib/active_merchant/billing/gateways/sage.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +2 -8
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage_pay.rb +93 -28
- data/lib/active_merchant/billing/gateways/secure_net.rb +1 -8
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +3 -3
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +0 -7
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -2
- data/lib/active_merchant/billing/gateways/smart_ps.rb +8 -2
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +14 -15
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +0 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +4 -9
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +46 -43
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +7 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +1 -8
- data/lib/active_merchant/billing/gateways/viaklix.rb +0 -6
- data/lib/active_merchant/billing/gateways/vindicia.rb +68 -44
- data/lib/active_merchant/billing/gateways/webpay.rb +1 -9
- data/lib/active_merchant/billing/gateways/wirecard.rb +117 -11
- data/lib/active_merchant/billing/gateways/worldpay.rb +50 -22
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +181 -0
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +20 -15
- data/lib/active_merchant/country.rb +327 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +29 -0
- data/lib/active_merchant/offsite_payments_shim.rb +19 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +60 -243
- metadata.gz.sig +0 -0
- data/gem-public_cert.pem +0 -21
- data/lib/active_merchant/billing/expiry_date.rb +0 -34
- data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +0 -93
- data/lib/active_merchant/billing/gateways/orbital/cvv_result.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -78
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -66
- data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +0 -74
- data/lib/active_merchant/billing/integrations/bit_pay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/citrus.rb +0 -28
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -57
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +0 -133
- data/lib/active_merchant/billing/integrations/citrus/return.rb +0 -40
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/doku/helper.rb +0 -102
- data/lib/active_merchant/billing/integrations/doku/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/doku/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/helper.rb +0 -123
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -118
- data/lib/active_merchant/billing/integrations/ipay88/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/ipay88/return.rb +0 -29
- data/lib/active_merchant/billing/integrations/klarna.rb +0 -71
- data/lib/active_merchant/billing/integrations/klarna/helper.rb +0 -123
- data/lib/active_merchant/billing/integrations/klarna/notification.rb +0 -103
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/mollie_ideal.rb +0 -98
- data/lib/active_merchant/billing/integrations/mollie_ideal/helper.rb +0 -67
- data/lib/active_merchant/billing/integrations/mollie_ideal/notification.rb +0 -69
- data/lib/active_merchant/billing/integrations/mollie_ideal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/pag_seguro.rb +0 -53
- data/lib/active_merchant/billing/integrations/pag_seguro/helper.rb +0 -121
- data/lib/active_merchant/billing/integrations/pag_seguro/notification.rb +0 -104
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy.rb +0 -36
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/payu_in.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +0 -154
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +0 -36
- data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +0 -19
- data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +0 -16
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -113
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -107
- data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +0 -171
- data/lib/active_merchant/billing/integrations/two_checkout/return.rb +0 -58
- data/lib/active_merchant/billing/integrations/universal.rb +0 -23
- data/lib/active_merchant/billing/integrations/universal/helper.rb +0 -76
- data/lib/active_merchant/billing/integrations/universal/notification.rb +0 -52
- data/lib/active_merchant/billing/integrations/universal/return.rb +0 -18
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/common.rb +0 -104
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/helper.rb +0 -145
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb +0 -35
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
|
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
|
|
|
63
63
|
# code returned by ePDQ
|
|
64
64
|
def credit(money, creditcard_or_authorization, options = {})
|
|
65
65
|
if creditcard_or_authorization.is_a?(String)
|
|
66
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
66
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
67
67
|
refund(money, creditcard_or_authorization, options)
|
|
68
68
|
else
|
|
69
69
|
credit_new_order(money, creditcard_or_authorization, options)
|
|
@@ -16,7 +16,10 @@ module ActiveMerchant #:nodoc:
|
|
|
16
16
|
# BeanStream supports payment profiles (vaults). This allows you to store cc information with BeanStream and process subsequent transactions with a customer id.
|
|
17
17
|
# Secure Payment Profiles must be enabled on your account (must be done over the phone).
|
|
18
18
|
# Your API Access Passcode must be set in Administration => account settings => order settings.
|
|
19
|
-
# To learn more about storing credit cards with the Beanstream gateway,
|
|
19
|
+
# To learn more about storing credit cards with the Beanstream gateway, documentation can be found at http://developer.beanstream.com/documentation/classic-apis
|
|
20
|
+
#
|
|
21
|
+
# To store a credit card using Beanstream's Legato Javascript Library (http://developer.beanstream.com/documentation/legato) you must pass the singleUseToken in
|
|
22
|
+
# the store method's option parameter. Example: @gateway.store("gt6-0c78c25b-3637-4ba0-90e2-26105287f198")
|
|
20
23
|
#
|
|
21
24
|
# == Notes
|
|
22
25
|
# * Adding of order products information is not implemented.
|
|
@@ -97,6 +100,8 @@ module ActiveMerchant #:nodoc:
|
|
|
97
100
|
end
|
|
98
101
|
|
|
99
102
|
def recurring(money, source, options = {})
|
|
103
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
104
|
+
|
|
100
105
|
post = {}
|
|
101
106
|
add_amount(post, money)
|
|
102
107
|
add_invoice(post, options)
|
|
@@ -108,6 +113,8 @@ module ActiveMerchant #:nodoc:
|
|
|
108
113
|
end
|
|
109
114
|
|
|
110
115
|
def update_recurring(amount, source, options = {})
|
|
116
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
117
|
+
|
|
111
118
|
post = {}
|
|
112
119
|
add_recurring_amount(post, amount)
|
|
113
120
|
add_recurring_invoice(post, options)
|
|
@@ -119,6 +126,8 @@ module ActiveMerchant #:nodoc:
|
|
|
119
126
|
end
|
|
120
127
|
|
|
121
128
|
def cancel_recurring(options = {})
|
|
129
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
130
|
+
|
|
122
131
|
post = {}
|
|
123
132
|
add_recurring_operation_type(post, :cancel)
|
|
124
133
|
add_recurring_service(post, options)
|
|
@@ -131,11 +140,17 @@ module ActiveMerchant #:nodoc:
|
|
|
131
140
|
|
|
132
141
|
# To match the other stored-value gateways, like TrustCommerce,
|
|
133
142
|
# store and unstore need to be defined
|
|
134
|
-
def store(
|
|
143
|
+
def store(payment_method, options = {})
|
|
135
144
|
post = {}
|
|
136
145
|
add_address(post, options)
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
|
|
147
|
+
if payment_method.respond_to?(:number)
|
|
148
|
+
add_credit_card(post, payment_method)
|
|
149
|
+
else
|
|
150
|
+
post[:singleUseToken] = payment_method
|
|
151
|
+
end
|
|
152
|
+
add_secure_profile_variables(post, options)
|
|
153
|
+
|
|
139
154
|
commit(post, true)
|
|
140
155
|
end
|
|
141
156
|
|
|
@@ -150,10 +165,14 @@ module ActiveMerchant #:nodoc:
|
|
|
150
165
|
# Update the values (such as CC expiration) stored at
|
|
151
166
|
# the gateway. The CC number must be supplied in the
|
|
152
167
|
# CreditCard object.
|
|
153
|
-
def update(vault_id,
|
|
168
|
+
def update(vault_id, payment_method, options = {})
|
|
154
169
|
post = {}
|
|
155
170
|
add_address(post, options)
|
|
156
|
-
|
|
171
|
+
if payment_method.respond_to?(:number)
|
|
172
|
+
add_credit_card(post, payment_method)
|
|
173
|
+
else
|
|
174
|
+
post[:singleUseToken] = payment_method
|
|
175
|
+
end
|
|
157
176
|
options.merge!({:vault_id => vault_id, :operation => secure_profile_action(:modify)})
|
|
158
177
|
add_secure_profile_variables(post,options)
|
|
159
178
|
commit(post, true)
|
|
@@ -87,7 +87,7 @@ module ActiveMerchant #:nodoc:
|
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def capture(money, authorization, options = {})
|
|
90
|
-
reference,
|
|
90
|
+
reference, _, _ = split_auth(authorization)
|
|
91
91
|
|
|
92
92
|
post = {}
|
|
93
93
|
add_amount(post, money)
|
|
@@ -98,7 +98,7 @@ module ActiveMerchant #:nodoc:
|
|
|
98
98
|
|
|
99
99
|
def refund(money, source, options = {})
|
|
100
100
|
post = {}
|
|
101
|
-
reference,
|
|
101
|
+
reference, _, type = split_auth(source)
|
|
102
102
|
add_reference(post, reference)
|
|
103
103
|
add_transaction_type(post, refund_action(type))
|
|
104
104
|
add_amount(post, money)
|
|
@@ -106,7 +106,7 @@ module ActiveMerchant #:nodoc:
|
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def credit(money, source, options = {})
|
|
109
|
-
deprecated Gateway::CREDIT_DEPRECATION_MESSAGE
|
|
109
|
+
ActiveMerchant.deprecated Gateway::CREDIT_DEPRECATION_MESSAGE
|
|
110
110
|
refund(money, source, options)
|
|
111
111
|
end
|
|
112
112
|
|
|
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
|
|
|
155
155
|
# * <tt>options</tt> -- A hash of parameters.
|
|
156
156
|
def refund(money, identification, options = {})
|
|
157
157
|
if(identification && !identification.kind_of?(String))
|
|
158
|
-
deprecated "refund should only be used to refund a referenced transaction"
|
|
158
|
+
ActiveMerchant.deprecated "refund should only be used to refund a referenced transaction"
|
|
159
159
|
return credit(money, identification, options)
|
|
160
160
|
end
|
|
161
161
|
|
|
@@ -174,7 +174,7 @@ module ActiveMerchant #:nodoc:
|
|
|
174
174
|
|
|
175
175
|
def credit(money, payment_object, options = {})
|
|
176
176
|
if(payment_object && payment_object.kind_of?(String))
|
|
177
|
-
deprecated "credit should only be used to credit a payment method"
|
|
177
|
+
ActiveMerchant.deprecated "credit should only be used to credit a payment method"
|
|
178
178
|
return refund(money, payment_object, options)
|
|
179
179
|
end
|
|
180
180
|
|
|
@@ -224,6 +224,8 @@ module ActiveMerchant #:nodoc:
|
|
|
224
224
|
# :rebill_amount => '39.95'
|
|
225
225
|
# A money object of 1995 cents would be passed into the 'money' parameter.
|
|
226
226
|
def recurring(money, payment_object, options = {})
|
|
227
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
228
|
+
|
|
227
229
|
requires!(options, :rebill_start_date, :rebill_expression)
|
|
228
230
|
options[:rebill] = true
|
|
229
231
|
if money
|
|
@@ -241,6 +243,8 @@ module ActiveMerchant #:nodoc:
|
|
|
241
243
|
#
|
|
242
244
|
# * <tt>rebill_id</tt> -- A string containing the rebill_id of the recurring billing that is already active (REQUIRED)
|
|
243
245
|
def status_recurring(rebill_id)
|
|
246
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
247
|
+
|
|
244
248
|
post = {}
|
|
245
249
|
requires!(rebill_id)
|
|
246
250
|
post[:REBILL_ID] = rebill_id
|
|
@@ -262,6 +266,8 @@ module ActiveMerchant #:nodoc:
|
|
|
262
266
|
# * <tt>:rebill_next_amount</tt> -- A string containing the next rebilling amount to charge the customer. This ONLY affects the next scheduled charge; all other rebillings will continue at the regular (rebill_amount) amount.
|
|
263
267
|
# Take a look above at the recurring_payment method for similar examples on how to use.
|
|
264
268
|
def update_recurring(options = {})
|
|
269
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
270
|
+
|
|
265
271
|
post = {}
|
|
266
272
|
requires!(options, :rebill_id)
|
|
267
273
|
post[:REBILL_ID] = options[:rebill_id]
|
|
@@ -282,6 +288,8 @@ module ActiveMerchant #:nodoc:
|
|
|
282
288
|
#
|
|
283
289
|
# * <tt>rebill_id</tt> -- A string containing the rebill_id of the recurring billing that you wish to cancel/stop (REQUIRED)
|
|
284
290
|
def cancel_recurring(rebill_id)
|
|
291
|
+
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
|
292
|
+
|
|
285
293
|
post = {}
|
|
286
294
|
requires!(rebill_id)
|
|
287
295
|
post[:REBILL_ID] = rebill_id
|
|
@@ -357,7 +365,7 @@ module ActiveMerchant #:nodoc:
|
|
|
357
365
|
else
|
|
358
366
|
message = message.chomp('.')
|
|
359
367
|
end
|
|
360
|
-
elsif message == "Missing ACCOUNT_ID"
|
|
368
|
+
elsif message == "Missing ACCOUNT_ID"
|
|
361
369
|
message = "The merchant login ID or password is invalid"
|
|
362
370
|
elsif message =~ /Approved/
|
|
363
371
|
message = "This transaction has been approved"
|
|
@@ -42,21 +42,9 @@ module ActiveMerchant #:nodoc:
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
def recurring(money, paysource, options = {})
|
|
46
|
-
money = amount(money)
|
|
47
|
-
case normalize(paysource)
|
|
48
|
-
when /1$/
|
|
49
|
-
Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
|
|
50
|
-
when /2$/
|
|
51
|
-
Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
|
|
52
|
-
else
|
|
53
|
-
raise Error, error_message(paysource)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
45
|
def credit(money, paysource, options = {})
|
|
58
46
|
if paysource.is_a?(String)
|
|
59
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
47
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
60
48
|
return refund(money, paysource, options)
|
|
61
49
|
end
|
|
62
50
|
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
require "nokogiri"
|
|
2
|
+
|
|
3
|
+
module ActiveMerchant #:nodoc:
|
|
4
|
+
module Billing #:nodoc:
|
|
5
|
+
class BorgunGateway < Gateway
|
|
6
|
+
self.display_name = "Borgun"
|
|
7
|
+
|
|
8
|
+
self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
|
|
9
|
+
self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization'
|
|
10
|
+
self.ssl_version = :SSLv3
|
|
11
|
+
|
|
12
|
+
self.supported_countries = ['IS']
|
|
13
|
+
self.default_currency = 'ISK'
|
|
14
|
+
self.money_format = :cents
|
|
15
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb]
|
|
16
|
+
|
|
17
|
+
self.homepage_url = 'https://www.borgun.is/'
|
|
18
|
+
|
|
19
|
+
def initialize(options={})
|
|
20
|
+
requires!(options, :processor, :merchant_id, :username, :password)
|
|
21
|
+
super
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def purchase(money, payment, options={})
|
|
25
|
+
post = {}
|
|
26
|
+
post[:TransType] = '1'
|
|
27
|
+
add_invoice(post, money, options)
|
|
28
|
+
add_payment_method(post, payment)
|
|
29
|
+
|
|
30
|
+
commit('sale', post)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def authorize(money, payment, options={})
|
|
34
|
+
post = {}
|
|
35
|
+
post[:TransType] = '5'
|
|
36
|
+
add_invoice(post, money, options)
|
|
37
|
+
add_payment_method(post, payment)
|
|
38
|
+
|
|
39
|
+
commit('authonly', post)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def capture(money, authorization, options={})
|
|
43
|
+
post = {}
|
|
44
|
+
post[:TransType] = '1'
|
|
45
|
+
add_invoice(post, money, options)
|
|
46
|
+
add_reference(post, authorization)
|
|
47
|
+
commit('capture', post)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def refund(money, authorization, options={})
|
|
51
|
+
post = {}
|
|
52
|
+
post[:TransType] = '3'
|
|
53
|
+
add_invoice(post, money, options)
|
|
54
|
+
add_reference(post, authorization)
|
|
55
|
+
commit('refund', post)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def void(authorization, options={})
|
|
59
|
+
post = {}
|
|
60
|
+
# TransType and TrAmount must match original values from auth or purchase.
|
|
61
|
+
_, _, _, _, _, transtype, tramount = split_authorization(authorization)
|
|
62
|
+
post[:TransType] = transtype
|
|
63
|
+
add_invoice(post, tramount.to_i, options)
|
|
64
|
+
add_reference(post, authorization)
|
|
65
|
+
commit('void', post)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
private
|
|
69
|
+
|
|
70
|
+
CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")}
|
|
71
|
+
CURRENCY_CODES["ISK"] = "352"
|
|
72
|
+
CURRENCY_CODES["EUR"] = "978"
|
|
73
|
+
|
|
74
|
+
def add_invoice(post, money, options)
|
|
75
|
+
post[:TrAmount] = amount(money)
|
|
76
|
+
post[:TrCurrency] = CURRENCY_CODES[options[:currency] || currency(money)]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def add_payment_method(post, payment_method)
|
|
80
|
+
post[:PAN] = payment_method.number
|
|
81
|
+
post[:ExpDate] = format(payment_method.year, :two_digits) + format(payment_method.month, :two_digits)
|
|
82
|
+
post[:CVC2] = payment_method.verification_value
|
|
83
|
+
post[:DateAndTime] = Time.now.strftime("%y%m%d%H%M%S")
|
|
84
|
+
post[:RRN] = 'AMRCNT' + six_random_digits
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def add_reference(post, authorization)
|
|
88
|
+
dateandtime, batch, transaction, rrn, authcode, _, _ = split_authorization(authorization)
|
|
89
|
+
post[:DateAndTime] = dateandtime
|
|
90
|
+
post[:Batch] = batch
|
|
91
|
+
post[:Transaction] = transaction
|
|
92
|
+
post[:RRN] = rrn
|
|
93
|
+
post[:AuthCode] = authcode
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def parse(xml)
|
|
97
|
+
response = {}
|
|
98
|
+
|
|
99
|
+
doc = Nokogiri::XML(CGI.unescapeHTML(xml))
|
|
100
|
+
body = doc.xpath('//getAuthorizationReply')
|
|
101
|
+
body = doc.xpath('//cancelAuthorizationReply') if body.length == 0
|
|
102
|
+
body.children.each do |node|
|
|
103
|
+
if node.text?
|
|
104
|
+
next
|
|
105
|
+
elsif (node.elements.size == 0)
|
|
106
|
+
response[node.name.downcase.to_sym] = node.text
|
|
107
|
+
else
|
|
108
|
+
node.elements.each do |childnode|
|
|
109
|
+
name = "#{node.name.downcase}_#{childnode.name.downcase}"
|
|
110
|
+
response[name.to_sym] = childnode.text
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
response
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def commit(action, post)
|
|
119
|
+
post[:Version] = '1000'
|
|
120
|
+
post[:Processor] = @options[:processor]
|
|
121
|
+
post[:MerchantID] = @options[:merchant_id]
|
|
122
|
+
post[:TerminalID] = 1
|
|
123
|
+
|
|
124
|
+
url = (test? ? test_url : live_url)
|
|
125
|
+
request = build_request(action, post)
|
|
126
|
+
raw = ssl_post(url(action), request, headers)
|
|
127
|
+
pairs = parse(raw)
|
|
128
|
+
success = success_from(pairs)
|
|
129
|
+
|
|
130
|
+
Response.new(
|
|
131
|
+
success,
|
|
132
|
+
message_from(success, pairs),
|
|
133
|
+
pairs,
|
|
134
|
+
authorization: authorization_from(pairs),
|
|
135
|
+
test: test?
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def success_from(response)
|
|
140
|
+
(response[:actioncode] == '000')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def message_from(succeeded, response)
|
|
144
|
+
if succeeded
|
|
145
|
+
"Succeeded"
|
|
146
|
+
else
|
|
147
|
+
response[:message] || "Error with ActionCode=#{response[:actioncode]}"
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def authorization_from(response)
|
|
152
|
+
[
|
|
153
|
+
response[:dateandtime],
|
|
154
|
+
response[:batch],
|
|
155
|
+
response[:transaction],
|
|
156
|
+
response[:rrn],
|
|
157
|
+
response[:authcode],
|
|
158
|
+
response[:transtype],
|
|
159
|
+
response[:tramount]
|
|
160
|
+
].join("|")
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def split_authorization(authorization)
|
|
164
|
+
dateandtime, batch, transaction, rrn, authcode, transtype, tramount = authorization.split("|")
|
|
165
|
+
[dateandtime, batch, transaction, rrn, authcode, transtype, tramount]
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def headers
|
|
169
|
+
{
|
|
170
|
+
'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s),
|
|
171
|
+
}
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def build_request(action, post)
|
|
175
|
+
mode = (action == 'void') ? 'cancel' : 'get'
|
|
176
|
+
xml = Builder::XmlMarkup.new :indent => 18
|
|
177
|
+
xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
178
|
+
xml.tag!("#{mode}Authorization") do
|
|
179
|
+
post.each do |field, value|
|
|
180
|
+
xml.tag!(field, value)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
inner = CGI.escapeHTML(xml.target!)
|
|
184
|
+
envelope(mode).sub(/{{ :body }}/,inner)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def envelope(mode)
|
|
188
|
+
<<-EOS
|
|
189
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://Borgun/Heimir/pub/ws/Authorization">
|
|
190
|
+
<soapenv:Header/>
|
|
191
|
+
<soapenv:Body>
|
|
192
|
+
<aut:#{mode}AuthorizationInput>
|
|
193
|
+
<#{mode}AuthReqXml>
|
|
194
|
+
{{ :body }}
|
|
195
|
+
</#{mode}AuthReqXml>
|
|
196
|
+
</aut:#{mode}AuthorizationInput>
|
|
197
|
+
</soapenv:Body>
|
|
198
|
+
</soapenv:Envelope>
|
|
199
|
+
EOS
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def url(action)
|
|
203
|
+
(test? ? test_url : live_url)
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def six_random_digits
|
|
207
|
+
(0...6).map { (48 + rand(10)).chr }.join
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
|
|
|
73
73
|
def capture(money, authorization, options = {})
|
|
74
74
|
commit do
|
|
75
75
|
result = @braintree_gateway.transaction.submit_for_settlement(authorization, amount(money).to_s)
|
|
76
|
-
|
|
76
|
+
response_from_result(result)
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
|
|
@@ -92,21 +92,20 @@ module ActiveMerchant #:nodoc:
|
|
|
92
92
|
money = amount(money).to_s if money
|
|
93
93
|
|
|
94
94
|
commit do
|
|
95
|
-
|
|
96
|
-
Response.new(result.success?, message_from_result(result),
|
|
97
|
-
{:braintree_transaction => (transaction_hash(result.transaction) if result.success?)},
|
|
98
|
-
{:authorization => (result.transaction.id if result.success?)}
|
|
99
|
-
)
|
|
95
|
+
response_from_result(@braintree_gateway.transaction.refund(transaction_id, money))
|
|
100
96
|
end
|
|
101
97
|
end
|
|
102
98
|
|
|
103
99
|
def void(authorization, options = {})
|
|
104
100
|
commit do
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
response_from_result(@braintree_gateway.transaction.void(authorization))
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def verify(credit_card, options = {})
|
|
106
|
+
MultiResponse.run(:use_first_response) do |r|
|
|
107
|
+
r.process { authorize(100, credit_card, options) }
|
|
108
|
+
r.process(:ignore_result) { void(r.authorization, options) }
|
|
110
109
|
end
|
|
111
110
|
end
|
|
112
111
|
|
|
@@ -137,6 +136,7 @@ module ActiveMerchant #:nodoc:
|
|
|
137
136
|
options.merge!(:update_existing_token => braintree_credit_card.token)
|
|
138
137
|
credit_card_params = merge_credit_card_options({
|
|
139
138
|
:credit_card => {
|
|
139
|
+
:cardholder_name => creditcard.name,
|
|
140
140
|
:number => creditcard.number,
|
|
141
141
|
:cvv => creditcard.verification_value,
|
|
142
142
|
:expiration_month => creditcard.month.to_s.rjust(2, "0"),
|
|
@@ -190,6 +190,7 @@ module ActiveMerchant #:nodoc:
|
|
|
190
190
|
:email => scrub_email(options[:email]),
|
|
191
191
|
:id => options[:customer],
|
|
192
192
|
:credit_card => {
|
|
193
|
+
:cardholder_name => creditcard.name,
|
|
193
194
|
:number => creditcard.number,
|
|
194
195
|
:cvv => creditcard.verification_value,
|
|
195
196
|
:expiration_month => creditcard.month.to_s.rjust(2, "0"),
|
|
@@ -214,6 +215,7 @@ module ActiveMerchant #:nodoc:
|
|
|
214
215
|
parameters = {
|
|
215
216
|
customer_id: options[:customer],
|
|
216
217
|
token: options[:credit_card_token],
|
|
218
|
+
cardholder_name: credit_card.name,
|
|
217
219
|
number: credit_card.number,
|
|
218
220
|
cvv: credit_card.verification_value,
|
|
219
221
|
expiration_month: credit_card.month.to_s.rjust(2, "0"),
|
|
@@ -258,6 +260,10 @@ module ActiveMerchant #:nodoc:
|
|
|
258
260
|
valid_options[key] = value if [:update_existing_token, :verify_card, :verification_merchant_account_id].include?(key)
|
|
259
261
|
end
|
|
260
262
|
|
|
263
|
+
if valid_options.include?(:verify_card) && @merchant_account_id
|
|
264
|
+
valid_options[:verification_merchant_account_id] ||= @merchant_account_id
|
|
265
|
+
end
|
|
266
|
+
|
|
261
267
|
parameters[:credit_card] ||= {}
|
|
262
268
|
parameters[:credit_card].merge!(:options => valid_options)
|
|
263
269
|
parameters[:credit_card][:billing_address] = map_address(options[:billing_address]) if options[:billing_address]
|
|
@@ -302,6 +308,13 @@ module ActiveMerchant #:nodoc:
|
|
|
302
308
|
end
|
|
303
309
|
end
|
|
304
310
|
|
|
311
|
+
def response_from_result(result)
|
|
312
|
+
Response.new(result.success?, message_from_result(result),
|
|
313
|
+
{ braintree_transaction: (transaction_hash(result.transaction) if result.success?) },
|
|
314
|
+
{ authorization: (result.transaction.id if result.success?) }
|
|
315
|
+
)
|
|
316
|
+
end
|
|
317
|
+
|
|
305
318
|
def response_params(result)
|
|
306
319
|
params = {}
|
|
307
320
|
if result.success?
|
|
@@ -467,7 +480,11 @@ module ActiveMerchant #:nodoc:
|
|
|
467
480
|
end
|
|
468
481
|
|
|
469
482
|
if credit_card_or_vault_id.is_a?(String) || credit_card_or_vault_id.is_a?(Integer)
|
|
470
|
-
|
|
483
|
+
if options[:payment_method_token]
|
|
484
|
+
parameters[:payment_method_token] = credit_card_or_vault_id
|
|
485
|
+
else
|
|
486
|
+
parameters[:customer_id] = credit_card_or_vault_id
|
|
487
|
+
end
|
|
471
488
|
else
|
|
472
489
|
parameters[:customer].merge!(
|
|
473
490
|
:first_name => credit_card_or_vault_id.first_name,
|
|
@@ -480,8 +497,9 @@ module ActiveMerchant #:nodoc:
|
|
|
480
497
|
:expiration_year => credit_card_or_vault_id.year.to_s
|
|
481
498
|
}
|
|
482
499
|
end
|
|
483
|
-
parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address]
|
|
500
|
+
parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address] && !options[:payment_method_token]
|
|
484
501
|
parameters[:shipping] = map_address(options[:shipping_address]) if options[:shipping_address]
|
|
502
|
+
parameters[:channel] = application_id if application_id.present? && application_id != "ActiveMerchant"
|
|
485
503
|
parameters
|
|
486
504
|
end
|
|
487
505
|
end
|