activemerchant 1.45.0 → 1.126.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +2167 -2
- data/CONTRIBUTORS +57 -0
- data/README.md +62 -41
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +11 -35
- data/lib/active_merchant/billing/check.rb +28 -24
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +141 -69
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +348 -52
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +125 -61
- data/lib/active_merchant/billing/gateways/adyen.rb +633 -127
- data/lib/active_merchant/billing/gateways/airwallex.rb +341 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +205 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +883 -195
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +104 -103
- data/lib/active_merchant/billing/gateways/axcessms.rb +179 -0
- data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
- data/lib/active_merchant/billing/gateways/banwire.rb +24 -13
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +397 -0
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
- data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +143 -62
- data/lib/active_merchant/billing/gateways/beanstream.rb +45 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +13 -10
- data/lib/active_merchant/billing/gateways/blue_pay.rb +549 -506
- data/lib/active_merchant/billing/gateways/blue_snap.rb +623 -0
- data/lib/active_merchant/billing/gateways/bogus.rb +82 -36
- data/lib/active_merchant/billing/gateways/borgun.rb +61 -40
- data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +21 -2
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +3 -3
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +592 -203
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -4
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +116 -61
- data/lib/active_merchant/billing/gateways/cams.rb +230 -0
- data/lib/active_merchant/billing/gateways/card_connect.rb +320 -0
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +248 -97
- data/lib/active_merchant/billing/gateways/cardknox.rb +327 -0
- data/lib/active_merchant/billing/gateways/cardprocess.rb +256 -0
- data/lib/active_merchant/billing/gateways/cashnet.rb +70 -26
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +73 -53
- data/lib/active_merchant/billing/gateways/cenpos.rb +328 -0
- data/lib/active_merchant/billing/gateways/checkout.rb +32 -33
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +340 -0
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +21 -0
- data/lib/active_merchant/billing/gateways/clearhaus.rb +219 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +55 -34
- data/lib/active_merchant/billing/gateways/creditcall.rb +272 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +506 -0
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +279 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +637 -221
- data/lib/active_merchant/billing/gateways/d_local.rb +303 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +57 -355
- data/lib/active_merchant/billing/gateways/decidir.rb +347 -0
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +199 -0
- data/lib/active_merchant/billing/gateways/digitzs.rb +295 -0
- data/lib/active_merchant/billing/gateways/ebanx.rb +334 -0
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +377 -250
- data/lib/active_merchant/billing/gateways/element.rb +386 -0
- data/lib/active_merchant/billing/gateways/epay.rb +92 -71
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +85 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +134 -80
- data/lib/active_merchant/billing/gateways/exact.rb +37 -36
- data/lib/active_merchant/billing/gateways/ezic.rb +195 -0
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +124 -74
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +4 -5
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +45 -23
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +184 -87
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -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 +286 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +31 -32
- data/lib/active_merchant/billing/gateways/global_collect.rb +507 -0
- data/lib/active_merchant/billing/gateways/global_transport.rb +25 -15
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +252 -68
- data/lib/active_merchant/billing/gateways/iats_payments.rb +99 -38
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +15 -0
- data/lib/active_merchant/billing/gateways/inspire.rb +48 -48
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +415 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +176 -0
- data/lib/active_merchant/billing/gateways/iridium.rb +254 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +254 -0
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +200 -80
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +432 -0
- data/lib/active_merchant/billing/gateways/komoju.rb +115 -0
- data/lib/active_merchant/billing/gateways/kushki.rb +277 -0
- data/lib/active_merchant/billing/gateways/latitude19.rb +412 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +95 -85
- data/lib/active_merchant/billing/gateways/litle.rb +371 -94
- data/lib/active_merchant/billing/gateways/mastercard.rb +293 -0
- data/lib/active_merchant/billing/gateways/maxipago.rb +146 -123
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +331 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +47 -23
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +60 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +76 -23
- data/lib/active_merchant/billing/gateways/mercury.rb +73 -54
- data/lib/active_merchant/billing/gateways/metrics_global.rb +33 -43
- data/lib/active_merchant/billing/gateways/micropayment.rb +182 -0
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +101 -37
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +3 -3
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +30 -34
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +422 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +236 -72
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +363 -0
- data/lib/active_merchant/billing/gateways/nab_transact.rb +87 -68
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +163 -0
- data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
- data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
- data/lib/active_merchant/billing/gateways/netbanx.rb +376 -0
- data/lib/active_merchant/billing/gateways/netbilling.rb +82 -43
- data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
- data/lib/active_merchant/billing/gateways/nmi.rb +279 -174
- data/lib/active_merchant/billing/gateways/ogone.rb +96 -50
- data/lib/active_merchant/billing/gateways/omise.rb +323 -0
- data/lib/active_merchant/billing/gateways/openpay.rb +58 -23
- data/lib/active_merchant/billing/gateways/opp.rb +394 -0
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +87 -69
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +771 -328
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +31 -32
- data/lib/active_merchant/billing/gateways/pagarme.rb +239 -0
- data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +245 -0
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +84 -68
- data/lib/active_merchant/billing/gateways/pay_hub.rb +213 -0
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +206 -0
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +404 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +85 -49
- data/lib/active_merchant/billing/gateways/payeezy.rb +458 -0
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +67 -41
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +215 -46
- data/lib/active_merchant/billing/gateways/payflow_express.rb +64 -68
- 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 +78 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +353 -0
- data/lib/active_merchant/billing/gateways/paymill.rb +163 -75
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +55 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal.rb +37 -18
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +5 -5
- data/lib/active_merchant/billing/gateways/paypal_express.rb +12 -6
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +3 -3
- data/lib/active_merchant/billing/gateways/paysafe.rb +412 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +96 -91
- data/lib/active_merchant/billing/gateways/payu_in.rb +249 -0
- data/lib/active_merchant/billing/gateways/payu_latam.rb +479 -0
- data/lib/active_merchant/billing/gateways/payway.rb +27 -27
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +113 -37
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +369 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +325 -0
- data/lib/active_merchant/billing/gateways/psigate.rb +55 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +32 -40
- data/lib/active_merchant/billing/gateways/qbms.rb +86 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- data/lib/active_merchant/billing/gateways/quickbooks.rb +377 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +184 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +297 -0
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +226 -0
- data/lib/active_merchant/billing/gateways/quickpay.rb +10 -353
- data/lib/active_merchant/billing/gateways/qvalent.rb +305 -0
- data/lib/active_merchant/billing/gateways/rapyd.rb +258 -0
- data/lib/active_merchant/billing/gateways/realex.rb +154 -52
- data/lib/active_merchant/billing/gateways/redsys.rb +488 -161
- data/lib/active_merchant/billing/gateways/s5.rb +247 -0
- data/lib/active_merchant/billing/gateways/safe_charge.rb +298 -0
- data/lib/active_merchant/billing/gateways/sage.rb +404 -133
- data/lib/active_merchant/billing/gateways/sage_pay.rb +145 -109
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +62 -54
- data/lib/active_merchant/billing/gateways/secure_pay.rb +32 -42
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +36 -27
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +265 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +362 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -54
- data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +108 -43
- data/lib/active_merchant/billing/gateways/stripe.rb +536 -120
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +516 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +19 -25
- data/lib/active_merchant/billing/gateways/telr.rb +273 -0
- data/lib/active_merchant/billing/gateways/tns.rb +16 -217
- data/lib/active_merchant/billing/gateways/trans_first.rb +148 -34
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +612 -0
- data/lib/active_merchant/billing/gateways/transact_pro.rb +222 -0
- data/lib/active_merchant/billing/gateways/transax.rb +6 -8
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +221 -0
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +162 -89
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +332 -236
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +185 -72
- data/lib/active_merchant/billing/gateways/vanco.rb +294 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +19 -31
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +250 -0
- data/lib/active_merchant/billing/gateways/vpos.rb +220 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +108 -62
- data/lib/active_merchant/billing/gateways/wirecard.rb +52 -43
- data/lib/active_merchant/billing/gateways/wompi.rb +193 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +345 -0
- data/lib/active_merchant/billing/gateways/worldpay.rb +725 -121
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +208 -0
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +79 -39
- data/lib/active_merchant/billing/gateways.rb +8 -11
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +39 -0
- data/lib/active_merchant/billing/payment_token.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +19 -13
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +3 -0
- data/lib/active_merchant/connection.rb +196 -0
- data/lib/active_merchant/country.rb +13 -8
- data/lib/active_merchant/errors.rb +6 -0
- data/lib/active_merchant/net_http_ssl_connection.rb +11 -0
- data/lib/active_merchant/network_connection_retries.rb +78 -0
- data/lib/active_merchant/post_data.rb +26 -0
- data/lib/active_merchant/posts_data.rb +92 -0
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +14 -59
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +3214 -0
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/outbound_hosts.rb +13 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +86 -0
- metadata +136 -94
- checksums.yaml.gz.sig +0 -1
- data/lib/active_merchant/billing/gateways/app55.rb +0 -176
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +0 -314
- data/lib/active_merchant/billing/gateways/certo_direct.rb +0 -278
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- 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/moneris_us.rb +0 -291
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +0 -87
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +0 -114
- data/lib/active_merchant/billing/gateways/sage/sage_vault.rb +0 -149
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +0 -102
- data/lib/active_merchant/billing/gateways/vindicia.rb +0 -385
- data/lib/active_merchant/offsite_payments_shim.rb +0 -19
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
@@ -1,385 +0,0 @@
|
|
1
|
-
require 'i18n/core_ext/string/interpolate'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
|
6
|
-
# For more information on the Vindicia Gateway please visit their {website}[http://vindicia.com/]
|
7
|
-
#
|
8
|
-
# The login and password are not the username and password you use to
|
9
|
-
# login to the Vindicia Merchant Portal.
|
10
|
-
#
|
11
|
-
# ==== Recurring Billing
|
12
|
-
#
|
13
|
-
# AutoBills are an feature of Vindicia's API that allows for creating and managing subscriptions.
|
14
|
-
#
|
15
|
-
# For more information about Vindicia's API and various other services visit their {Resource Center}[http://www.vindicia.com/resources/index.html]
|
16
|
-
class VindiciaGateway < Gateway
|
17
|
-
self.supported_countries = %w{US CA GB AU MX BR DE KR CN HK}
|
18
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
19
|
-
self.homepage_url = 'http://www.vindicia.com/'
|
20
|
-
self.display_name = 'Vindicia'
|
21
|
-
|
22
|
-
class_attribute :test_url, :live_url
|
23
|
-
|
24
|
-
self.test_url = "https://soap.prodtest.sj.vindicia.com/soap.pl"
|
25
|
-
self.live_url = "http://soap.vindicia.com/soap.pl"
|
26
|
-
|
27
|
-
# Creates a new VindiciaGateway
|
28
|
-
#
|
29
|
-
# The gateway requires that a valid login and password be passed
|
30
|
-
# in the +options+ hash.
|
31
|
-
#
|
32
|
-
# ==== Options
|
33
|
-
#
|
34
|
-
# * <tt>:login</tt> -- Vindicia SOAP login (REQUIRED)
|
35
|
-
# * <tt>:password</tt> -- Vindicia SOAP password (REQUIRED)
|
36
|
-
# * <tt>:api_version</tt> -- Vindicia API Version - defaults to 3.6 (OPTIONAL)
|
37
|
-
# * <tt>:account_id</tt> -- Account Id which all transactions will be run against. (REQUIRED)
|
38
|
-
# * <tt>:transaction_prefix</tt> -- Prefix to order id for one-time transactions - defaults to 'X' (OPTIONAL
|
39
|
-
# * <tt>:min_chargeback_probability</tt> -- Minimum score for chargebacks - defaults to 65 (OPTIONAL)
|
40
|
-
# * <tt>:cvn_success</tt> -- Array of valid CVN Check return values - defaults to [M, P] (OPTIONAL)
|
41
|
-
# * <tt>:avs_success</tt> -- Array of valid AVS Check return values - defaults to [X, Y, A, W, Z] (OPTIONAL)
|
42
|
-
def initialize(options = {})
|
43
|
-
requires!(options, :login, :password, :account_id)
|
44
|
-
super
|
45
|
-
|
46
|
-
@account_id = options[:account_id]
|
47
|
-
|
48
|
-
@transaction_prefix = options[:transaction_prefix] || "X"
|
49
|
-
|
50
|
-
@min_chargeback_probability = options[:min_chargeback_probability] || 65
|
51
|
-
@cvn_success = options[:cvn_success] || %w{M P}
|
52
|
-
@avs_success = options[:avs_success] || %w{X Y A W Z}
|
53
|
-
|
54
|
-
@allowed_authorization_statuses = %w{Authorized}
|
55
|
-
end
|
56
|
-
|
57
|
-
# Perform a purchase, which is essentially an authorization and capture in a single operation.
|
58
|
-
#
|
59
|
-
# ==== Parameters
|
60
|
-
#
|
61
|
-
# * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
|
62
|
-
# * <tt>creditcard</tt> -- The CreditCard details for the transaction.
|
63
|
-
# * <tt>options</tt> -- A hash of optional parameters.
|
64
|
-
def purchase(money, creditcard, options = {})
|
65
|
-
response = authorize(money, creditcard, options)
|
66
|
-
return response if !response.success? || response.fraud_review?
|
67
|
-
|
68
|
-
capture(money, response.authorization, options)
|
69
|
-
end
|
70
|
-
|
71
|
-
# Performs an authorization, which reserves the funds on the customer's credit card, but does not
|
72
|
-
# charge the card.
|
73
|
-
#
|
74
|
-
# ==== Parameters
|
75
|
-
#
|
76
|
-
# * <tt>money</tt> -- The amount to be authorized as an Integer value in cents.
|
77
|
-
# * <tt>creditcard</tt> -- The CreditCard details for the transaction.
|
78
|
-
# * <tt>options</tt> -- A hash of optional parameters.
|
79
|
-
def authorize(money, creditcard, options = {})
|
80
|
-
vindicia_transaction = authorize_transaction(money, creditcard, options)
|
81
|
-
response = check_transaction(vindicia_transaction)
|
82
|
-
|
83
|
-
# if this response is under fraud review because of our AVS/CVV checks void the transaction
|
84
|
-
if !response.success? && response.fraud_review? && !response.authorization.blank?
|
85
|
-
void_response = void([vindicia_transaction[:transaction][:merchantTransactionId]], options)
|
86
|
-
if void_response.success?
|
87
|
-
return response
|
88
|
-
else
|
89
|
-
return void_response
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
response
|
94
|
-
end
|
95
|
-
|
96
|
-
# Captures the funds from an authorized transaction.
|
97
|
-
#
|
98
|
-
# ==== Parameters
|
99
|
-
#
|
100
|
-
# * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
|
101
|
-
# * <tt>identification</tt> -- The authorization returned from the previous authorize request.
|
102
|
-
def capture(money, identification, options = {})
|
103
|
-
response = post(:capture) do |xml|
|
104
|
-
add_hash(xml, transactions: [{ merchantTransactionId: identification }])
|
105
|
-
end
|
106
|
-
|
107
|
-
if response[:return][:returnCode] != '200' || response[:qtyFail].to_i > 0
|
108
|
-
return fail(response)
|
109
|
-
end
|
110
|
-
|
111
|
-
success(response, identification)
|
112
|
-
end
|
113
|
-
|
114
|
-
# Void a previous transaction
|
115
|
-
#
|
116
|
-
# ==== Parameters
|
117
|
-
#
|
118
|
-
# * <tt>identification</tt> - The authorization returned from the previous authorize request.
|
119
|
-
# * <tt>options</tt> - Extra options (currently only :ip used)
|
120
|
-
def void(identification, options = {})
|
121
|
-
response = post(:cancel) do |xml|
|
122
|
-
add_hash(xml, transactions: [{
|
123
|
-
account: {merchantAccountId: @account_id},
|
124
|
-
merchantTransactionId: identification,
|
125
|
-
sourceIp: options[:ip]
|
126
|
-
}])
|
127
|
-
end
|
128
|
-
|
129
|
-
if response[:return][:returnCode] == '200' && response[:qtyFail].to_i == 0
|
130
|
-
success(response, identification)
|
131
|
-
else
|
132
|
-
fail(response)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
# Perform a recurring billing, which is essentially a purchase and autobill setup in a single operation.
|
137
|
-
#
|
138
|
-
# ==== Parameters
|
139
|
-
#
|
140
|
-
# * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
|
141
|
-
# * <tt>creditcard</tt> -- The CreditCard details for the transaction.
|
142
|
-
# * <tt>options</tt> -- A hash of parameters.
|
143
|
-
#
|
144
|
-
# ==== Options
|
145
|
-
#
|
146
|
-
# * <tt>:product_sku</tt> -- The subscription product's sku
|
147
|
-
# * <tt>:autobill_prefix</tt> -- Prefix to order id for subscriptions - defaults to 'A' (OPTIONAL)
|
148
|
-
def recurring(money, creditcard, options={})
|
149
|
-
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
|
150
|
-
|
151
|
-
options[:recurring] = true
|
152
|
-
@autobill_prefix = options[:autobill_prefix] || "A"
|
153
|
-
|
154
|
-
response = authorize(money, creditcard, options)
|
155
|
-
return response if !response.success? || response.fraud_review?
|
156
|
-
|
157
|
-
capture_resp = capture(money, response.authorization, options)
|
158
|
-
return capture_resp if !response.success?
|
159
|
-
|
160
|
-
# Setting up a recurring AutoBill requires an associated product
|
161
|
-
requires!(options, :product_sku)
|
162
|
-
autobill_response = check_subscription(authorize_subscription(options.merge(:product_sku => options[:product_sku])))
|
163
|
-
|
164
|
-
if autobill_response.success?
|
165
|
-
autobill_response
|
166
|
-
else
|
167
|
-
# If the AutoBill fails to set-up, void the transaction and return it as the response
|
168
|
-
void_response = void(capture_resp.authorization, options)
|
169
|
-
if void_response.success?
|
170
|
-
return autobill_response
|
171
|
-
else
|
172
|
-
return void_response
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
private
|
178
|
-
|
179
|
-
def add_hash(xml, hash)
|
180
|
-
hash.each do |k,v|
|
181
|
-
add_element(xml, k, v)
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
def add_array(xml, elem, val)
|
186
|
-
val.each do |v|
|
187
|
-
add_element(xml, elem, v)
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
def add_element(xml, elem, val)
|
192
|
-
if val.is_a?(Hash)
|
193
|
-
xml.tag!(elem.to_s.camelize(:lower)) do |env|
|
194
|
-
add_hash(env, val)
|
195
|
-
end
|
196
|
-
elsif val.is_a?(Array)
|
197
|
-
add_array(xml, elem, val)
|
198
|
-
else
|
199
|
-
xml.tag!(elem.to_s.camelize(:lower), val.to_s)
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
|
-
def post(action, kind="Transaction")
|
204
|
-
xml = Builder::XmlMarkup.new
|
205
|
-
xml.instruct!(:xml, :encoding => "UTF-8")
|
206
|
-
xml.env :Envelope,
|
207
|
-
"xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
|
208
|
-
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
209
|
-
"xmlns:tns" => "http://soap.vindicia.com/v3_6/#{kind}",
|
210
|
-
"xmlns:env" => "http://schemas.xmlsoap.org/soap/envelope/" do
|
211
|
-
|
212
|
-
xml.env :Body do
|
213
|
-
xml.tns action.to_sym do
|
214
|
-
xml.auth do
|
215
|
-
xml.tag! :login, @options[:login]
|
216
|
-
xml.tag! :password, @options[:password]
|
217
|
-
xml.tag! :version, "3.6"
|
218
|
-
end
|
219
|
-
|
220
|
-
yield(xml)
|
221
|
-
end
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
|
-
url = (test? ? self.test_url : self.live_url)
|
226
|
-
parse(ssl_post(url, xml.target!, "Content-Type" => "text/xml"))
|
227
|
-
end
|
228
|
-
|
229
|
-
def parse(response)
|
230
|
-
# Vindicia always returns in the form of request_type_response => { actual_response }
|
231
|
-
Hash.from_xml(response)["Envelope"]["Body"].values.first.with_indifferent_access
|
232
|
-
end
|
233
|
-
|
234
|
-
def check_transaction(vindicia_transaction)
|
235
|
-
if vindicia_transaction[:return][:returnCode] == '200'
|
236
|
-
status_log = vindicia_transaction[:transaction][:statusLog].first
|
237
|
-
if status_log[:creditCardStatus]
|
238
|
-
avs = status_log[:creditCardStatus][:avsCode]
|
239
|
-
cvn = status_log[:creditCardStatus][:cvnCode]
|
240
|
-
end
|
241
|
-
|
242
|
-
if @allowed_authorization_statuses.include?(status_log[:status]) &&
|
243
|
-
check_cvn(cvn) && check_avs(avs)
|
244
|
-
|
245
|
-
success(vindicia_transaction,
|
246
|
-
vindicia_transaction[:transaction][:merchantTransactionId],
|
247
|
-
avs, cvn)
|
248
|
-
else
|
249
|
-
# If the transaction is authorized, but it didn't pass our AVS/CVV checks send the authorization along so
|
250
|
-
# that is gets voided. Otherwise, send no authorization.
|
251
|
-
fail(vindicia_transaction, avs, cvn, false,
|
252
|
-
@allowed_authorization_statuses.include?(status_log[:status]) ? vindicia_transaction[:transaction][:merchantTransactionId] : "")
|
253
|
-
end
|
254
|
-
else
|
255
|
-
# 406 = Chargeback risk score is higher than minChargebackProbability, transaction not authorized.
|
256
|
-
fail(vindicia_transaction, nil, nil, vindicia_transaction[:return][:return_code] == '406')
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
def authorize_transaction(money, creditcard, options)
|
261
|
-
parameters = {
|
262
|
-
:amount => amount(money),
|
263
|
-
:currency => options[:currency] || currency(money)
|
264
|
-
}
|
265
|
-
|
266
|
-
add_account_data(parameters, options)
|
267
|
-
add_customer_data(parameters, options)
|
268
|
-
add_payment_source(parameters, creditcard, options)
|
269
|
-
|
270
|
-
post(:auth) do |xml|
|
271
|
-
add_hash(xml, transaction: parameters, minChargebackProbability: @min_chargeback_probability)
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
def add_account_data(parameters, options)
|
276
|
-
parameters[:account] = { :merchantAccountId => @account_id }
|
277
|
-
parameters[:sourceIp] = options[:ip] if options[:ip]
|
278
|
-
end
|
279
|
-
|
280
|
-
def add_customer_data(parameters, options)
|
281
|
-
parameters[:merchantTransactionId] = transaction_id(options[:order_id])
|
282
|
-
parameters[:shippingAddress] = convert_am_address_to_vindicia(options[:shipping_address])
|
283
|
-
|
284
|
-
# Transaction items must be provided for tax purposes
|
285
|
-
requires!(options, :line_items)
|
286
|
-
parameters[:transactionItems] = options[:line_items]
|
287
|
-
|
288
|
-
if options[:recurring]
|
289
|
-
parameters[:nameValues] = [{:name => 'merchantAutoBillIdentifier', :value => autobill_id(options[:order_id])}]
|
290
|
-
end
|
291
|
-
end
|
292
|
-
|
293
|
-
def add_payment_source(parameters, creditcard, options)
|
294
|
-
parameters[:sourcePaymentMethod] = {
|
295
|
-
:type => 'CreditCard',
|
296
|
-
:creditCard => { :account => creditcard.number, :expirationDate => "%4d%02d" % [creditcard.year, creditcard.month] },
|
297
|
-
:accountHolderName => creditcard.name,
|
298
|
-
:nameValues => [{ :name => 'CVN', :value => creditcard.verification_value }],
|
299
|
-
:billingAddress => convert_am_address_to_vindicia(options[:billing_address] || options[:address]),
|
300
|
-
:customerSpecifiedType => creditcard.brand.capitalize,
|
301
|
-
:active => !!options[:recurring]
|
302
|
-
}
|
303
|
-
end
|
304
|
-
|
305
|
-
def authorize_subscription(options)
|
306
|
-
parameters = {}
|
307
|
-
|
308
|
-
add_account_data(parameters, options)
|
309
|
-
add_subscription_information(parameters, options)
|
310
|
-
|
311
|
-
post(:update, "AutoBill") do |xml|
|
312
|
-
add_hash(xml, autobill: parameters, validatePaymentMethod: false, minChargebackProbability: 100)
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
def check_subscription(vindicia_transaction)
|
317
|
-
if vindicia_transaction[:return][:returnCode] == '200'
|
318
|
-
if vindicia_transaction[:autobill] && vindicia_transaction[:autobill][:status] == "Active"
|
319
|
-
success(vindicia_transaction,
|
320
|
-
vindicia_transaction[:autobill][:merchantAutoBillId])
|
321
|
-
else
|
322
|
-
fail(vindicia_transaction)
|
323
|
-
end
|
324
|
-
else
|
325
|
-
fail(vindicia_transaction)
|
326
|
-
end
|
327
|
-
end
|
328
|
-
|
329
|
-
def add_subscription_information(parameters, options)
|
330
|
-
requires!(options, :product_sku)
|
331
|
-
|
332
|
-
if options[:shipping_address]
|
333
|
-
parameters[:account][:shipping_address] = options[:shipping_address]
|
334
|
-
end
|
335
|
-
|
336
|
-
parameters[:merchantAutoBillId] = autobill_id(options[:order_id])
|
337
|
-
parameters[:product] = { :merchantProductId => options[:product_sku] }
|
338
|
-
end
|
339
|
-
|
340
|
-
def check_avs(avs)
|
341
|
-
avs.blank? || @avs_success.include?(avs)
|
342
|
-
end
|
343
|
-
|
344
|
-
def check_cvn(cvn)
|
345
|
-
cvn.blank? || @cvn_success.include?(cvn)
|
346
|
-
end
|
347
|
-
|
348
|
-
def success(response, authorization, avs_code = nil, cvn_code = nil)
|
349
|
-
ActiveMerchant::Billing::Response.new(true, response[:return][:returnString], response,
|
350
|
-
{ :fraud_review => false, :authorization => authorization, :test => test?,
|
351
|
-
:avs_result => { :code => avs_code }, :cvv_result => cvn_code })
|
352
|
-
end
|
353
|
-
|
354
|
-
def fail(response, avs_code = nil, cvn_code = nil, fraud_review = false, authorization = "")
|
355
|
-
ActiveMerchant::Billing::Response.new(false, response[:return][:returnString], response,
|
356
|
-
{ :fraud_review => fraud_review || !authorization.blank?,
|
357
|
-
:authorization => authorization, :test => test?,
|
358
|
-
:avs_result => { :code => avs_code }, :cvv_result => cvn_code })
|
359
|
-
|
360
|
-
end
|
361
|
-
|
362
|
-
def autobill_id(order_id)
|
363
|
-
"#{@autobill_prefix}#{order_id}"
|
364
|
-
end
|
365
|
-
|
366
|
-
def transaction_id(order_id)
|
367
|
-
"#{@transaction_prefix}#{order_id}"
|
368
|
-
end
|
369
|
-
|
370
|
-
# Converts valid ActiveMerchant address hash to proper Vindicia format
|
371
|
-
def convert_am_address_to_vindicia(address)
|
372
|
-
return if address.nil?
|
373
|
-
|
374
|
-
convs = { :address1 => :addr1, :address2 => :addr2,
|
375
|
-
:state => :district, :zip => :postalCode }
|
376
|
-
|
377
|
-
vindicia_address = {}
|
378
|
-
address.each do |key, val|
|
379
|
-
vindicia_address[convs[key] || key] = val
|
380
|
-
end
|
381
|
-
vindicia_address
|
382
|
-
end
|
383
|
-
end
|
384
|
-
end
|
385
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require "offsite_payments"
|
2
|
-
|
3
|
-
module ActiveMerchant
|
4
|
-
module OffsitePaymentsShim
|
5
|
-
ActionViewHelper = ::OffsitePayments::ActionViewHelper
|
6
|
-
Helper = ::OffsitePayments::Helper
|
7
|
-
Notification = ::OffsitePayments::Notification
|
8
|
-
Return = ::OffsitePayments::Return
|
9
|
-
ActionViewHelperError = ::OffsitePayments::ActionViewHelperError
|
10
|
-
|
11
|
-
include ::OffsitePayments::Integrations
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module OffsitePayments
|
16
|
-
def self.mode
|
17
|
-
ActiveMerchant::Billing::Base.integration_mode
|
18
|
-
end
|
19
|
-
end
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|