activemerchant 1.133.0 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +450 -0
- data/CONTRIBUTORS +1 -0
- data/lib/active_merchant/billing/apple_pay_payment_token.rb +2 -2
- data/lib/active_merchant/billing/base.rb +2 -2
- data/lib/active_merchant/billing/check.rb +16 -4
- data/lib/active_merchant/billing/compatibility.rb +4 -4
- data/lib/active_merchant/billing/credit_card.rb +35 -16
- data/lib/active_merchant/billing/credit_card_formatting.rb +13 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +74 -19
- data/lib/active_merchant/billing/gateway.rb +22 -2
- data/lib/active_merchant/billing/gateways/adyen.rb +282 -87
- data/lib/active_merchant/billing/gateways/airwallex.rb +46 -25
- data/lib/active_merchant/billing/gateways/alelo.rb +29 -11
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +49 -41
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +14 -10
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -5
- data/lib/active_merchant/billing/gateways/axcessms.rb +9 -5
- data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/banwire.rb +6 -4
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +2 -2
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +12 -8
- data/lib/active_merchant/billing/gateways/beanstream.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +2 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +15 -7
- data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -5
- data/lib/active_merchant/billing/gateways/bogus.rb +2 -2
- data/lib/active_merchant/billing/gateways/borgun.rb +2 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +3 -1
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +68 -23
- data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +266 -89
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -3
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/cams.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_connect.rb +7 -4
- data/lib/active_merchant/billing/gateways/card_save.rb +2 -2
- data/lib/active_merchant/billing/gateways/card_stream.rb +12 -13
- data/lib/active_merchant/billing/gateways/cardknox.rb +2 -2
- data/lib/active_merchant/billing/gateways/cardprocess.rb +2 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +4 -4
- data/lib/active_merchant/billing/gateways/cc5.rb +2 -2
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +331 -0
- data/lib/active_merchant/billing/gateways/cecabank/cecabank_xml.rb +220 -0
- data/lib/active_merchant/billing/gateways/cecabank.rb +9 -242
- data/lib/active_merchant/billing/gateways/cenpos.rb +9 -3
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +362 -50
- data/lib/active_merchant/billing/gateways/clearhaus.rb +2 -2
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +117 -35
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
- data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
- data/lib/active_merchant/billing/gateways/credorax.rb +109 -20
- data/lib/active_merchant/billing/gateways/ct_payment.rb +6 -6
- data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/cyber_source.rb +379 -100
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +147 -76
- data/lib/active_merchant/billing/gateways/d_local.rb +45 -22
- data/lib/active_merchant/billing/gateways/data_cash.rb +22 -18
- data/lib/active_merchant/billing/gateways/datatrans.rb +284 -0
- data/lib/active_merchant/billing/gateways/decidir.rb +82 -46
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +31 -35
- data/lib/active_merchant/billing/gateways/deepstack.rb +382 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +3 -3
- data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
- data/lib/active_merchant/billing/gateways/ebanx.rb +116 -68
- data/lib/active_merchant/billing/gateways/efsnet.rb +13 -8
- data/lib/active_merchant/billing/gateways/elavon.rb +80 -47
- data/lib/active_merchant/billing/gateways/element.rb +39 -10
- data/lib/active_merchant/billing/gateways/epay.rb +8 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway.rb +6 -4
- data/lib/active_merchant/billing/gateways/eway_managed.rb +8 -4
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +3 -3
- data/lib/active_merchant/billing/gateways/exact.rb +8 -4
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +37 -7
- data/lib/active_merchant/billing/gateways/federated_canada.rb +8 -4
- data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_giving.rb +2 -2
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_common.rb +15 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +190 -0
- data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +183 -0
- data/lib/active_merchant/billing/gateways/first_pay.rb +8 -174
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +8 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +9 -5
- data/lib/active_merchant/billing/gateways/flex_charge.rb +359 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -2
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +6 -4
- data/lib/active_merchant/billing/gateways/fortis.rb +347 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +6 -4
- data/lib/active_merchant/billing/gateways/global_collect.rb +69 -50
- data/lib/active_merchant/billing/gateways/global_transport.rb +2 -2
- data/lib/active_merchant/billing/gateways/hdfc.rb +2 -2
- data/lib/active_merchant/billing/gateways/hi_pay.rb +287 -0
- data/lib/active_merchant/billing/gateways/hps.rb +40 -47
- data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/inspire.rb +8 -6
- data/lib/active_merchant/billing/gateways/instapay.rb +9 -6
- data/lib/active_merchant/billing/gateways/ipg.rb +14 -10
- data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +18 -8
- data/lib/active_merchant/billing/gateways/itransact.rb +8 -4
- data/lib/active_merchant/billing/gateways/iveri.rb +12 -9
- data/lib/active_merchant/billing/gateways/ixopay.rb +4 -4
- data/lib/active_merchant/billing/gateways/jetpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +9 -6
- data/lib/active_merchant/billing/gateways/komoju.rb +2 -2
- data/lib/active_merchant/billing/gateways/kushki.rb +79 -16
- data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
- data/lib/active_merchant/billing/gateways/linkpoint.rb +8 -4
- data/lib/active_merchant/billing/gateways/litle.rb +37 -54
- data/lib/active_merchant/billing/gateways/loan_payment_pro.rb +267 -0
- data/lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb +93 -0
- data/lib/active_merchant/billing/gateways/mastercard.rb +4 -4
- data/lib/active_merchant/billing/gateways/maxipago.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +32 -11
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +10 -7
- data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +2 -2
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +13 -6
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +13 -6
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -5
- data/lib/active_merchant/billing/gateways/mercury.rb +11 -5
- data/lib/active_merchant/billing/gateways/metrics_global.rb +10 -8
- data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -6
- data/lib/active_merchant/billing/gateways/migs.rb +8 -4
- data/lib/active_merchant/billing/gateways/mit.rb +10 -5
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +21 -13
- data/lib/active_merchant/billing/gateways/moka.rb +2 -2
- data/lib/active_merchant/billing/gateways/monei.rb +3 -3
- data/lib/active_merchant/billing/gateways/moneris.rb +11 -5
- data/lib/active_merchant/billing/gateways/money_movers.rb +8 -4
- data/lib/active_merchant/billing/gateways/multi_pay.rb +267 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +5 -3
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -10
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/net_registry.rb +6 -2
- data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
- data/lib/active_merchant/billing/gateways/netbanx.rb +4 -6
- data/lib/active_merchant/billing/gateways/netbilling.rb +8 -4
- data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/network_merchants.rb +9 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +29 -8
- data/lib/active_merchant/billing/gateways/nuvei.rb +573 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +8 -4
- data/lib/active_merchant/billing/gateways/omise.rb +2 -2
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +3 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +12 -6
- data/lib/active_merchant/billing/gateways/orbital/orbital_codes.rb +273 -0
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +114 -94
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +9 -6
- data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
- data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_arc.rb +9 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +6 -4
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -5
- data/lib/active_merchant/billing/gateways/pay_junction.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
- data/lib/active_merchant/billing/gateways/pay_secure.rb +8 -4
- data/lib/active_merchant/billing/gateways/pay_trace.rb +36 -22
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +14 -14
- data/lib/active_merchant/billing/gateways/payeezy.rb +26 -13
- data/lib/active_merchant/billing/gateways/payex.rb +8 -6
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow.rb +12 -11
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +10 -6
- data/lib/active_merchant/billing/gateways/paymentez.rb +30 -16
- data/lib/active_merchant/billing/gateways/paymill.rb +6 -4
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +17 -12
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal.rb +4 -2
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -2
- data/lib/active_merchant/billing/gateways/paysafe.rb +48 -24
- data/lib/active_merchant/billing/gateways/payscout.rb +9 -6
- data/lib/active_merchant/billing/gateways/paystation.rb +9 -5
- data/lib/active_merchant/billing/gateways/payu_in.rb +2 -2
- data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -5
- data/lib/active_merchant/billing/gateways/payway.rb +6 -2
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +126 -41
- data/lib/active_merchant/billing/gateways/plexo.rb +71 -20
- data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -2
- data/lib/active_merchant/billing/gateways/priority.rb +29 -24
- data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/psigate.rb +8 -4
- data/lib/active_merchant/billing/gateways/psl_card.rb +6 -2
- data/lib/active_merchant/billing/gateways/qbms.rb +9 -5
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +27 -17
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -4
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +8 -4
- data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +2 -2
- data/lib/active_merchant/billing/gateways/rapyd.rb +172 -53
- data/lib/active_merchant/billing/gateways/reach.rb +16 -9
- data/lib/active_merchant/billing/gateways/redsys.rb +7 -15
- data/lib/active_merchant/billing/gateways/redsys_rest.rb +545 -0
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +47 -24
- data/lib/active_merchant/billing/gateways/sage.rb +14 -6
- data/lib/active_merchant/billing/gateways/sage_pay.rb +81 -7
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +8 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +9 -5
- data/lib/active_merchant/billing/gateways/secure_pay.rb +10 -8
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -15
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +8 -4
- data/lib/active_merchant/billing/gateways/securion_pay.rb +26 -12
- data/lib/active_merchant/billing/gateways/shift4.rb +34 -26
- data/lib/active_merchant/billing/gateways/shift4_v2.rb +117 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +26 -17
- data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -4
- data/lib/active_merchant/billing/gateways/smart_ps.rb +10 -7
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -4
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -6
- data/lib/active_merchant/billing/gateways/stripe.rb +88 -84
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +388 -77
- data/lib/active_merchant/billing/gateways/sum_up.rb +224 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +6 -4
- data/lib/active_merchant/billing/gateways/telr.rb +6 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +6 -4
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +10 -18
- data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
- data/lib/active_merchant/billing/gateways/transax.rb +2 -2
- data/lib/active_merchant/billing/gateways/transnational.rb +2 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +9 -5
- data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -31
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -4
- data/lib/active_merchant/billing/gateways/vanco.rb +2 -4
- data/lib/active_merchant/billing/gateways/vantiv_express.rb +668 -0
- data/lib/active_merchant/billing/gateways/verifi.rb +12 -8
- data/lib/active_merchant/billing/gateways/versa_pay.rb +307 -0
- data/lib/active_merchant/billing/gateways/viaklix.rb +8 -4
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +5 -5
- data/lib/active_merchant/billing/gateways/vpos.rb +25 -13
- data/lib/active_merchant/billing/gateways/webpay.rb +3 -3
- data/lib/active_merchant/billing/gateways/wepay.rb +6 -4
- data/lib/active_merchant/billing/gateways/wirecard.rb +10 -6
- data/lib/active_merchant/billing/gateways/wompi.rb +14 -7
- data/lib/active_merchant/billing/gateways/world_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/worldpay.rb +297 -113
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +16 -13
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/gateways/xpay.rb +244 -0
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +15 -3
- data/lib/active_merchant/billing/payment_token.rb +2 -2
- data/lib/active_merchant/billing/response.rb +7 -6
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +8 -20
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +12 -2
- data/lib/active_merchant/net_http_ssl_connection.rb +35 -0
- data/lib/active_merchant/posts_data.rb +19 -4
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant/versionable.rb +29 -0
- data/lib/certs/cacert.pem +1326 -1491
- data/lib/support/gateway_support.rb +3 -3
- data/lib/support/ssl_verify.rb +6 -6
- data/lib/support/ssl_version.rb +8 -8
- metadata +35 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'rexml/document'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class VerifiGateway < Gateway
|
|
6
6
|
class VerifiPostData < PostData
|
|
7
7
|
# Fields that will be sent even if they are blank
|
|
@@ -180,10 +180,10 @@ module ActiveMerchant #:nodoc:
|
|
|
180
180
|
# MD5(username|password|orderid|amount|time)
|
|
181
181
|
now = Time.now.to_i.to_s
|
|
182
182
|
md5 = Digest::MD5.new
|
|
183
|
-
md5 << @options[:login].to_s + '|'
|
|
184
|
-
md5 << @options[:password].to_s + '|'
|
|
185
|
-
md5 << options[:order_id].to_s + '|'
|
|
186
|
-
md5 << amount(money).to_s + '|'
|
|
183
|
+
md5 << (@options[:login].to_s + '|')
|
|
184
|
+
md5 << (@options[:password].to_s + '|')
|
|
185
|
+
md5 << (options[:order_id].to_s + '|')
|
|
186
|
+
md5 << (amount(money).to_s + '|')
|
|
187
187
|
md5 << now
|
|
188
188
|
post[:key] = md5.hexdigest
|
|
189
189
|
post[:time] = now
|
|
@@ -194,11 +194,15 @@ module ActiveMerchant #:nodoc:
|
|
|
194
194
|
|
|
195
195
|
response = parse(ssl_post(self.live_url, post_data(trx_type, post)))
|
|
196
196
|
|
|
197
|
-
Response.new(
|
|
197
|
+
Response.new(
|
|
198
|
+
response[:response].to_i == SUCCESS,
|
|
199
|
+
message_from(response),
|
|
200
|
+
response,
|
|
198
201
|
test: test?,
|
|
199
202
|
authorization: response[:transactionid],
|
|
200
203
|
avs_result: { code: response[:avsresponse] },
|
|
201
|
-
cvv_result: response[:cvvresponse]
|
|
204
|
+
cvv_result: response[:cvvresponse]
|
|
205
|
+
)
|
|
202
206
|
end
|
|
203
207
|
|
|
204
208
|
def message_from(response)
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
|
+
class VersaPayGateway < Gateway
|
|
4
|
+
self.test_url = 'https://uat.versapay.com'
|
|
5
|
+
self.live_url = 'https://secure.versapay.com'
|
|
6
|
+
|
|
7
|
+
self.supported_countries = ['US']
|
|
8
|
+
self.default_currency = 'USD'
|
|
9
|
+
self.money_format = :cents
|
|
10
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
|
11
|
+
|
|
12
|
+
self.homepage_url = 'https://www.versapay.com/'
|
|
13
|
+
self.display_name = 'VersaPay'
|
|
14
|
+
|
|
15
|
+
def initialize(options = {})
|
|
16
|
+
requires!(options, :api_token, :api_key)
|
|
17
|
+
@api_token = options[:api_token]
|
|
18
|
+
@api_key = options[:api_key]
|
|
19
|
+
super
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def purchase(money, payment, options = {})
|
|
23
|
+
transact(money, payment, options)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def authorize(money, payment, options = {})
|
|
27
|
+
transact(money, payment, options, 'auth')
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def capture(money, authorization, options = {})
|
|
31
|
+
post = {
|
|
32
|
+
amount_cents: money,
|
|
33
|
+
transaction: authorization
|
|
34
|
+
}
|
|
35
|
+
commit('capture', post)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def verify(credit_card, options = {})
|
|
39
|
+
transact(0, credit_card, options, 'verify')
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def void(authorization, options = {})
|
|
43
|
+
commit('void', { transaction: authorization })
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def refund(money, authorization, options = {})
|
|
47
|
+
post = {
|
|
48
|
+
amount_cents: money,
|
|
49
|
+
transaction: authorization
|
|
50
|
+
}
|
|
51
|
+
commit('refund', post)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def credit(money, payment_method, options = {})
|
|
55
|
+
transact(money, payment_method, options, 'credit')
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def store(payment_method, options = {})
|
|
59
|
+
post = {
|
|
60
|
+
contact: { email: options[:email] }
|
|
61
|
+
}
|
|
62
|
+
add_customer_data(post, options)
|
|
63
|
+
add_payment_method(post, payment_method, options)
|
|
64
|
+
commit('store', post)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def unstore(authorization, options = {})
|
|
68
|
+
wallet_token, fund_token = authorization.split('|')
|
|
69
|
+
commit('unstore', {}, :delete, { fund_token:, wallet_token: })
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def supports_scrubbing?
|
|
73
|
+
true
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def scrub(transcript)
|
|
77
|
+
transcript.
|
|
78
|
+
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
|
|
79
|
+
gsub(%r(("card_number\\?":\\?")[^"]*)i, '\1[FILTERED]').
|
|
80
|
+
gsub(%r(("cvv\\?":\\?")[^"]*)i, '\1[FILTERED]')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
def transact(money, payment, options = {}, type = 'sale')
|
|
86
|
+
post = {
|
|
87
|
+
contact: { email: options[:email] }
|
|
88
|
+
}
|
|
89
|
+
add_invoice(post, money, options)
|
|
90
|
+
add_order(post, money, options)
|
|
91
|
+
add_payment_method(post, payment, options)
|
|
92
|
+
commit(type, post)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def add_customer_data(post, options)
|
|
96
|
+
post[:customer_identifier] = options[:customer_identifier] if options[:customer_identifier]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def add_invoice(post, money, options)
|
|
100
|
+
post[:amount_cents] = amount(money)
|
|
101
|
+
post[:currency] = options[:currency] || currency(money)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def add_order(post, money, options = {})
|
|
105
|
+
order = {
|
|
106
|
+
identifier: options[:order_id],
|
|
107
|
+
number: options[:order_number],
|
|
108
|
+
date: options[:order_date] || Time.now.strftime('%Y-%m-%d'),
|
|
109
|
+
draft: false,
|
|
110
|
+
settlement_token: options[:settlement_token] # A settlement token reference (see whoami response structure) representing the merchant/bank processor configuration that should be used for transaction settlement.
|
|
111
|
+
}.compact
|
|
112
|
+
|
|
113
|
+
add_invoice(order, money, options)
|
|
114
|
+
add_address(order, options, 'shipping')
|
|
115
|
+
add_address(order, options)
|
|
116
|
+
post[:order] = order
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def add_address(post, options, address_key = 'billing', hash = 'order')
|
|
120
|
+
address = options["#{address_key}_address".to_sym]
|
|
121
|
+
return unless address
|
|
122
|
+
|
|
123
|
+
address_data = {
|
|
124
|
+
address_1: address[:address1],
|
|
125
|
+
city: address[:city],
|
|
126
|
+
province: address[:state],
|
|
127
|
+
postal_code: address[:zip],
|
|
128
|
+
country: Country.find(address[:country]).code(:alpha3).value
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if hash == 'payment_method'
|
|
132
|
+
post[:address] = address_data
|
|
133
|
+
else
|
|
134
|
+
post.merge!({
|
|
135
|
+
"#{address_key}_name": address[:company],
|
|
136
|
+
"#{address_key}_address": address[:address1],
|
|
137
|
+
"#{address_key}_address2": address[:address2],
|
|
138
|
+
"#{address_key}_city": address[:city],
|
|
139
|
+
"#{address_key}_country": address_data[:country],
|
|
140
|
+
"#{address_key}_email": options[:email],
|
|
141
|
+
"#{address_key}_telephone": address[:phone] || address[:phone_number],
|
|
142
|
+
"#{address_key}_postalcode": address[:zip],
|
|
143
|
+
"#{address_key}_state_province": address[:state]
|
|
144
|
+
}.compact)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def add_payment_method(post, payment_method, options)
|
|
149
|
+
if payment_method.is_a?(CreditCard)
|
|
150
|
+
post[:credit_card] = {
|
|
151
|
+
name: payment_method.name,
|
|
152
|
+
expiry_month: format(payment_method.month, :two_digits),
|
|
153
|
+
expiry_year: payment_method.year,
|
|
154
|
+
card_number: payment_method.number,
|
|
155
|
+
cvv: payment_method.verification_value
|
|
156
|
+
}
|
|
157
|
+
add_address(post[:credit_card], options, 'billing', 'payment_method')
|
|
158
|
+
elsif payment_method.is_a?(String)
|
|
159
|
+
fund_token = payment_method.split('|').last
|
|
160
|
+
post[:fund_token] = fund_token
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def parse(body)
|
|
165
|
+
JSON.parse(body).with_indifferent_access
|
|
166
|
+
rescue JSON::ParserError => e
|
|
167
|
+
{
|
|
168
|
+
errors: body,
|
|
169
|
+
status: 'Unable to parse JSON response',
|
|
170
|
+
message: e.message
|
|
171
|
+
}.with_indifferent_access
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def commit(action, post, method = :post, options = {})
|
|
175
|
+
raw_response = ssl_request(method, url(action, options), post.to_json, request_headers)
|
|
176
|
+
response = parse(raw_response)
|
|
177
|
+
first_transaction = response['transactions']&.first
|
|
178
|
+
|
|
179
|
+
Response.new(
|
|
180
|
+
success_from(response, action),
|
|
181
|
+
message_from(response, action),
|
|
182
|
+
response,
|
|
183
|
+
authorization: authorization_from(response),
|
|
184
|
+
avs_result: AVSResult.new(code: dig_avs_code(first_transaction)),
|
|
185
|
+
cvv_result: CVVResult.new(dig_cvv_code(first_transaction)),
|
|
186
|
+
test: test?,
|
|
187
|
+
error_code: error_code_from(response, action)
|
|
188
|
+
)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def success_from(response, action)
|
|
192
|
+
case action
|
|
193
|
+
when 'store'
|
|
194
|
+
response['wallet_token'] || response['fund_token'] || false
|
|
195
|
+
when 'unstore'
|
|
196
|
+
response['fund_token'] || false
|
|
197
|
+
else
|
|
198
|
+
response['success'] || false
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def message_from(response, action)
|
|
203
|
+
return 'Succeeded' if success_from(response, action)
|
|
204
|
+
|
|
205
|
+
first_transaction = response['transactions']&.first
|
|
206
|
+
gateway_response_errors = gateway_errors_message(response)
|
|
207
|
+
|
|
208
|
+
response_message = {
|
|
209
|
+
error: response.dig('error') || response.dig('wallets', 'error'),
|
|
210
|
+
errors: response.dig('errors')&.join(', ').presence,
|
|
211
|
+
gateway_error_message: first_transaction&.dig('gateway_error_message').presence,
|
|
212
|
+
gateway_response_errors: gateway_response_errors.presence
|
|
213
|
+
}.compact
|
|
214
|
+
|
|
215
|
+
response_message.map { |key, value| "#{key}: #{value}" }.join(' | ')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def authorization_from(response)
|
|
219
|
+
transaction = response['transaction']
|
|
220
|
+
wallet_token = response['wallet_token'] || response.dig('wallets', 0, 'token')
|
|
221
|
+
fund_token = response['fund_token'] || response.dig('wallets', 0, 'credit_cards', 0, 'token')
|
|
222
|
+
[transaction, wallet_token, fund_token].compact.join('|')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
def error_code_from(response, action)
|
|
226
|
+
return if success_from(response, action)
|
|
227
|
+
|
|
228
|
+
response.dig('transactions', 0, 'gateway_error_code')
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
def gateway_errors_message(response)
|
|
232
|
+
errors = response.dig('transactions', 0, 'gateway_response', 'errors')
|
|
233
|
+
return unless errors.is_a?(Hash)
|
|
234
|
+
|
|
235
|
+
errors.flat_map do |field, error_details|
|
|
236
|
+
error_details.flat_map do |error|
|
|
237
|
+
if error.is_a?(Hash)
|
|
238
|
+
error.map { |key, messages| "[#{field} - #{key}: #{messages.join(', ')}]" }
|
|
239
|
+
else
|
|
240
|
+
"[#{field} - #{error}]"
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
end.join(' , ')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
def url(endpoint, options = {})
|
|
247
|
+
case endpoint
|
|
248
|
+
when 'unstore'
|
|
249
|
+
parameters = "/#{options[:wallet_token]}/methods/#{options[:fund_token]}"
|
|
250
|
+
"#{test? ? test_url : live_url}/api/gateway/v1/wallets#{parameters}"
|
|
251
|
+
when 'store'
|
|
252
|
+
"#{test? ? test_url : live_url}/api/gateway/v1/wallets"
|
|
253
|
+
else
|
|
254
|
+
"#{test? ? test_url : live_url}/api/gateway/v1/orders/#{endpoint}"
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def basic_auth
|
|
259
|
+
Base64.strict_encode64("#{@api_token}:#{@api_key}")
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def request_headers
|
|
263
|
+
{
|
|
264
|
+
'Content-Type' => 'application/json',
|
|
265
|
+
'Authorization' => "Basic #{basic_auth}"
|
|
266
|
+
}
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
def dig_cvv_code(first_transaction)
|
|
270
|
+
return unless first_transaction
|
|
271
|
+
|
|
272
|
+
first_transaction.dig('cvv_response') ||
|
|
273
|
+
first_transaction.dig('gateway_response', 'cvv_response') ||
|
|
274
|
+
find_cvv_avs_code(first_transaction, 'cvvresponse')
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def dig_avs_code(first_transaction)
|
|
278
|
+
return unless first_transaction
|
|
279
|
+
|
|
280
|
+
first_transaction.dig('avs_response') ||
|
|
281
|
+
first_transaction.dig('gateway_response', 'avs_response') ||
|
|
282
|
+
find_cvv_avs_code(first_transaction, 'avsresponse')
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def find_cvv_avs_code(first_transaction, to_find)
|
|
286
|
+
nested_response = first_transaction.dig(
|
|
287
|
+
'gateway_response',
|
|
288
|
+
'gateway_response',
|
|
289
|
+
'response', 'content',
|
|
290
|
+
'create'
|
|
291
|
+
)
|
|
292
|
+
return nil unless nested_response.is_a?(Array)
|
|
293
|
+
|
|
294
|
+
nested_response.find { |x| x.dig('transaction', to_find) }&.dig('transaction', to_find)
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
def handle_response(response)
|
|
298
|
+
case response.code.to_i
|
|
299
|
+
when 200..412
|
|
300
|
+
response.body
|
|
301
|
+
else
|
|
302
|
+
response.body || raise(ResponseError.new(response)) # some errors 500 has the error message
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class ViaklixGateway < Gateway
|
|
4
4
|
class_attribute :test_url, :live_url, :delimiter, :actions
|
|
5
5
|
|
|
@@ -136,11 +136,15 @@ module ActiveMerchant #:nodoc:
|
|
|
136
136
|
|
|
137
137
|
response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(parameters)))
|
|
138
138
|
|
|
139
|
-
Response.new(
|
|
139
|
+
Response.new(
|
|
140
|
+
response['result'] == APPROVED,
|
|
141
|
+
message_from(response),
|
|
142
|
+
response,
|
|
140
143
|
test: @options[:test] || test?,
|
|
141
144
|
authorization: authorization_from(response),
|
|
142
145
|
avs_result: { code: response['avs_response'] },
|
|
143
|
-
cvv_result: response['cvv2_response']
|
|
146
|
+
cvv_result: response['cvv2_response']
|
|
147
|
+
)
|
|
144
148
|
end
|
|
145
149
|
|
|
146
150
|
def authorization_from(response)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class VisanetPeruGateway < Gateway
|
|
4
4
|
include Empty
|
|
5
5
|
self.display_name = 'VisaNet Peru Gateway'
|
|
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
|
|
|
134
134
|
params[:externalReferenceId] = params.delete(:externalTransactionId)
|
|
135
135
|
_, transaction_id = split_authorization(authorization)
|
|
136
136
|
|
|
137
|
-
options.update(transaction_id:
|
|
137
|
+
options.update(transaction_id:)
|
|
138
138
|
params[:ruc] = options[:ruc]
|
|
139
139
|
end
|
|
140
140
|
|
|
@@ -143,12 +143,12 @@ module ActiveMerchant #:nodoc:
|
|
|
143
143
|
end
|
|
144
144
|
|
|
145
145
|
def generate_purchase_number_stamp
|
|
146
|
-
|
|
146
|
+
rand(('9' * 12).to_i).to_s.center(12, rand(9).to_s)
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
def commit(action, params, options = {})
|
|
150
150
|
raw_response = ssl_request(method(action), url(action, params, options), params.to_json, headers)
|
|
151
|
-
response = parse(raw_response)
|
|
151
|
+
response = parse(raw_response).merge('purchaseNumber' => params[:purchaseNumber])
|
|
152
152
|
rescue ResponseError => e
|
|
153
153
|
raw_response = e.response.body
|
|
154
154
|
response_error(raw_response, options, action)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require 'digest'
|
|
2
2
|
require 'jwe'
|
|
3
3
|
|
|
4
|
-
module ActiveMerchant
|
|
5
|
-
module Billing
|
|
4
|
+
module ActiveMerchant # :nodoc:
|
|
5
|
+
module Billing # :nodoc:
|
|
6
6
|
class VposGateway < Gateway
|
|
7
7
|
self.test_url = 'https://vpos.infonet.com.py:8888'
|
|
8
8
|
self.live_url = 'https://vpos.infonet.com.py'
|
|
@@ -20,14 +20,15 @@ module ActiveMerchant #:nodoc:
|
|
|
20
20
|
pci_encryption_key: '/vpos/api/0.3/application/encryption-key',
|
|
21
21
|
pay_pci_buy_encrypted: '/vpos/api/0.3/pci/encrypted',
|
|
22
22
|
pci_buy_rollback: '/vpos/api/0.3/pci_buy/rollback',
|
|
23
|
-
refund: '/vpos/api/0.3/refunds'
|
|
23
|
+
refund: '/vpos/api/0.3/refunds',
|
|
24
|
+
inquire: '/vpos/api/0.3/pci_buy/confirmations'
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
def initialize(options = {})
|
|
27
28
|
requires!(options, :private_key, :public_key)
|
|
28
29
|
@private_key = options[:private_key]
|
|
29
30
|
@public_key = options[:public_key]
|
|
30
|
-
@encryption_key = OpenSSL::PKey::RSA.new(options[:encryption_key]) if options[:encryption_key]
|
|
31
|
+
@encryption_key = OpenSSL::PKey::RSA.new(options[:encryption_key]) if options[:encryption_key].is_a?(String)
|
|
31
32
|
@shop_process_id = options[:shop_process_id] || SecureRandom.random_number(10**15)
|
|
32
33
|
super
|
|
33
34
|
end
|
|
@@ -54,12 +55,21 @@ module ActiveMerchant #:nodoc:
|
|
|
54
55
|
commit(:pay_pci_buy_encrypted, post)
|
|
55
56
|
end
|
|
56
57
|
|
|
58
|
+
def inquire(authorization, options = {})
|
|
59
|
+
_, shop_process_id = authorization.to_s.split('#') if authorization
|
|
60
|
+
shop_process_id = options[:shop_process_id] if options[:shop_process_id]
|
|
61
|
+
token = generate_token(shop_process_id, 'get_confirmation')
|
|
62
|
+
|
|
63
|
+
post = { token:, shop_process_id: }
|
|
64
|
+
commit(:inquire, post)
|
|
65
|
+
end
|
|
66
|
+
|
|
57
67
|
def void(authorization, options = {})
|
|
58
68
|
_, shop_process_id = authorization.to_s.split('#')
|
|
59
69
|
token = generate_token(shop_process_id, 'rollback', '0.00')
|
|
60
70
|
post = {
|
|
61
|
-
token
|
|
62
|
-
shop_process_id:
|
|
71
|
+
token:,
|
|
72
|
+
shop_process_id:
|
|
63
73
|
}
|
|
64
74
|
commit(:pci_buy_rollback, post)
|
|
65
75
|
end
|
|
@@ -118,7 +128,7 @@ module ActiveMerchant #:nodoc:
|
|
|
118
128
|
# Required to encrypt PAN data.
|
|
119
129
|
def one_time_public_key
|
|
120
130
|
token = generate_token('get_encription_public_key', @public_key)
|
|
121
|
-
response = commit(:pci_encryption_key, token:
|
|
131
|
+
response = commit(:pci_encryption_key, token:)
|
|
122
132
|
response.params['encryption_key']
|
|
123
133
|
end
|
|
124
134
|
|
|
@@ -137,7 +147,7 @@ module ActiveMerchant #:nodoc:
|
|
|
137
147
|
card_number = payment.number
|
|
138
148
|
cvv = payment.verification_value
|
|
139
149
|
|
|
140
|
-
payload = { card_number
|
|
150
|
+
payload = { card_number:, cvv: }.to_json
|
|
141
151
|
|
|
142
152
|
encryption_key = @encryption_key || OpenSSL::PKey::RSA.new(one_time_public_key)
|
|
143
153
|
|
|
@@ -158,14 +168,14 @@ module ActiveMerchant #:nodoc:
|
|
|
158
168
|
url = build_request_url(action)
|
|
159
169
|
begin
|
|
160
170
|
response = parse(ssl_post(url, post_data(parameters)))
|
|
161
|
-
rescue ResponseError =>
|
|
171
|
+
rescue ResponseError => e
|
|
162
172
|
# Errors are returned with helpful data,
|
|
163
173
|
# but get filtered out by `ssl_post` because of their HTTP status.
|
|
164
|
-
response = parse(
|
|
174
|
+
response = parse(e.response.body)
|
|
165
175
|
end
|
|
166
176
|
|
|
167
177
|
Response.new(
|
|
168
|
-
success_from(response),
|
|
178
|
+
success_from(response, action),
|
|
169
179
|
message_from(response),
|
|
170
180
|
response,
|
|
171
181
|
authorization: authorization_from(response),
|
|
@@ -176,8 +186,10 @@ module ActiveMerchant #:nodoc:
|
|
|
176
186
|
)
|
|
177
187
|
end
|
|
178
188
|
|
|
179
|
-
def success_from(response)
|
|
180
|
-
if code = response.dig('
|
|
189
|
+
def success_from(response, action = nil)
|
|
190
|
+
if action == :refund && (code = response.dig('refund', 'response_code'))
|
|
191
|
+
code == '00'
|
|
192
|
+
elsif code = response.dig('confirmation', 'response_code')
|
|
181
193
|
code == '00'
|
|
182
194
|
else
|
|
183
195
|
response['status'] == 'success'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class WebpayGateway < StripeGateway
|
|
6
6
|
self.live_url = 'https://api.webpay.jp/v1/'
|
|
7
7
|
|
|
@@ -84,7 +84,7 @@ module ActiveMerchant #:nodoc:
|
|
|
84
84
|
}
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
-
def headers(options = {})
|
|
87
|
+
def headers(method = :post, options = {})
|
|
88
88
|
{
|
|
89
89
|
'Authorization' => 'Basic ' + Base64.encode64(@api_key.to_s + ':').strip,
|
|
90
90
|
'User-Agent' => "Webpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class WepayGateway < Gateway
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
version 'v2'
|
|
5
|
+
|
|
6
|
+
self.test_url = "https://stage.wepayapi.com/#{fetch_version}"
|
|
7
|
+
self.live_url = "https://wepayapi.com/#{fetch_version}"
|
|
6
8
|
|
|
7
9
|
self.supported_countries = %w[US CA]
|
|
8
10
|
self.supported_cardtypes = %i[visa master american_express discover]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'base64'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
class WirecardGateway < Gateway
|
|
6
6
|
self.test_url = 'https://c3-test.wirecard.com/secure/ssl-gateway'
|
|
7
7
|
self.live_url = 'https://c3.wirecard.com/secure/ssl-gateway'
|
|
@@ -179,11 +179,15 @@ module ActiveMerchant #:nodoc:
|
|
|
179
179
|
message = response[:Message]
|
|
180
180
|
authorization = response[:GuWID]
|
|
181
181
|
|
|
182
|
-
Response.new(
|
|
182
|
+
Response.new(
|
|
183
|
+
success,
|
|
184
|
+
message,
|
|
185
|
+
response,
|
|
183
186
|
test: test?,
|
|
184
|
-
authorization
|
|
187
|
+
authorization:,
|
|
185
188
|
avs_result: { code: avs_code(response, options) },
|
|
186
|
-
cvv_result: response[:CVCResponseCode]
|
|
189
|
+
cvv_result: response[:CVCResponseCode]
|
|
190
|
+
)
|
|
187
191
|
rescue ResponseError => e
|
|
188
192
|
if e.response.code == '401'
|
|
189
193
|
return Response.new(false, 'Invalid Login')
|
|
@@ -405,7 +409,7 @@ module ActiveMerchant #:nodoc:
|
|
|
405
409
|
'N' => 'I', # CSC Match
|
|
406
410
|
'U' => 'U', # Data Not Checked
|
|
407
411
|
'Y' => 'D', # All Data Matched
|
|
408
|
-
'Z' => 'P'
|
|
412
|
+
'Z' => 'P' # CSC and Postcode Matched
|
|
409
413
|
}
|
|
410
414
|
|
|
411
415
|
# Amex have different AVS response codes to visa etc
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
module ActiveMerchant
|
|
2
|
-
module Billing
|
|
1
|
+
module ActiveMerchant # :nodoc:
|
|
2
|
+
module Billing # :nodoc:
|
|
3
3
|
class WompiGateway < Gateway
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
version 'v1'
|
|
5
|
+
|
|
6
|
+
self.test_url = "https://sync.sandbox.wompi.co/#{fetch_version}"
|
|
7
|
+
self.live_url = "https://sync.production.wompi.co/#{fetch_version}"
|
|
6
8
|
|
|
7
9
|
self.supported_countries = ['CO']
|
|
8
10
|
self.default_currency = 'COP'
|
|
@@ -31,9 +33,10 @@ module ActiveMerchant #:nodoc:
|
|
|
31
33
|
def purchase(money, payment, options = {})
|
|
32
34
|
post = {
|
|
33
35
|
reference: options[:reference] || generate_reference,
|
|
34
|
-
public_key:
|
|
36
|
+
public_key:
|
|
35
37
|
}
|
|
36
38
|
add_invoice(post, money, options)
|
|
39
|
+
add_tip_in_cents(post, options)
|
|
37
40
|
add_card(post, payment, options)
|
|
38
41
|
|
|
39
42
|
commit('sale', post, '/transactions_sync')
|
|
@@ -41,7 +44,7 @@ module ActiveMerchant #:nodoc:
|
|
|
41
44
|
|
|
42
45
|
def authorize(money, payment, options = {})
|
|
43
46
|
post = {
|
|
44
|
-
public_key
|
|
47
|
+
public_key:,
|
|
45
48
|
type: 'CARD',
|
|
46
49
|
financial_operation: 'PREAUTHORIZATION'
|
|
47
50
|
}
|
|
@@ -53,7 +56,7 @@ module ActiveMerchant #:nodoc:
|
|
|
53
56
|
def capture(money, authorization, options = {})
|
|
54
57
|
post = {
|
|
55
58
|
reference: options[:reference] || generate_reference,
|
|
56
|
-
public_key
|
|
59
|
+
public_key:,
|
|
57
60
|
payment_source_id: authorization.to_i
|
|
58
61
|
}
|
|
59
62
|
add_invoice(post, money, options)
|
|
@@ -141,6 +144,10 @@ module ActiveMerchant #:nodoc:
|
|
|
141
144
|
post[:cvc] = cvc if cvc && !cvc.empty?
|
|
142
145
|
end
|
|
143
146
|
|
|
147
|
+
def add_tip_in_cents(post, options)
|
|
148
|
+
post[:tip_in_cents] = options[:tip_in_cents].to_i if options[:tip_in_cents]
|
|
149
|
+
end
|
|
150
|
+
|
|
144
151
|
def parse(body)
|
|
145
152
|
JSON.parse(body)
|
|
146
153
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'nokogiri'
|
|
2
2
|
|
|
3
|
-
module ActiveMerchant
|
|
4
|
-
module Billing
|
|
3
|
+
module ActiveMerchant # :nodoc:
|
|
4
|
+
module Billing # :nodoc:
|
|
5
5
|
# See https://helpdesk.worldnettps.com/support/solutions/articles/1000167298-integrator-guide
|
|
6
6
|
class WorldNetGateway < Gateway
|
|
7
7
|
self.test_url = 'https://testpayments.worldnettps.com/merchant/xmlpayment'
|