activemerchant 1.42.6 → 1.90.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 +5 -13
- data/CHANGELOG +1420 -2
- data/CONTRIBUTORS +106 -0
- data/README.md +107 -103
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +22 -0
- data/lib/active_merchant/billing/avs_result.rb +12 -13
- data/lib/active_merchant/billing/base.rb +13 -16
- data/lib/active_merchant/billing/check.rb +35 -24
- data/lib/active_merchant/billing/compatibility.rb +117 -0
- data/lib/active_merchant/billing/credit_card.rb +196 -81
- data/lib/active_merchant/billing/credit_card_formatting.rb +6 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +199 -75
- data/lib/active_merchant/billing/cvv_result.rb +15 -15
- data/lib/active_merchant/billing/gateway.rb +171 -39
- data/lib/active_merchant/billing/gateways/adyen.rb +380 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +933 -604
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +417 -0
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +74 -54
- data/lib/active_merchant/billing/gateways/axcessms.rb +181 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +130 -370
- data/lib/active_merchant/billing/gateways/bank_frick.rb +225 -0
- data/lib/active_merchant/billing/gateways/banwire.rb +23 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +351 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +109 -32
- data/lib/active_merchant/billing/gateways/beanstream.rb +59 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +12 -9
- data/lib/active_merchant/billing/gateways/blue_pay.rb +520 -498
- data/lib/active_merchant/billing/gateways/blue_snap.rb +347 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +80 -46
- data/lib/active_merchant/billing/gateways/borgun.rb +220 -0
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +15 -2
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +311 -121
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +4 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +244 -0
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +311 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +6 -7
- data/lib/active_merchant/billing/gateways/card_stream.rb +235 -89
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +254 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +219 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +50 -8
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -14
- data/lib/active_merchant/billing/gateways/cenpos.rb +327 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +214 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +233 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +22 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +220 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +142 -0
- data/lib/active_merchant/billing/gateways/conekta.rb +91 -97
- data/lib/active_merchant/billing/gateways/creditcall.rb +271 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +356 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +268 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +277 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +294 -158
- data/lib/active_merchant/billing/gateways/d_local.rb +226 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +59 -347
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +292 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +296 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +24 -39
- data/lib/active_merchant/billing/gateways/elavon.rb +146 -147
- data/lib/active_merchant/billing/gateways/element.rb +356 -0
- data/lib/active_merchant/billing/gateways/epay.rb +41 -31
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +79 -78
- data/lib/active_merchant/billing/gateways/eway_managed.rb +35 -36
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +369 -228
- data/lib/active_merchant/billing/gateways/exact.rb +32 -26
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +90 -64
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -14
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +142 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +128 -122
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +190 -64
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +446 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +215 -0
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +20 -0
- data/lib/active_merchant/billing/gateways/forte.rb +270 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +29 -27
- data/lib/active_merchant/billing/gateways/global_collect.rb +340 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +194 -0
- data/lib/active_merchant/billing/gateways/hdfc.rb +35 -36
- data/lib/active_merchant/billing/gateways/hps.rb +305 -0
- data/lib/active_merchant/billing/gateways/iats_payments.rb +271 -16
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +29 -32
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -6
- data/lib/active_merchant/billing/gateways/ipp.rb +175 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +247 -41
- data/lib/active_merchant/billing/gateways/itransact.rb +4 -5
- data/lib/active_merchant/billing/gateways/iveri.rb +251 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +198 -71
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +437 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +219 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +411 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +45 -43
- data/lib/active_merchant/billing/gateways/litle.rb +328 -444
- data/lib/active_merchant/billing/gateways/mastercard.rb +267 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +145 -115
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +277 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +37 -19
- data/lib/active_merchant/billing/gateways/merchant_one.rb +13 -15
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +57 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +59 -48
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +38 -19
- data/lib/active_merchant/billing/gateways/mercury.rb +77 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +11 -30
- data/lib/active_merchant/billing/gateways/micropayment.rb +183 -0
- data/lib/active_merchant/billing/gateways/migs.rb +81 -22
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +23 -25
- data/lib/active_merchant/billing/gateways/monei.rb +307 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +146 -64
- data/lib/active_merchant/billing/gateways/moneris_us.rb +197 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -15
- data/lib/active_merchant/billing/gateways/mundipagg.rb +292 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +86 -64
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +165 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +11 -5
- data/lib/active_merchant/billing/gateways/netaxept.rb +21 -22
- data/lib/active_merchant/billing/gateways/netbanx.rb +290 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +70 -35
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -6
- data/lib/active_merchant/billing/gateways/network_merchants.rb +241 -0
- data/lib/active_merchant/billing/gateways/nmi.rb +274 -10
- data/lib/active_merchant/billing/gateways/ogone.rb +90 -47
- data/lib/active_merchant/billing/gateways/omise.rb +324 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +48 -20
- data/lib/active_merchant/billing/gateways/opp.rb +369 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +79 -44
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +22 -21
- data/lib/active_merchant/billing/gateways/orbital.rb +346 -102
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +48 -29
- data/lib/active_merchant/billing/gateways/pagarme.rb +246 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +122 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +67 -48
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +20 -26
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +188 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +7 -15
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +40 -36
- data/lib/active_merchant/billing/gateways/payeezy.rb +410 -0
- data/lib/active_merchant/billing/gateways/payex.rb +38 -30
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +62 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +74 -27
- data/lib/active_merchant/billing/gateways/payflow_express.rb +77 -81
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -3
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +5 -6
- data/lib/active_merchant/billing/gateways/payment_express.rb +54 -45
- data/lib/active_merchant/billing/gateways/paymentez.rb +304 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +160 -66
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +54 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +17 -3
- data/lib/active_merchant/billing/gateways/paypal.rb +36 -27
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +7 -6
- data/lib/active_merchant/billing/gateways/paypal_express.rb +32 -4
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -88
- data/lib/active_merchant/billing/gateways/payu_in.rb +248 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +445 -0
- data/lib/active_merchant/billing/gateways/payway.rb +8 -8
- data/lib/active_merchant/billing/gateways/pin.rb +74 -18
- data/lib/active_merchant/billing/gateways/plugnpay.rb +66 -76
- data/lib/active_merchant/billing/gateways/pro_pay.rb +326 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +30 -30
- data/lib/active_merchant/billing/gateways/psl_card.rb +27 -34
- data/lib/active_merchant/billing/gateways/qbms.rb +65 -54
- data/lib/active_merchant/billing/gateways/quantum.rb +18 -18
- data/lib/active_merchant/billing/gateways/quickbooks.rb +290 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +295 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -350
- data/lib/active_merchant/billing/gateways/qvalent.rb +236 -0
- data/lib/active_merchant/billing/gateways/realex.rb +78 -48
- data/lib/active_merchant/billing/gateways/redsys.rb +310 -170
- data/lib/active_merchant/billing/gateways/s5.rb +246 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +262 -0
- data/lib/active_merchant/billing/gateways/sage.rb +415 -119
- data/lib/active_merchant/billing/gateways/sage_pay.rb +195 -90
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -12
- data/lib/active_merchant/billing/gateways/secure_net.rb +51 -43
- data/lib/active_merchant/billing/gateways/secure_pay.rb +182 -10
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -14
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +10 -18
- data/lib/active_merchant/billing/gateways/securion_pay.rb +264 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +35 -38
- data/lib/active_merchant/billing/gateways/smart_ps.rb +50 -42
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +9 -9
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +62 -12
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -103
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +12 -18
- data/lib/active_merchant/billing/gateways/telr.rb +274 -0
- data/lib/active_merchant/billing/gateways/tns.rb +22 -0
- data/lib/active_merchant/billing/gateways/trans_first.rb +143 -30
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +608 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +224 -0
- data/lib/active_merchant/billing/gateways/transax.rb +5 -6
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -232
- data/lib/active_merchant/billing/gateways/trexle.rb +218 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +86 -57
- data/lib/active_merchant/billing/gateways/usa_epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +196 -89
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +157 -32
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +42 -49
- data/lib/active_merchant/billing/gateways/viaklix.rb +11 -24
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +233 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +26 -28
- data/lib/active_merchant/billing/gateways/wepay.rb +237 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +153 -31
- data/lib/active_merchant/billing/gateways/world_net.rb +344 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +207 -63
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +215 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +221 -0
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +30 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +21 -0
- data/lib/active_merchant/billing/rails.rb +3 -0
- data/lib/active_merchant/billing/response.rb +31 -24
- data/lib/active_merchant/billing.rb +7 -1
- data/lib/active_merchant/connection.rb +195 -0
- data/lib/active_merchant/country.rb +335 -0
- data/lib/active_merchant/empty.rb +20 -0
- data/lib/active_merchant/errors.rb +35 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +10 -0
- data/lib/active_merchant/network_connection_retries.rb +80 -0
- data/lib/active_merchant/post_data.rb +25 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +23 -27
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3988 -0
- data/lib/support/gateway_support.rb +7 -9
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +6 -7
- data/lib/support/ssl_version.rb +87 -0
- metadata +148 -323
- checksums.yaml.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/app55.rb +0 -185
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -277
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -249
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- 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/gateways/sage/sage_bankcard.rb +0 -93
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/samurai.rb +0 -118
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -361
- data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +0 -31
- data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +0 -186
- data/lib/active_merchant/billing/integrations/a1agregator/status.rb +0 -38
- data/lib/active_merchant/billing/integrations/a1agregator.rb +0 -26
- data/lib/active_merchant/billing/integrations/action_view_helper.rb +0 -74
- data/lib/active_merchant/billing/integrations/alipay/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/alipay/notification.rb +0 -101
- data/lib/active_merchant/billing/integrations/alipay.rb +0 -18
- data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +0 -229
- data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +0 -340
- data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +0 -38
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +0 -64
- 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/bit_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/bogus/helper.rb +0 -17
- data/lib/active_merchant/billing/integrations/bogus/notification.rb +0 -11
- data/lib/active_merchant/billing/integrations/bogus/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/bogus.rb +0 -23
- data/lib/active_merchant/billing/integrations/chronopay/helper.rb +0 -120
- data/lib/active_merchant/billing/integrations/chronopay/notification.rb +0 -158
- data/lib/active_merchant/billing/integrations/chronopay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/chronopay.rb +0 -23
- data/lib/active_merchant/billing/integrations/citrus/helper.rb +0 -40
- 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/citrus.rb +0 -51
- data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +0 -200
- data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +0 -76
- data/lib/active_merchant/billing/integrations/direc_pay/return.rb +0 -32
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +0 -37
- data/lib/active_merchant/billing/integrations/direc_pay.rb +0 -41
- data/lib/active_merchant/billing/integrations/directebanking/helper.rb +0 -90
- data/lib/active_merchant/billing/integrations/directebanking/notification.rb +0 -120
- data/lib/active_merchant/billing/integrations/directebanking/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/directebanking.rb +0 -47
- data/lib/active_merchant/billing/integrations/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/doku.rb +0 -24
- data/lib/active_merchant/billing/integrations/dotpay/helper.rb +0 -77
- data/lib/active_merchant/billing/integrations/dotpay/notification.rb +0 -86
- data/lib/active_merchant/billing/integrations/dotpay/return.rb +0 -11
- data/lib/active_merchant/billing/integrations/dotpay.rb +0 -22
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +0 -23
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +0 -64
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +0 -49
- data/lib/active_merchant/billing/integrations/dwolla.rb +0 -23
- data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +0 -34
- data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +0 -84
- data/lib/active_merchant/billing/integrations/e_payment_plans.rb +0 -48
- data/lib/active_merchant/billing/integrations/easy_pay/common.rb +0 -40
- data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +0 -36
- data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/easy_pay.rb +0 -30
- data/lib/active_merchant/billing/integrations/epay/helper.rb +0 -55
- data/lib/active_merchant/billing/integrations/epay/notification.rb +0 -110
- data/lib/active_merchant/billing/integrations/epay.rb +0 -21
- data/lib/active_merchant/billing/integrations/first_data/helper.rb +0 -61
- data/lib/active_merchant/billing/integrations/first_data/notification.rb +0 -56
- data/lib/active_merchant/billing/integrations/first_data.rb +0 -38
- data/lib/active_merchant/billing/integrations/gestpay/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/gestpay/helper.rb +0 -70
- data/lib/active_merchant/billing/integrations/gestpay/notification.rb +0 -85
- data/lib/active_merchant/billing/integrations/gestpay/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/gestpay.rb +0 -25
- data/lib/active_merchant/billing/integrations/helper.rb +0 -117
- data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +0 -58
- data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/hi_trust/return.rb +0 -68
- data/lib/active_merchant/billing/integrations/hi_trust.rb +0 -27
- data/lib/active_merchant/billing/integrations/ipay88/helper.rb +0 -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/ipay88.rb +0 -23
- data/lib/active_merchant/billing/integrations/liqpay/helper.rb +0 -43
- data/lib/active_merchant/billing/integrations/liqpay/notification.rb +0 -89
- data/lib/active_merchant/billing/integrations/liqpay/return.rb +0 -83
- data/lib/active_merchant/billing/integrations/liqpay.rb +0 -30
- data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +0 -48
- data/lib/active_merchant/billing/integrations/maksuturva.rb +0 -86
- data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +0 -75
- data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +0 -123
- data/lib/active_merchant/billing/integrations/moneybookers.rb +0 -26
- data/lib/active_merchant/billing/integrations/nochex/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/nochex/notification.rb +0 -94
- data/lib/active_merchant/billing/integrations/nochex/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/nochex.rb +0 -88
- data/lib/active_merchant/billing/integrations/notification.rb +0 -71
- data/lib/active_merchant/billing/integrations/paxum/common.rb +0 -24
- data/lib/active_merchant/billing/integrations/paxum/helper.rb +0 -42
- data/lib/active_merchant/billing/integrations/paxum/notification.rb +0 -33
- data/lib/active_merchant/billing/integrations/paxum.rb +0 -44
- data/lib/active_merchant/billing/integrations/pay_fast/common.rb +0 -42
- data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +0 -134
- data/lib/active_merchant/billing/integrations/pay_fast/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/pay_fast.rb +0 -70
- data/lib/active_merchant/billing/integrations/paydollar/helper.rb +0 -41
- data/lib/active_merchant/billing/integrations/paydollar/notification.rb +0 -60
- data/lib/active_merchant/billing/integrations/paydollar/return.rb +0 -15
- data/lib/active_merchant/billing/integrations/paydollar.rb +0 -59
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +0 -116
- data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +0 -78
- data/lib/active_merchant/billing/integrations/payflow_link.rb +0 -21
- data/lib/active_merchant/billing/integrations/paypal/helper.rb +0 -119
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +0 -227
- data/lib/active_merchant/billing/integrations/paypal/return.rb +0 -10
- data/lib/active_merchant/billing/integrations/paypal.rb +0 -39
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +0 -20
- data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +0 -15
- data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +0 -39
- data/lib/active_merchant/billing/integrations/paysbuy.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.rb +0 -36
- 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/payu_in_paisa.rb +0 -30
- data/lib/active_merchant/billing/integrations/platron/helper.rb +0 -32
- data/lib/active_merchant/billing/integrations/platron/notification.rb +0 -113
- data/lib/active_merchant/billing/integrations/platron.rb +0 -28
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +0 -112
- data/lib/active_merchant/billing/integrations/pxpay/notification.rb +0 -157
- data/lib/active_merchant/billing/integrations/pxpay/return.rb +0 -25
- data/lib/active_merchant/billing/integrations/pxpay.rb +0 -31
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +0 -96
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +0 -137
- data/lib/active_merchant/billing/integrations/quickpay.rb +0 -21
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +0 -23
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +0 -91
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +0 -17
- data/lib/active_merchant/billing/integrations/return.rb +0 -42
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +0 -19
- data/lib/active_merchant/billing/integrations/robokassa/helper.rb +0 -50
- data/lib/active_merchant/billing/integrations/robokassa/notification.rb +0 -55
- data/lib/active_merchant/billing/integrations/robokassa/return.rb +0 -17
- data/lib/active_merchant/billing/integrations/robokassa.rb +0 -49
- data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +0 -33
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +0 -136
- data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +0 -210
- data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +0 -31
- data/lib/active_merchant/billing/integrations/sage_pay_form.rb +0 -37
- data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +0 -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/two_checkout.rb +0 -44
- data/lib/active_merchant/billing/integrations/valitor/helper.rb +0 -86
- data/lib/active_merchant/billing/integrations/valitor/notification.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +0 -97
- data/lib/active_merchant/billing/integrations/valitor/return.rb +0 -13
- data/lib/active_merchant/billing/integrations/valitor.rb +0 -33
- data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +0 -88
- data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +0 -59
- data/lib/active_merchant/billing/integrations/verkkomaksut.rb +0 -20
- data/lib/active_merchant/billing/integrations/web_pay/common.rb +0 -50
- data/lib/active_merchant/billing/integrations/web_pay/helper.rb +0 -68
- data/lib/active_merchant/billing/integrations/web_pay/notification.rb +0 -51
- data/lib/active_merchant/billing/integrations/web_pay.rb +0 -45
- data/lib/active_merchant/billing/integrations/webmoney/common.rb +0 -17
- data/lib/active_merchant/billing/integrations/webmoney/helper.rb +0 -40
- data/lib/active_merchant/billing/integrations/webmoney/notification.rb +0 -47
- data/lib/active_merchant/billing/integrations/webmoney.rb +0 -43
- data/lib/active_merchant/billing/integrations/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/wirecard_checkout_page.rb +0 -39
- data/lib/active_merchant/billing/integrations/world_pay/helper.rb +0 -101
- data/lib/active_merchant/billing/integrations/world_pay/notification.rb +0 -160
- data/lib/active_merchant/billing/integrations/world_pay.rb +0 -34
- data/lib/active_merchant/billing/integrations.rb +0 -17
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -1
|
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
|
|
|
5
5
|
module Billing #:nodoc:
|
|
6
6
|
# ==== USA ePay Advanced SOAP Interface
|
|
7
7
|
#
|
|
8
|
-
# This class
|
|
8
|
+
# This class encapsulates USA ePay's Advanced SOAP Interface. The Advanced Soap Interface allows
|
|
9
9
|
# standard transactions, storing customer information, and recurring billing. Storing sensitive
|
|
10
10
|
# information on USA ePay's servers can help with PCI DSS compliance, since customer and card data
|
|
11
11
|
# do not need to be stored locally.
|
|
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
|
|
|
62
62
|
# * {USA ePay Developer Login}[https://www.usaepay.com/developer/login]
|
|
63
63
|
#
|
|
64
64
|
class UsaEpayAdvancedGateway < Gateway
|
|
65
|
-
API_VERSION =
|
|
65
|
+
API_VERSION = '1.4'
|
|
66
66
|
|
|
67
67
|
TEST_URL_BASE = 'https://sandbox.usaepay.com/soap/gate/' #:nodoc:
|
|
68
68
|
LIVE_URL_BASE = 'https://www.usaepay.com/soap/gate/' #:nodoc:
|
|
@@ -70,19 +70,21 @@ module ActiveMerchant #:nodoc:
|
|
|
70
70
|
self.test_url = TEST_URL_BASE
|
|
71
71
|
self.live_url = LIVE_URL_BASE
|
|
72
72
|
|
|
73
|
-
FAILURE_MESSAGE =
|
|
73
|
+
FAILURE_MESSAGE = 'Default Failure' #:nodoc:
|
|
74
74
|
|
|
75
75
|
self.supported_countries = ['US']
|
|
76
76
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
|
|
77
77
|
self.homepage_url = 'http://www.usaepay.com/'
|
|
78
78
|
self.display_name = 'USA ePay Advanced SOAP Interface'
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
CUSTOMER_PROFILE_OPTIONS = {
|
|
81
81
|
:id => [:string, 'CustomerID'], # merchant assigned number
|
|
82
82
|
:notes => [:string, 'Notes'],
|
|
83
83
|
:data => [:string, 'CustomData'],
|
|
84
|
-
:url => [:string, 'URL']
|
|
85
|
-
|
|
84
|
+
:url => [:string, 'URL']
|
|
85
|
+
} #:nodoc:
|
|
86
|
+
|
|
87
|
+
CUSTOMER_RECURRING_BILLING_OPTIONS = {
|
|
86
88
|
:enabled => [:boolean, 'Enabled'],
|
|
87
89
|
:schedule => [:string, 'Schedule'],
|
|
88
90
|
:number_left => [:integer, 'NumLeft'],
|
|
@@ -92,18 +94,24 @@ module ActiveMerchant #:nodoc:
|
|
|
92
94
|
:user => [:string, 'User'],
|
|
93
95
|
:source => [:string, 'Source'],
|
|
94
96
|
:send_receipt => [:boolean, 'SendReceipt'],
|
|
95
|
-
:receipt_note => [:string, 'ReceiptNote']
|
|
96
|
-
|
|
97
|
+
:receipt_note => [:string, 'ReceiptNote']
|
|
98
|
+
} #:nodoc:
|
|
99
|
+
|
|
100
|
+
CUSTOMER_POINT_OF_SALE_OPTIONS = {
|
|
97
101
|
:price_tier => [:string, 'PriceTier'],
|
|
98
102
|
:tax_class => [:string, 'TaxClass'],
|
|
99
103
|
:lookup_code => [:string, 'LookupCode']
|
|
100
104
|
} #:nodoc:
|
|
101
105
|
|
|
102
|
-
|
|
106
|
+
CUSTOMER_OPTIONS = [
|
|
107
|
+
CUSTOMER_PROFILE_OPTIONS,
|
|
108
|
+
CUSTOMER_RECURRING_BILLING_OPTIONS,
|
|
109
|
+
CUSTOMER_POINT_OF_SALE_OPTIONS
|
|
110
|
+
].inject(:merge) #:nodoc:
|
|
111
|
+
|
|
112
|
+
COMMON_ADDRESS_OPTIONS = {
|
|
103
113
|
:first_name => [:string, 'FirstName'],
|
|
104
114
|
:last_name => [:string, 'LastName'],
|
|
105
|
-
:address1 => [:string, 'Street'],
|
|
106
|
-
:address2 => [:string, 'Street2'],
|
|
107
115
|
:city => [:string, 'City'],
|
|
108
116
|
:state => [:string, 'State'],
|
|
109
117
|
:zip => [:string, 'Zip'],
|
|
@@ -114,6 +122,32 @@ module ActiveMerchant #:nodoc:
|
|
|
114
122
|
:company => [:string, 'Company']
|
|
115
123
|
} #:nodoc:
|
|
116
124
|
|
|
125
|
+
ADDRESS_OPTIONS = [
|
|
126
|
+
COMMON_ADDRESS_OPTIONS,
|
|
127
|
+
{
|
|
128
|
+
:address1 => [:string, 'Street'],
|
|
129
|
+
:address2 => [:string, 'Street2'],
|
|
130
|
+
}
|
|
131
|
+
].inject(:merge) #:nodoc
|
|
132
|
+
|
|
133
|
+
CUSTOMER_UPDATE_DATA_FIELDS = [
|
|
134
|
+
CUSTOMER_PROFILE_OPTIONS,
|
|
135
|
+
CUSTOMER_RECURRING_BILLING_OPTIONS,
|
|
136
|
+
COMMON_ADDRESS_OPTIONS,
|
|
137
|
+
{
|
|
138
|
+
:address1 => [:string, 'Address'],
|
|
139
|
+
:address2 => [:string, 'Address2'],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
:card_number => [:string, 'CardNumber'],
|
|
143
|
+
:card_exp => [:string, 'CardExp'],
|
|
144
|
+
:account => [:string, 'Account'],
|
|
145
|
+
:routing => [:string, 'Routing'],
|
|
146
|
+
:check_format => [:string, 'CheckFormat'],
|
|
147
|
+
:record_type => [:string, 'RecordType'],
|
|
148
|
+
}
|
|
149
|
+
].inject(:merge) #:nodoc
|
|
150
|
+
|
|
117
151
|
CUSTOMER_TRANSACTION_REQUEST_OPTIONS = {
|
|
118
152
|
:command => [:string, 'Command'],
|
|
119
153
|
:ignore_duplicate => [:boolean, 'IgnoreDuplicate'],
|
|
@@ -238,8 +272,8 @@ module ActiveMerchant #:nodoc:
|
|
|
238
272
|
requires!(options, :login, :password)
|
|
239
273
|
|
|
240
274
|
if options[:software_id]
|
|
241
|
-
self.live_url = "#{LIVE_URL_BASE}#{options[:software_id]
|
|
242
|
-
self.test_url = "#{TEST_URL_BASE}#{options[:software_id]
|
|
275
|
+
self.live_url = "#{LIVE_URL_BASE}#{options[:software_id]}"
|
|
276
|
+
self.test_url = "#{TEST_URL_BASE}#{options[:software_id]}"
|
|
243
277
|
else
|
|
244
278
|
self.live_url = options[:live_url].to_s
|
|
245
279
|
self.test_url = options[:test_url].to_s if options[:test_url]
|
|
@@ -292,7 +326,7 @@ module ActiveMerchant #:nodoc:
|
|
|
292
326
|
end
|
|
293
327
|
|
|
294
328
|
def credit(money, identification, options={})
|
|
295
|
-
deprecated CREDIT_DEPRECATION_MESSAGE
|
|
329
|
+
ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
|
|
296
330
|
refund(money, identification, options)
|
|
297
331
|
end
|
|
298
332
|
|
|
@@ -354,6 +388,55 @@ module ActiveMerchant #:nodoc:
|
|
|
354
388
|
commit(__method__, request)
|
|
355
389
|
end
|
|
356
390
|
|
|
391
|
+
# Update a customer by replacing only the provided fields.
|
|
392
|
+
#
|
|
393
|
+
# ==== Required
|
|
394
|
+
# * <tt>:customer_number</tt> -- customer to update
|
|
395
|
+
# * <tt>:update_data</tt> -- FieldValue array of fields to retrieve
|
|
396
|
+
# * <tt>:first_name</tt>
|
|
397
|
+
# * <tt>:last_name</tt>
|
|
398
|
+
# * <tt>:id</tt>
|
|
399
|
+
# * <tt>:company</tt>
|
|
400
|
+
# * <tt>:address</tt>
|
|
401
|
+
# * <tt>:address2</tt>
|
|
402
|
+
# * <tt>:city</tt>
|
|
403
|
+
# * <tt>:state</tt>
|
|
404
|
+
# * <tt>:zip</tt>
|
|
405
|
+
# * <tt>:country</tt>
|
|
406
|
+
# * <tt>:phone</tt>
|
|
407
|
+
# * <tt>:fax</tt>
|
|
408
|
+
# * <tt>:email</tt>
|
|
409
|
+
# * <tt>:url</tt>
|
|
410
|
+
# * <tt>:receipt_note</tt>
|
|
411
|
+
# * <tt>:send_receipt</tt>
|
|
412
|
+
# * <tt>:notes</tt>
|
|
413
|
+
# * <tt>:description</tt>
|
|
414
|
+
# * <tt>:order_id</tt>
|
|
415
|
+
# * <tt>:enabled</tt>
|
|
416
|
+
# * <tt>:schedule</tt>
|
|
417
|
+
# * <tt>:next</tt>
|
|
418
|
+
# * <tt>:num_left</tt>
|
|
419
|
+
# * <tt>:amount</tt>
|
|
420
|
+
# * <tt>:custom_data</tt>
|
|
421
|
+
# * <tt>:source</tt>
|
|
422
|
+
# * <tt>:user</tt>
|
|
423
|
+
# * <tt>:card_number</tt>
|
|
424
|
+
# * <tt>:card_exp</tt>
|
|
425
|
+
# * <tt>:account</tt>
|
|
426
|
+
# * <tt>:routing</tt>
|
|
427
|
+
# * <tt>:check_format</tt> or <tt>:record_type</tt>
|
|
428
|
+
#
|
|
429
|
+
# ==== Response
|
|
430
|
+
# * <tt>#message</tt> -- boolean; Returns true if successful. Exception thrown all failures.
|
|
431
|
+
#
|
|
432
|
+
def quick_update_customer(options={})
|
|
433
|
+
requires! options, :customer_number
|
|
434
|
+
requires! options, :update_data
|
|
435
|
+
|
|
436
|
+
request = build_request(__method__, options)
|
|
437
|
+
commit(__method__, request)
|
|
438
|
+
end
|
|
439
|
+
|
|
357
440
|
# Enable a customer for recurring billing.
|
|
358
441
|
#
|
|
359
442
|
# Note: Customer does not need to have all recurring parameters to succeed.
|
|
@@ -403,7 +486,7 @@ module ActiveMerchant #:nodoc:
|
|
|
403
486
|
commit(__method__, request)
|
|
404
487
|
end
|
|
405
488
|
|
|
406
|
-
#
|
|
489
|
+
# Retrieve all of the payment methods belonging to a customer
|
|
407
490
|
#
|
|
408
491
|
# ==== Required
|
|
409
492
|
# * <tt>:customer_number</tt>
|
|
@@ -418,7 +501,7 @@ module ActiveMerchant #:nodoc:
|
|
|
418
501
|
commit(__method__, request)
|
|
419
502
|
end
|
|
420
503
|
|
|
421
|
-
#
|
|
504
|
+
# Retrieve one of the payment methods belonging to a customer
|
|
422
505
|
#
|
|
423
506
|
# ==== Required
|
|
424
507
|
# * <tt>:customer_number</tt>
|
|
@@ -949,14 +1032,14 @@ module ActiveMerchant #:nodoc:
|
|
|
949
1032
|
def build_request(action, options = {})
|
|
950
1033
|
soap = Builder::XmlMarkup.new
|
|
951
1034
|
soap.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
|
|
952
|
-
soap.tag!
|
|
1035
|
+
soap.tag! 'SOAP-ENV:Envelope',
|
|
953
1036
|
'xmlns:SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
|
954
1037
|
'xmlns:ns1' => 'urn:usaepay',
|
|
955
1038
|
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
|
956
1039
|
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
|
957
1040
|
'xmlns:SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/',
|
|
958
|
-
'SOAP-ENV:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' do
|
|
959
|
-
soap.tag!
|
|
1041
|
+
'SOAP-ENV:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' do
|
|
1042
|
+
soap.tag! 'SOAP-ENV:Body' do
|
|
960
1043
|
send("build_#{action}", soap, options)
|
|
961
1044
|
end
|
|
962
1045
|
end
|
|
@@ -972,12 +1055,12 @@ module ActiveMerchant #:nodoc:
|
|
|
972
1055
|
def build_token(soap, options)
|
|
973
1056
|
seed = SecureRandom.base64(32)
|
|
974
1057
|
hash = Digest::SHA1.hexdigest("#{@options[:login]}#{seed}#{@options[:password].to_s.strip}")
|
|
975
|
-
soap.Token 'xsi:type' => 'ns1:ueSecurityToken' do
|
|
1058
|
+
soap.Token 'xsi:type' => 'ns1:ueSecurityToken' do
|
|
976
1059
|
build_tag soap, :string, 'ClientIP', options[:client_ip]
|
|
977
|
-
soap.PinHash 'xsi:type' => 'ns1:ueHash' do
|
|
978
|
-
build_tag soap, :string,
|
|
979
|
-
build_tag soap, :string,
|
|
980
|
-
build_tag soap, :string,
|
|
1060
|
+
soap.PinHash 'xsi:type' => 'ns1:ueHash' do
|
|
1061
|
+
build_tag soap, :string, 'HashValue', hash
|
|
1062
|
+
build_tag soap, :string, 'Seed', seed
|
|
1063
|
+
build_tag soap, :string, 'Type', 'sha1'
|
|
981
1064
|
end
|
|
982
1065
|
build_tag soap, :string, 'SourceKey', @options[:login]
|
|
983
1066
|
end
|
|
@@ -986,17 +1069,17 @@ module ActiveMerchant #:nodoc:
|
|
|
986
1069
|
# Customer ======================================================
|
|
987
1070
|
|
|
988
1071
|
def build_add_customer(soap, options)
|
|
989
|
-
soap.tag!
|
|
1072
|
+
soap.tag! 'ns1:addCustomer' do
|
|
990
1073
|
build_token soap, options
|
|
991
1074
|
build_customer_data soap, options
|
|
992
1075
|
build_tag soap, :double, 'Amount', amount(options[:amount])
|
|
993
1076
|
build_tag soap, :double, 'Tax', amount(options[:tax])
|
|
994
|
-
build_tag soap, :string, 'Next', options[:next].strftime(
|
|
1077
|
+
build_tag soap, :string, 'Next', options[:next].strftime('%Y-%m-%d') if options[:next]
|
|
995
1078
|
end
|
|
996
1079
|
end
|
|
997
1080
|
|
|
998
1081
|
def build_customer(soap, options, type, add_customer_data=false)
|
|
999
|
-
soap.tag! "ns1:#{type}" do
|
|
1082
|
+
soap.tag! "ns1:#{type}" do
|
|
1000
1083
|
build_token soap, options
|
|
1001
1084
|
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
|
1002
1085
|
build_customer_data soap, options if add_customer_data
|
|
@@ -1019,8 +1102,16 @@ module ActiveMerchant #:nodoc:
|
|
|
1019
1102
|
build_customer(soap, options, 'deleteCustomer')
|
|
1020
1103
|
end
|
|
1021
1104
|
|
|
1105
|
+
def build_quick_update_customer(soap, options)
|
|
1106
|
+
soap.tag! 'ns1:quickUpdateCustomer' do
|
|
1107
|
+
build_token soap, options
|
|
1108
|
+
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
|
1109
|
+
build_field_value_array soap, 'UpdateData', 'FieldValue', options[:update_data], CUSTOMER_UPDATE_DATA_FIELDS
|
|
1110
|
+
end
|
|
1111
|
+
end
|
|
1112
|
+
|
|
1022
1113
|
def build_add_customer_payment_method(soap, options)
|
|
1023
|
-
soap.tag!
|
|
1114
|
+
soap.tag! 'ns1:addCustomerPaymentMethod' do
|
|
1024
1115
|
build_token soap, options
|
|
1025
1116
|
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
|
1026
1117
|
build_customer_payment_methods soap, options
|
|
@@ -1030,7 +1121,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1030
1121
|
end
|
|
1031
1122
|
|
|
1032
1123
|
def build_get_customer_payment_method(soap, options)
|
|
1033
|
-
soap.tag! 'ns1:getCustomerPaymentMethod' do
|
|
1124
|
+
soap.tag! 'ns1:getCustomerPaymentMethod' do
|
|
1034
1125
|
build_token soap, options
|
|
1035
1126
|
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
|
1036
1127
|
build_tag soap, :integer, 'MethodID', options[:method_id]
|
|
@@ -1042,7 +1133,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1042
1133
|
end
|
|
1043
1134
|
|
|
1044
1135
|
def build_update_customer_payment_method(soap, options)
|
|
1045
|
-
soap.tag! 'ns1:updateCustomerPaymentMethod' do
|
|
1136
|
+
soap.tag! 'ns1:updateCustomerPaymentMethod' do
|
|
1046
1137
|
build_token soap, options
|
|
1047
1138
|
build_customer_payment_methods soap, options
|
|
1048
1139
|
build_tag soap, :boolean, 'Verify', options[:verify]
|
|
@@ -1050,7 +1141,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1050
1141
|
end
|
|
1051
1142
|
|
|
1052
1143
|
def build_delete_customer_payment_method(soap, options)
|
|
1053
|
-
soap.tag!
|
|
1144
|
+
soap.tag! 'ns1:deleteCustomerPaymentMethod' do
|
|
1054
1145
|
build_token soap, options
|
|
1055
1146
|
build_tag soap, :integer, 'Custnum', options[:customer_number]
|
|
1056
1147
|
build_tag soap, :integer, 'PaymentMethodID', options[:method_id]
|
|
@@ -1058,7 +1149,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1058
1149
|
end
|
|
1059
1150
|
|
|
1060
1151
|
def build_run_customer_transaction(soap, options)
|
|
1061
|
-
soap.tag!
|
|
1152
|
+
soap.tag! 'ns1:runCustomerTransaction' do
|
|
1062
1153
|
build_token soap, options
|
|
1063
1154
|
build_tag soap, :integer, 'CustNum', options[:customer_number]
|
|
1064
1155
|
build_tag soap, :integer, 'PaymentMethodID', options[:method_id] || 0
|
|
@@ -1069,56 +1160,56 @@ module ActiveMerchant #:nodoc:
|
|
|
1069
1160
|
# Transactions ==================================================
|
|
1070
1161
|
|
|
1071
1162
|
def build_run_transaction(soap, options)
|
|
1072
|
-
soap.tag! 'ns1:runTransaction' do
|
|
1163
|
+
soap.tag! 'ns1:runTransaction' do
|
|
1073
1164
|
build_token soap, options
|
|
1074
1165
|
build_transaction_request_object soap, options, 'Parameters'
|
|
1075
1166
|
end
|
|
1076
1167
|
end
|
|
1077
1168
|
|
|
1078
1169
|
def build_run_sale(soap, options)
|
|
1079
|
-
soap.tag! 'ns1:runSale' do
|
|
1170
|
+
soap.tag! 'ns1:runSale' do
|
|
1080
1171
|
build_token soap, options
|
|
1081
1172
|
build_transaction_request_object soap, options
|
|
1082
1173
|
end
|
|
1083
1174
|
end
|
|
1084
1175
|
|
|
1085
1176
|
def build_run_auth_only(soap, options)
|
|
1086
|
-
soap.tag! 'ns1:runAuthOnly' do
|
|
1177
|
+
soap.tag! 'ns1:runAuthOnly' do
|
|
1087
1178
|
build_token soap, options
|
|
1088
1179
|
build_transaction_request_object soap, options
|
|
1089
1180
|
end
|
|
1090
1181
|
end
|
|
1091
1182
|
|
|
1092
1183
|
def build_run_credit(soap, options)
|
|
1093
|
-
soap.tag! 'ns1:runCredit' do
|
|
1184
|
+
soap.tag! 'ns1:runCredit' do
|
|
1094
1185
|
build_token soap, options
|
|
1095
1186
|
build_transaction_request_object soap, options
|
|
1096
1187
|
end
|
|
1097
1188
|
end
|
|
1098
1189
|
|
|
1099
1190
|
def build_run_check_sale(soap, options)
|
|
1100
|
-
soap.tag! 'ns1:runCheckSale' do
|
|
1191
|
+
soap.tag! 'ns1:runCheckSale' do
|
|
1101
1192
|
build_token soap, options
|
|
1102
1193
|
build_transaction_request_object soap, options
|
|
1103
1194
|
end
|
|
1104
1195
|
end
|
|
1105
1196
|
|
|
1106
1197
|
def build_run_check_credit(soap, options)
|
|
1107
|
-
soap.tag! 'ns1:runCheckCredit' do
|
|
1198
|
+
soap.tag! 'ns1:runCheckCredit' do
|
|
1108
1199
|
build_token soap, options
|
|
1109
1200
|
build_transaction_request_object soap, options
|
|
1110
1201
|
end
|
|
1111
1202
|
end
|
|
1112
1203
|
|
|
1113
1204
|
def build_post_auth(soap, options)
|
|
1114
|
-
soap.tag! 'ns1:postAuth' do
|
|
1205
|
+
soap.tag! 'ns1:postAuth' do
|
|
1115
1206
|
build_token soap, options
|
|
1116
1207
|
build_transaction_request_object soap, options
|
|
1117
1208
|
end
|
|
1118
1209
|
end
|
|
1119
1210
|
|
|
1120
1211
|
def build_run_quick_sale(soap, options)
|
|
1121
|
-
soap.tag! 'ns1:runQuickSale' do
|
|
1212
|
+
soap.tag! 'ns1:runQuickSale' do
|
|
1122
1213
|
build_token soap, options
|
|
1123
1214
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1124
1215
|
build_transaction_detail soap, options
|
|
@@ -1127,7 +1218,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1127
1218
|
end
|
|
1128
1219
|
|
|
1129
1220
|
def build_run_quick_credit(soap, options)
|
|
1130
|
-
soap.tag! 'ns1:runQuickCredit' do
|
|
1221
|
+
soap.tag! 'ns1:runQuickCredit' do
|
|
1131
1222
|
build_token soap, options
|
|
1132
1223
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1133
1224
|
build_transaction_detail soap, options
|
|
@@ -1135,21 +1226,21 @@ module ActiveMerchant #:nodoc:
|
|
|
1135
1226
|
end
|
|
1136
1227
|
|
|
1137
1228
|
def build_get_transaction(soap, options)
|
|
1138
|
-
soap.tag!
|
|
1229
|
+
soap.tag! 'ns1:getTransaction' do
|
|
1139
1230
|
build_token soap, options
|
|
1140
1231
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1141
1232
|
end
|
|
1142
1233
|
end
|
|
1143
1234
|
|
|
1144
1235
|
def build_get_transaction_status(soap, options)
|
|
1145
|
-
soap.tag!
|
|
1236
|
+
soap.tag! 'ns1:getTransactionStatus' do
|
|
1146
1237
|
build_token soap, options
|
|
1147
1238
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1148
1239
|
end
|
|
1149
1240
|
end
|
|
1150
1241
|
|
|
1151
1242
|
def build_get_transaction_custom(soap, options)
|
|
1152
|
-
soap.tag!
|
|
1243
|
+
soap.tag! 'ns1:getTransactionCustom' do
|
|
1153
1244
|
build_token soap, options
|
|
1154
1245
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1155
1246
|
build_transaction_field_array soap, options
|
|
@@ -1157,14 +1248,14 @@ module ActiveMerchant #:nodoc:
|
|
|
1157
1248
|
end
|
|
1158
1249
|
|
|
1159
1250
|
def build_get_check_trace(soap, options)
|
|
1160
|
-
soap.tag!
|
|
1251
|
+
soap.tag! 'ns1:getCheckTrace' do
|
|
1161
1252
|
build_token soap, options
|
|
1162
1253
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1163
1254
|
end
|
|
1164
1255
|
end
|
|
1165
1256
|
|
|
1166
1257
|
def build_capture_transaction(soap, options)
|
|
1167
|
-
soap.tag!
|
|
1258
|
+
soap.tag! 'ns1:captureTransaction' do
|
|
1168
1259
|
build_token soap, options
|
|
1169
1260
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1170
1261
|
build_tag soap, :double, 'Amount', amount(options[:amount])
|
|
@@ -1172,14 +1263,14 @@ module ActiveMerchant #:nodoc:
|
|
|
1172
1263
|
end
|
|
1173
1264
|
|
|
1174
1265
|
def build_void_transaction(soap, options)
|
|
1175
|
-
soap.tag!
|
|
1266
|
+
soap.tag! 'ns1:voidTransaction' do
|
|
1176
1267
|
build_token soap, options
|
|
1177
1268
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1178
1269
|
end
|
|
1179
1270
|
end
|
|
1180
1271
|
|
|
1181
1272
|
def build_refund_transaction(soap, options)
|
|
1182
|
-
soap.tag!
|
|
1273
|
+
soap.tag! 'ns1:refundTransaction' do
|
|
1183
1274
|
build_token soap, options
|
|
1184
1275
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1185
1276
|
build_tag soap, :integer, 'Amount', amount(options[:amount])
|
|
@@ -1187,7 +1278,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1187
1278
|
end
|
|
1188
1279
|
|
|
1189
1280
|
def build_override_transaction(soap, options)
|
|
1190
|
-
soap.tag!
|
|
1281
|
+
soap.tag! 'ns1:overrideTransaction' do
|
|
1191
1282
|
build_token soap, options
|
|
1192
1283
|
build_tag soap, :integer, 'RefNum', options[:reference_number]
|
|
1193
1284
|
build_tag soap, :string, 'Reason', options[:reason]
|
|
@@ -1197,7 +1288,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1197
1288
|
# Account =======================================================
|
|
1198
1289
|
|
|
1199
1290
|
def build_get_account_details(soap, options)
|
|
1200
|
-
soap.tag!
|
|
1291
|
+
soap.tag! 'ns1:getAccountDetails' do
|
|
1201
1292
|
build_token soap, options
|
|
1202
1293
|
end
|
|
1203
1294
|
end
|
|
@@ -1206,7 +1297,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1206
1297
|
|
|
1207
1298
|
def build_customer_data(soap, options)
|
|
1208
1299
|
soap.CustomerData 'xsi:type' => 'ns1:CustomerObject' do
|
|
1209
|
-
CUSTOMER_OPTIONS.each do |k,v|
|
|
1300
|
+
CUSTOMER_OPTIONS.each do |k, v|
|
|
1210
1301
|
build_tag soap, v[0], v[1], options[k]
|
|
1211
1302
|
end
|
|
1212
1303
|
build_billing_address soap, options
|
|
@@ -1219,7 +1310,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1219
1310
|
if options[:payment_methods]
|
|
1220
1311
|
length = options[:payment_methods].length
|
|
1221
1312
|
soap.PaymentMethods 'SOAP-ENC:arrayType' => "ns1:PaymentMethod[#{length}]",
|
|
1222
|
-
|
|
1313
|
+
'xsi:type' =>'ns1:PaymentMethodArray' do
|
|
1223
1314
|
build_customer_payment_methods soap, options
|
|
1224
1315
|
end
|
|
1225
1316
|
end
|
|
@@ -1266,7 +1357,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1266
1357
|
def build_customer_payment_methods(soap, options)
|
|
1267
1358
|
payment_methods, tag_name = extract_methods_and_tag(options)
|
|
1268
1359
|
payment_methods.each do |payment_method|
|
|
1269
|
-
soap.tag! tag_name, 'xsi:type' =>
|
|
1360
|
+
soap.tag! tag_name, 'xsi:type' => 'ns1:PaymentMethod' do
|
|
1270
1361
|
build_tag soap, :integer, 'MethodID', payment_method[:method_id]
|
|
1271
1362
|
build_tag soap, :string, 'MethodType', payment_method[:type]
|
|
1272
1363
|
build_tag soap, :string, 'MethodName', payment_method[:name]
|
|
@@ -1277,9 +1368,9 @@ module ActiveMerchant #:nodoc:
|
|
|
1277
1368
|
end
|
|
1278
1369
|
|
|
1279
1370
|
def build_customer_transaction(soap, options)
|
|
1280
|
-
soap.Parameters 'xsi:type' =>
|
|
1371
|
+
soap.Parameters 'xsi:type' => 'ns1:CustomerTransactionRequest' do
|
|
1281
1372
|
build_transaction_detail soap, options
|
|
1282
|
-
CUSTOMER_TRANSACTION_REQUEST_OPTIONS.each do |k,v|
|
|
1373
|
+
CUSTOMER_TRANSACTION_REQUEST_OPTIONS.each do |k, v|
|
|
1283
1374
|
build_tag soap, v[0], v[1], options[k]
|
|
1284
1375
|
end
|
|
1285
1376
|
build_custom_fields soap, options
|
|
@@ -1290,12 +1381,13 @@ module ActiveMerchant #:nodoc:
|
|
|
1290
1381
|
# Transaction Helpers ===========================================
|
|
1291
1382
|
|
|
1292
1383
|
def build_transaction_request_object(soap, options, name='Params')
|
|
1293
|
-
soap.tag! name, 'xsi:type' =>
|
|
1294
|
-
TRANSACTION_REQUEST_OBJECT_OPTIONS.each do |k,v|
|
|
1384
|
+
soap.tag! name, 'xsi:type' => 'ns1:TransactionRequestObject' do
|
|
1385
|
+
TRANSACTION_REQUEST_OBJECT_OPTIONS.each do |k, v|
|
|
1295
1386
|
build_tag soap, v[0], v[1], options[k]
|
|
1296
1387
|
end
|
|
1297
1388
|
case
|
|
1298
|
-
when options[:payment_method]
|
|
1389
|
+
when options[:payment_method].nil?
|
|
1390
|
+
nil
|
|
1299
1391
|
when options[:payment_method].kind_of?(ActiveMerchant::Billing::CreditCard)
|
|
1300
1392
|
build_credit_card_data soap, options
|
|
1301
1393
|
when options[:payment_method].kind_of?(ActiveMerchant::Billing::Check)
|
|
@@ -1313,18 +1405,18 @@ module ActiveMerchant #:nodoc:
|
|
|
1313
1405
|
end
|
|
1314
1406
|
|
|
1315
1407
|
def build_transaction_detail(soap, options)
|
|
1316
|
-
soap.Details 'xsi:type' =>
|
|
1317
|
-
TRANSACTION_DETAIL_OPTIONS.each do |k,v|
|
|
1408
|
+
soap.Details 'xsi:type' => 'ns1:TransactionDetail' do
|
|
1409
|
+
TRANSACTION_DETAIL_OPTIONS.each do |k, v|
|
|
1318
1410
|
build_tag soap, v[0], v[1], options[k]
|
|
1319
1411
|
end
|
|
1320
|
-
TRANSACTION_DETAIL_MONEY_OPTIONS.each do |k,v|
|
|
1412
|
+
TRANSACTION_DETAIL_MONEY_OPTIONS.each do |k, v|
|
|
1321
1413
|
build_tag soap, v[0], v[1], amount(options[k])
|
|
1322
1414
|
end
|
|
1323
1415
|
end
|
|
1324
1416
|
end
|
|
1325
1417
|
|
|
1326
1418
|
def build_credit_card_data(soap, options)
|
|
1327
|
-
soap.CreditCardData 'xsi:type' =>
|
|
1419
|
+
soap.CreditCardData 'xsi:type' => 'ns1:CreditCardData' do
|
|
1328
1420
|
build_tag soap, :string, 'CardNumber', options[:payment_method].number
|
|
1329
1421
|
build_tag soap, :string, 'CardExpiration', build_card_expiration(options)
|
|
1330
1422
|
if options[:billing_address]
|
|
@@ -1333,7 +1425,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1333
1425
|
end
|
|
1334
1426
|
build_tag soap, :string, 'CardCode', options[:payment_method].verification_value
|
|
1335
1427
|
build_tag soap, :boolean, 'CardPresent', options[:card_present] || false
|
|
1336
|
-
CREDIT_CARD_DATA_OPTIONS.each do |k,v|
|
|
1428
|
+
CREDIT_CARD_DATA_OPTIONS.each do |k, v|
|
|
1337
1429
|
build_tag soap, v[0], v[1], options[k]
|
|
1338
1430
|
end
|
|
1339
1431
|
end
|
|
@@ -1348,12 +1440,12 @@ module ActiveMerchant #:nodoc:
|
|
|
1348
1440
|
end
|
|
1349
1441
|
|
|
1350
1442
|
def build_check_data(soap, options)
|
|
1351
|
-
soap.CheckData 'xsi:type' =>
|
|
1443
|
+
soap.CheckData 'xsi:type' => 'ns1:CheckData' do
|
|
1352
1444
|
build_tag soap, :integer, 'CheckNumber', options[:payment_method].number
|
|
1353
1445
|
build_tag soap, :string, 'Account', options[:payment_method].account_number
|
|
1354
1446
|
build_tag soap, :string, 'Routing', options[:payment_method].routing_number
|
|
1355
1447
|
build_tag soap, :string, 'AccountType', options[:payment_method].account_type.capitalize
|
|
1356
|
-
CHECK_DATA_OPTIONS.each do |k,v|
|
|
1448
|
+
CHECK_DATA_OPTIONS.each do |k, v|
|
|
1357
1449
|
build_tag soap, v[0], v[1], options[k]
|
|
1358
1450
|
end
|
|
1359
1451
|
end
|
|
@@ -1361,11 +1453,11 @@ module ActiveMerchant #:nodoc:
|
|
|
1361
1453
|
|
|
1362
1454
|
def build_recurring_billing(soap, options)
|
|
1363
1455
|
if options[:recurring]
|
|
1364
|
-
soap.RecurringBilling 'xsi:type' =>
|
|
1456
|
+
soap.RecurringBilling 'xsi:type' => 'ns1:RecurringBilling' do
|
|
1365
1457
|
build_tag soap, :double, 'Amount', amount(options[:recurring][:amount])
|
|
1366
|
-
build_tag soap, :string, 'Next', options[:recurring][:next].strftime(
|
|
1367
|
-
build_tag soap, :string, 'Expire', options[:recurring][:expire].strftime(
|
|
1368
|
-
RECURRING_BILLING_OPTIONS.each do |k,v|
|
|
1458
|
+
build_tag soap, :string, 'Next', options[:recurring][:next].strftime('%Y-%m-%d') if options[:recurring][:next]
|
|
1459
|
+
build_tag soap, :string, 'Expire', options[:recurring][:expire].strftime('%Y-%m-%d') if options[:recurring][:expire]
|
|
1460
|
+
RECURRING_BILLING_OPTIONS.each do |k, v|
|
|
1369
1461
|
build_tag soap, v[0], v[1], options[:recurring][k]
|
|
1370
1462
|
end
|
|
1371
1463
|
end
|
|
@@ -1373,7 +1465,7 @@ module ActiveMerchant #:nodoc:
|
|
|
1373
1465
|
end
|
|
1374
1466
|
|
|
1375
1467
|
def build_transaction_field_array(soap, options)
|
|
1376
|
-
soap.Fields 'SOAP-ENC:arryType' => "xsd:string[#{options[:fields].length}]", 'xsi:type' => 'ns1:stringArray' do
|
|
1468
|
+
soap.Fields 'SOAP-ENC:arryType' => "xsd:string[#{options[:fields].length}]", 'xsi:type' => 'ns1:stringArray' do
|
|
1377
1469
|
options[:fields].each do |field|
|
|
1378
1470
|
build_tag soap, :string, 'item', field
|
|
1379
1471
|
end
|
|
@@ -1385,11 +1477,10 @@ module ActiveMerchant #:nodoc:
|
|
|
1385
1477
|
def build_billing_address(soap, options)
|
|
1386
1478
|
if options[:billing_address]
|
|
1387
1479
|
if options[:billing_address][:name]
|
|
1388
|
-
|
|
1389
|
-
options[:billing_address][:first_name], options[:billing_address][:last_name] = name[0], name[1]
|
|
1480
|
+
options[:billing_address][:first_name], options[:billing_address][:last_name] = split_names(options[:billing_address][:name])
|
|
1390
1481
|
end
|
|
1391
|
-
soap.BillingAddress 'xsi:type' =>
|
|
1392
|
-
ADDRESS_OPTIONS.each do |k,v|
|
|
1482
|
+
soap.BillingAddress 'xsi:type' => 'ns1:Address' do
|
|
1483
|
+
ADDRESS_OPTIONS.each do |k, v|
|
|
1393
1484
|
build_tag soap, v[0], v[1], options[:billing_address][k]
|
|
1394
1485
|
end
|
|
1395
1486
|
end
|
|
@@ -1399,17 +1490,31 @@ module ActiveMerchant #:nodoc:
|
|
|
1399
1490
|
def build_shipping_address(soap, options)
|
|
1400
1491
|
if options[:shipping_address]
|
|
1401
1492
|
if options[:shipping_address][:name]
|
|
1402
|
-
|
|
1403
|
-
options[:shipping_address][:first_name], options[:shipping_address][:last_name] = name[0], name[1]
|
|
1493
|
+
options[:shipping_address][:first_name], options[:shipping_address][:last_name] = split_names(options[:shipping_address][:name])
|
|
1404
1494
|
end
|
|
1405
|
-
soap.ShippingAddress 'xsi:type' =>
|
|
1406
|
-
ADDRESS_OPTIONS.each do |k,v|
|
|
1495
|
+
soap.ShippingAddress 'xsi:type' => 'ns1:Address' do
|
|
1496
|
+
ADDRESS_OPTIONS.each do |k, v|
|
|
1407
1497
|
build_tag soap, v[0], v[1], options[:shipping_address][k]
|
|
1408
1498
|
end
|
|
1409
1499
|
end
|
|
1410
1500
|
end
|
|
1411
1501
|
end
|
|
1412
1502
|
|
|
1503
|
+
def build_field_value_array(soap, tag_name, type, custom_data, fields)
|
|
1504
|
+
soap.tag! tag_name, 'SOAP-ENC:arryType' => "xsd:#{type}[#{options.length}]", 'xsi:type' => "ns1:#{type}Array" do
|
|
1505
|
+
custom_data.each do |k, v|
|
|
1506
|
+
build_field_value soap, fields[k][1], v, fields[k][0] if fields.key?(k)
|
|
1507
|
+
end
|
|
1508
|
+
end
|
|
1509
|
+
end
|
|
1510
|
+
|
|
1511
|
+
def build_field_value(soap, field, value, value_type)
|
|
1512
|
+
soap.FieldValue 'xsi:type' => 'ns1:FieldValue' do
|
|
1513
|
+
build_tag soap, :string, 'Field', field
|
|
1514
|
+
build_tag soap, value_type, 'Value', value
|
|
1515
|
+
end
|
|
1516
|
+
end
|
|
1517
|
+
|
|
1413
1518
|
def build_line_items(soap, options) # TODO
|
|
1414
1519
|
end
|
|
1415
1520
|
|
|
@@ -1422,22 +1527,25 @@ module ActiveMerchant #:nodoc:
|
|
|
1422
1527
|
url = test? ? test_url : live_url
|
|
1423
1528
|
|
|
1424
1529
|
begin
|
|
1425
|
-
soap = ssl_post(url, request,
|
|
1530
|
+
soap = ssl_post(url, request, 'Content-Type' => 'text/xml')
|
|
1426
1531
|
rescue ActiveMerchant::ResponseError => error
|
|
1427
1532
|
soap = error.response.body
|
|
1428
1533
|
end
|
|
1429
1534
|
|
|
1430
|
-
|
|
1535
|
+
build_response(action, soap)
|
|
1431
1536
|
end
|
|
1432
1537
|
|
|
1433
1538
|
def build_response(action, soap)
|
|
1434
1539
|
response_params, success, message, authorization, avs, cvv = parse(action, soap)
|
|
1435
1540
|
|
|
1436
|
-
response_params
|
|
1541
|
+
response_params['soap_response'] = soap if @options[:soap_response]
|
|
1437
1542
|
|
|
1438
|
-
|
|
1439
|
-
success,
|
|
1440
|
-
|
|
1543
|
+
Response.new(
|
|
1544
|
+
success,
|
|
1545
|
+
message,
|
|
1546
|
+
response_params,
|
|
1547
|
+
:test => test?,
|
|
1548
|
+
:authorization => authorization,
|
|
1441
1549
|
:avs_result => avs_from(avs),
|
|
1442
1550
|
:cvv_result => cvv
|
|
1443
1551
|
)
|
|
@@ -1445,23 +1553,23 @@ module ActiveMerchant #:nodoc:
|
|
|
1445
1553
|
|
|
1446
1554
|
def avs_from(avs)
|
|
1447
1555
|
avs_params = { :code => avs }
|
|
1448
|
-
avs_params
|
|
1556
|
+
avs_params[:message] = AVS_CUSTOM_MESSAGES[avs] if AVS_CUSTOM_MESSAGES.key?(avs)
|
|
1449
1557
|
avs_params
|
|
1450
1558
|
end
|
|
1451
1559
|
|
|
1452
1560
|
def parse(action, soap)
|
|
1453
1561
|
xml = REXML::Document.new(soap)
|
|
1454
|
-
root = REXML::XPath.first(xml,
|
|
1562
|
+
root = REXML::XPath.first(xml, '//SOAP-ENV:Body')
|
|
1455
1563
|
response = root ? parse_element(root[0]) : { :response => soap }
|
|
1456
1564
|
|
|
1457
1565
|
success, message, authorization, avs, cvv = false, FAILURE_MESSAGE, nil, nil, nil
|
|
1458
1566
|
|
|
1459
|
-
fault =
|
|
1567
|
+
fault = !response || (response.length < 1) || response.has_key?('faultcode')
|
|
1460
1568
|
return [response, success, response['faultstring'], authorization, avs, cvv] if fault
|
|
1461
1569
|
|
|
1462
1570
|
if response.respond_to?(:[]) && p = response["#{action}_return"]
|
|
1463
1571
|
if p.respond_to?(:key?) && p.key?('result_code')
|
|
1464
|
-
success = p['result_code'] == 'A'
|
|
1572
|
+
success = p['result_code'] == 'A'
|
|
1465
1573
|
authorization = p['ref_num']
|
|
1466
1574
|
avs = AVS_RESULTS[p['avs_result_code']]
|
|
1467
1575
|
cvv = p['card_code_result_code']
|
|
@@ -1510,4 +1618,3 @@ module ActiveMerchant #:nodoc:
|
|
|
1510
1618
|
end
|
|
1511
1619
|
end
|
|
1512
1620
|
end
|
|
1513
|
-
|