activemerchant 1.100.0 → 1.133.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +1057 -0
- data/README.md +11 -9
- data/lib/active_merchant/billing/avs_result.rb +9 -9
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +49 -17
- data/lib/active_merchant/billing/compatibility.rb +5 -4
- data/lib/active_merchant/billing/credit_card.rb +55 -8
- data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +38 -36
- data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
- data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
- data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +14 -14
- data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
- data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
- data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
- data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
- data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
- data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
- data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
- data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
- data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
- data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
- data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
- data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
- data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +387 -175
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
- data/lib/active_merchant/billing/gateways/cams.rb +10 -10
- data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
- data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
- data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
- data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
- data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
- data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
- data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
- data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
- data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
- data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
- data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
- data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
- data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
- data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
- data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
- data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
- data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
- data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
- data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
- data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
- data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
- data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
- data/lib/active_merchant/billing/gateways/element.rb +71 -21
- data/lib/active_merchant/billing/gateways/epay.rb +43 -43
- data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
- data/lib/active_merchant/billing/gateways/eway.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
- data/lib/active_merchant/billing/gateways/exact.rb +19 -20
- data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
- data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
- data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +38 -22
- data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
- data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
- data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
- data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
- data/lib/active_merchant/billing/gateways/hps.rb +171 -50
- data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
- data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
- data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
- data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
- data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
- data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
- data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
- data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
- data/lib/active_merchant/billing/gateways/litle.rb +181 -45
- data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
- data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
- data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
- data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
- data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +18 -21
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +236 -150
- data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
- data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
- data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
- data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
- data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
- data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
- data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
- data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
- data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
- data/lib/active_merchant/billing/gateways/omise.rb +15 -16
- data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
- data/lib/active_merchant/billing/gateways/opp.rb +39 -33
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
- data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
- data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
- data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
- data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
- data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
- data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
- data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
- data/lib/active_merchant/billing/gateways/payex.rb +24 -25
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
- data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
- data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
- data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
- data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +13 -5
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
- data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
- data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
- data/lib/active_merchant/billing/gateways/payscout.rb +8 -9
- data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
- data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
- data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
- data/lib/active_merchant/billing/gateways/payway.rb +22 -22
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +60 -21
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
- data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
- data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
- data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
- data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
- data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
- data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
- data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
- data/lib/active_merchant/billing/gateways/reach.rb +277 -0
- data/lib/active_merchant/billing/gateways/realex.rb +42 -16
- data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
- data/lib/active_merchant/billing/gateways/s5.rb +10 -9
- data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
- data/lib/active_merchant/billing/gateways/sage.rb +19 -21
- data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
- data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
- data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
- data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +19 -19
- data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
- data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
- data/lib/active_merchant/billing/gateways/telr.rb +17 -18
- data/lib/active_merchant/billing/gateways/tns.rb +3 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
- data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
- data/lib/active_merchant/billing/gateways/transax.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
- data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
- data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
- data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
- data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
- data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
- data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
- data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
- data/lib/active_merchant/billing/response.rb +25 -6
- data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
- data/lib/active_merchant/billing.rb +1 -0
- data/lib/active_merchant/connection.rb +14 -15
- data/lib/active_merchant/country.rb +3 -1
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +15 -17
- data/lib/active_merchant/post_data.rb +3 -2
- data/lib/active_merchant/posts_data.rb +2 -2
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +2 -2
- data/lib/certs/cacert.pem +1587 -2361
- data/lib/support/gateway_support.rb +1 -1
- data/lib/support/ssl_verify.rb +3 -7
- data/lib/support/ssl_version.rb +2 -3
- metadata +86 -34
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -6,8 +6,8 @@ module ActiveMerchant #:nodoc:
|
|
6
6
|
|
7
7
|
self.money_format = :cents
|
8
8
|
self.default_currency = 'USD'
|
9
|
-
self.supported_countries = [
|
10
|
-
self.supported_cardtypes = [
|
9
|
+
self.supported_countries = %w[US CA]
|
10
|
+
self.supported_cardtypes = %i[visa master american_express discover]
|
11
11
|
|
12
12
|
self.homepage_url = 'http://www.jetpay.com'
|
13
13
|
self.display_name = 'JetPay'
|
@@ -210,8 +210,8 @@ module ActiveMerchant #:nodoc:
|
|
210
210
|
xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
|
211
211
|
xml.tag! 'Origin', options[:origin] || 'INTERNET'
|
212
212
|
xml.tag! 'IndustryInfo', 'Type' => options[:industry_info] || 'ECOMMERCE'
|
213
|
-
xml.tag! 'Application', (options[:application] || 'n/a'), {'Version' => options[:application_version] || '1.0'}
|
214
|
-
xml.tag! 'Device', (options[:device] || 'n/a'), {'Version' => options[:device_version] || '1.0'}
|
213
|
+
xml.tag! 'Application', (options[:application] || 'n/a'), { 'Version' => options[:application_version] || '1.0' }
|
214
|
+
xml.tag! 'Device', (options[:device] || 'n/a'), { 'Version' => options[:device_version] || '1.0' }
|
215
215
|
xml.tag! 'Library', 'VirtPOS SDK', 'Version' => '1.5'
|
216
216
|
xml.tag! 'Gateway', 'JetPay'
|
217
217
|
xml.tag! 'DeveloperID', options[:developer_id] || 'n/a'
|
@@ -298,12 +298,11 @@ module ActiveMerchant #:nodoc:
|
|
298
298
|
Response.new(success,
|
299
299
|
success ? 'APPROVED' : message_from(response),
|
300
300
|
response,
|
301
|
-
:
|
302
|
-
:
|
303
|
-
:
|
304
|
-
:
|
305
|
-
:
|
306
|
-
)
|
301
|
+
test: test?,
|
302
|
+
authorization: authorization_from(response, money, token),
|
303
|
+
avs_result: AVSResult.new(code: response[:avs]),
|
304
|
+
cvv_result: CVVResult.new(response[:cvv2]),
|
305
|
+
error_code: success ? nil : error_code_from(response))
|
307
306
|
end
|
308
307
|
|
309
308
|
def url
|
@@ -344,7 +343,7 @@ module ActiveMerchant #:nodoc:
|
|
344
343
|
|
345
344
|
def authorization_from(response, money, previous_token)
|
346
345
|
original_amount = amount(money) if money
|
347
|
-
[
|
346
|
+
[response[:transaction_id], response[:approval], original_amount, (response[:token] || previous_token)].join(';')
|
348
347
|
end
|
349
348
|
|
350
349
|
def error_code_from(response)
|
@@ -368,13 +367,9 @@ module ActiveMerchant #:nodoc:
|
|
368
367
|
xml.tag! 'CardExpMonth', format_exp(credit_card.month)
|
369
368
|
xml.tag! 'CardExpYear', format_exp(credit_card.year)
|
370
369
|
|
371
|
-
if credit_card.first_name || credit_card.last_name
|
372
|
-
xml.tag! 'CardName', [credit_card.first_name, credit_card.last_name].compact.join(' ')
|
373
|
-
end
|
370
|
+
xml.tag! 'CardName', [credit_card.first_name, credit_card.last_name].compact.join(' ') if credit_card.first_name || credit_card.last_name
|
374
371
|
|
375
|
-
unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
|
376
|
-
xml.tag! 'CVV2', credit_card.verification_value
|
377
|
-
end
|
372
|
+
xml.tag! 'CVV2', credit_card.verification_value unless credit_card.verification_value.nil? || (credit_card.verification_value.length == 0)
|
378
373
|
end
|
379
374
|
|
380
375
|
def add_addresses(xml, options)
|
@@ -410,7 +405,7 @@ module ActiveMerchant #:nodoc:
|
|
410
405
|
def add_invoice_data(xml, options)
|
411
406
|
xml.tag! 'OrderNumber', options[:order_id] if options[:order_id]
|
412
407
|
if tax_amount = options[:tax_amount]
|
413
|
-
xml.tag! 'TaxAmount', tax_amount, {'ExemptInd' => options[:tax_exempt] || 'false'}
|
408
|
+
xml.tag! 'TaxAmount', tax_amount, { 'ExemptInd' => options[:tax_exempt] || 'false' }
|
414
409
|
end
|
415
410
|
end
|
416
411
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
10
10
|
self.money_format = :cents
|
11
11
|
self.homepage_url = 'https://www.komoju.com/'
|
12
12
|
self.display_name = 'Komoju'
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express jcb]
|
14
14
|
|
15
15
|
STANDARD_ERROR_CODE_MAPPING = {
|
16
16
|
'bad_verification_value' => 'incorrect_cvc',
|
@@ -4,40 +4,60 @@ module ActiveMerchant #:nodoc:
|
|
4
4
|
self.display_name = 'Kushki'
|
5
5
|
self.homepage_url = 'https://www.kushkipagos.com'
|
6
6
|
|
7
|
-
self.test_url = 'https://api-uat.kushkipagos.com/
|
8
|
-
self.live_url = 'https://api.kushkipagos.com/
|
7
|
+
self.test_url = 'https://api-uat.kushkipagos.com/'
|
8
|
+
self.live_url = 'https://api.kushkipagos.com/'
|
9
9
|
|
10
|
-
self.supported_countries = [
|
10
|
+
self.supported_countries = %w[BR CL CO EC MX PE]
|
11
11
|
self.default_currency = 'USD'
|
12
12
|
self.money_format = :dollars
|
13
|
-
self.supported_cardtypes = [
|
13
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
|
14
14
|
|
15
|
-
def initialize(options={})
|
15
|
+
def initialize(options = {})
|
16
16
|
requires!(options, :public_merchant_id, :private_merchant_id)
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
20
|
-
def purchase(amount, payment_method, options={})
|
20
|
+
def purchase(amount, payment_method, options = {})
|
21
21
|
MultiResponse.run() do |r|
|
22
22
|
r.process { tokenize(amount, payment_method, options) }
|
23
23
|
r.process { charge(amount, r.authorization, options) }
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
27
|
+
def authorize(amount, payment_method, options = {})
|
28
|
+
MultiResponse.run() do |r|
|
29
|
+
r.process { tokenize(amount, payment_method, options) }
|
30
|
+
r.process { preauthorize(amount, r.authorization, options) }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def capture(amount, authorization, options = {})
|
35
|
+
action = 'capture'
|
36
|
+
|
37
|
+
post = {}
|
38
|
+
post[:ticketNumber] = authorization
|
39
|
+
add_invoice(action, post, amount, options)
|
40
|
+
add_full_response(post, options)
|
41
|
+
|
42
|
+
commit(action, post)
|
43
|
+
end
|
44
|
+
|
45
|
+
def refund(amount, authorization, options = {})
|
28
46
|
action = 'refund'
|
29
47
|
|
30
48
|
post = {}
|
31
49
|
post[:ticketNumber] = authorization
|
50
|
+
add_full_response(post, options)
|
32
51
|
|
33
52
|
commit(action, post)
|
34
53
|
end
|
35
54
|
|
36
|
-
def void(authorization, options={})
|
55
|
+
def void(authorization, options = {})
|
37
56
|
action = 'void'
|
38
57
|
|
39
58
|
post = {}
|
40
59
|
post[:ticketNumber] = authorization
|
60
|
+
add_full_response(post, options)
|
41
61
|
|
42
62
|
commit(action, post)
|
43
63
|
end
|
@@ -61,6 +81,10 @@ module ActiveMerchant #:nodoc:
|
|
61
81
|
post = {}
|
62
82
|
add_invoice(action, post, amount, options)
|
63
83
|
add_payment_method(post, payment_method, options)
|
84
|
+
add_full_response(post, options)
|
85
|
+
add_metadata(post, options)
|
86
|
+
add_months(post, options)
|
87
|
+
add_deferred(post, options)
|
64
88
|
|
65
89
|
commit(action, post)
|
66
90
|
end
|
@@ -71,6 +95,25 @@ module ActiveMerchant #:nodoc:
|
|
71
95
|
post = {}
|
72
96
|
add_reference(post, authorization, options)
|
73
97
|
add_invoice(action, post, amount, options)
|
98
|
+
add_contact_details(post, options[:contact_details]) if options[:contact_details]
|
99
|
+
add_full_response(post, options)
|
100
|
+
add_metadata(post, options)
|
101
|
+
add_months(post, options)
|
102
|
+
add_deferred(post, options)
|
103
|
+
|
104
|
+
commit(action, post)
|
105
|
+
end
|
106
|
+
|
107
|
+
def preauthorize(amount, authorization, options)
|
108
|
+
action = 'preAuthorization'
|
109
|
+
|
110
|
+
post = {}
|
111
|
+
add_reference(post, authorization, options)
|
112
|
+
add_invoice(action, post, amount, options)
|
113
|
+
add_full_response(post, options)
|
114
|
+
add_metadata(post, options)
|
115
|
+
add_months(post, options)
|
116
|
+
add_deferred(post, options)
|
74
117
|
|
75
118
|
commit(action, post)
|
76
119
|
end
|
@@ -94,9 +137,7 @@ module ActiveMerchant #:nodoc:
|
|
94
137
|
sum[:iva] = 0
|
95
138
|
sum[:subtotalIva0] = 0
|
96
139
|
|
97
|
-
if sum[:currency] != 'COP'
|
98
|
-
sum[:ice] = 0
|
99
|
-
end
|
140
|
+
sum[:ice] = 0 if sum[:currency] != 'COP'
|
100
141
|
end
|
101
142
|
|
102
143
|
def add_amount_by_country(sum, options)
|
@@ -105,7 +146,7 @@ module ActiveMerchant #:nodoc:
|
|
105
146
|
sum[:iva] = amount[:iva].to_f if amount[:iva]
|
106
147
|
sum[:subtotalIva0] = amount[:subtotal_iva_0].to_f if amount[:subtotal_iva_0]
|
107
148
|
sum[:ice] = amount[:ice].to_f if amount[:ice]
|
108
|
-
if (extra_taxes = amount[:extra_taxes])
|
149
|
+
if (extra_taxes = amount[:extra_taxes])
|
109
150
|
sum[:extraTaxes] ||= Hash.new
|
110
151
|
sum[:extraTaxes][:propina] = extra_taxes[:propina].to_f if extra_taxes[:propina]
|
111
152
|
sum[:extraTaxes][:tasaAeroportuaria] = extra_taxes[:tasa_aeroportuaria].to_f if extra_taxes[:tasa_aeroportuaria]
|
@@ -129,19 +170,56 @@ module ActiveMerchant #:nodoc:
|
|
129
170
|
post[:token] = authorization
|
130
171
|
end
|
131
172
|
|
173
|
+
def add_contact_details(post, contact_details_options)
|
174
|
+
contact_details = {}
|
175
|
+
contact_details[:documentType] = contact_details_options[:document_type] if contact_details_options[:document_type]
|
176
|
+
contact_details[:documentNumber] = contact_details_options[:document_number] if contact_details_options[:document_number]
|
177
|
+
contact_details[:email] = contact_details_options[:email] if contact_details_options[:email]
|
178
|
+
contact_details[:firstName] = contact_details_options[:first_name] if contact_details_options[:first_name]
|
179
|
+
contact_details[:lastName] = contact_details_options[:last_name] if contact_details_options[:last_name]
|
180
|
+
contact_details[:secondLastName] = contact_details_options[:second_last_name] if contact_details_options[:second_last_name]
|
181
|
+
contact_details[:phoneNumber] = contact_details_options[:phone_number] if contact_details_options[:phone_number]
|
182
|
+
post[:contactDetails] = contact_details
|
183
|
+
end
|
184
|
+
|
185
|
+
def add_full_response(post, options)
|
186
|
+
post[:fullResponse] = options[:full_response].to_s.casecmp('true').zero? if options[:full_response]
|
187
|
+
end
|
188
|
+
|
189
|
+
def add_metadata(post, options)
|
190
|
+
post[:metadata] = options[:metadata] if options[:metadata]
|
191
|
+
end
|
192
|
+
|
193
|
+
def add_months(post, options)
|
194
|
+
post[:months] = options[:months] if options[:months]
|
195
|
+
end
|
196
|
+
|
197
|
+
def add_deferred(post, options)
|
198
|
+
return unless options[:deferred_grace_months] && options[:deferred_credit_type] && options[:deferred_months]
|
199
|
+
|
200
|
+
post[:deferred] = {
|
201
|
+
graceMonths: options[:deferred_grace_months],
|
202
|
+
creditType: options[:deferred_credit_type],
|
203
|
+
months: options[:deferred_months]
|
204
|
+
}
|
205
|
+
end
|
206
|
+
|
132
207
|
ENDPOINT = {
|
133
208
|
'tokenize' => 'tokens',
|
134
209
|
'charge' => 'charges',
|
135
210
|
'void' => 'charges',
|
136
|
-
'refund' => 'refund'
|
211
|
+
'refund' => 'refund',
|
212
|
+
'preAuthorization' => 'preAuthorization',
|
213
|
+
'capture' => 'capture'
|
137
214
|
}
|
138
215
|
|
139
216
|
def commit(action, params)
|
140
|
-
response =
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
217
|
+
response =
|
218
|
+
begin
|
219
|
+
parse(ssl_invoke(action, params))
|
220
|
+
rescue ResponseError => e
|
221
|
+
parse(e.response.body)
|
222
|
+
end
|
145
223
|
|
146
224
|
success = success_from(response)
|
147
225
|
|
@@ -156,7 +234,7 @@ module ActiveMerchant #:nodoc:
|
|
156
234
|
end
|
157
235
|
|
158
236
|
def ssl_invoke(action, params)
|
159
|
-
if [
|
237
|
+
if %w[void refund].include?(action)
|
160
238
|
ssl_request(:delete, url(action, params), nil, headers(action))
|
161
239
|
else
|
162
240
|
ssl_post(url(action, params), post_data(params), headers(action))
|
@@ -178,10 +256,10 @@ module ActiveMerchant #:nodoc:
|
|
178
256
|
def url(action, params)
|
179
257
|
base_url = test? ? test_url : live_url
|
180
258
|
|
181
|
-
if [
|
182
|
-
base_url + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
|
259
|
+
if %w[void refund].include?(action)
|
260
|
+
base_url + 'v1/' + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
|
183
261
|
else
|
184
|
-
base_url + ENDPOINT[action]
|
262
|
+
base_url + 'card/v1/' + ENDPOINT[action]
|
185
263
|
end
|
186
264
|
end
|
187
265
|
|
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
|
|
7
7
|
self.live_url = 'https://gateway.l19tech.com/payments/'
|
8
8
|
self.test_url = 'https://gateway-sb.l19tech.com/payments/'
|
9
9
|
|
10
|
-
self.supported_countries = [
|
10
|
+
self.supported_countries = %w[US CA]
|
11
11
|
self.default_currency = 'USD'
|
12
|
-
self.money_format = :
|
13
|
-
self.supported_cardtypes = [
|
12
|
+
self.money_format = :dollars
|
13
|
+
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
|
14
14
|
|
15
15
|
RESPONSE_CODE_MAPPING = {
|
16
16
|
'100' => 'Approved',
|
@@ -51,12 +51,12 @@ module ActiveMerchant #:nodoc:
|
|
51
51
|
'jcb' => 'JC'
|
52
52
|
}
|
53
53
|
|
54
|
-
def initialize(options={})
|
54
|
+
def initialize(options = {})
|
55
55
|
requires!(options, :account_number, :configuration_id, :secret)
|
56
56
|
super
|
57
57
|
end
|
58
58
|
|
59
|
-
def purchase(amount, payment_method, options={})
|
59
|
+
def purchase(amount, payment_method, options = {})
|
60
60
|
if payment_method.is_a?(String)
|
61
61
|
auth_or_sale('sale', payment_method, amount, nil, options)
|
62
62
|
else
|
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def authorize(amount, payment_method, options={})
|
71
|
+
def authorize(amount, payment_method, options = {})
|
72
72
|
if payment_method.is_a?(String)
|
73
73
|
auth_or_sale('auth', payment_method, amount, nil, options)
|
74
74
|
else
|
@@ -80,7 +80,7 @@ module ActiveMerchant #:nodoc:
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
def capture(amount, authorization, options={})
|
83
|
+
def capture(amount, authorization, options = {})
|
84
84
|
post = {}
|
85
85
|
post[:method] = 'deposit'
|
86
86
|
add_request_id(post)
|
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
|
|
96
96
|
commit('v1/', post)
|
97
97
|
end
|
98
98
|
|
99
|
-
def void(authorization, options={})
|
99
|
+
def void(authorization, options = {})
|
100
100
|
method, pgwTID = split_authorization(authorization)
|
101
101
|
case method
|
102
102
|
when 'auth'
|
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
def credit(amount, payment_method, options={})
|
112
|
+
def credit(amount, payment_method, options = {})
|
113
113
|
if payment_method.is_a?(String)
|
114
114
|
refundWithCard(payment_method, amount, nil, options)
|
115
115
|
else
|
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
def verify(payment_method, options={}, action=nil)
|
124
|
+
def verify(payment_method, options = {}, action = nil)
|
125
125
|
if payment_method.is_a?(String)
|
126
126
|
verifyOnly(action, payment_method, nil, options)
|
127
127
|
else
|
@@ -133,7 +133,7 @@ module ActiveMerchant #:nodoc:
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
def store(payment_method, options={})
|
136
|
+
def store(payment_method, options = {})
|
137
137
|
verify(payment_method, options, 'store')
|
138
138
|
end
|
139
139
|
|
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
-
def get_session(options={})
|
204
|
+
def get_session(options = {})
|
205
205
|
post = {}
|
206
206
|
post[:method] = 'getSession'
|
207
207
|
add_request_id(post)
|
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
|
|
213
213
|
commit('session', post)
|
214
214
|
end
|
215
215
|
|
216
|
-
def get_token(authorization, payment_method, options={})
|
216
|
+
def get_token(authorization, payment_method, options = {})
|
217
217
|
post = {}
|
218
218
|
post[:method] = 'tokenize'
|
219
219
|
add_request_id(post)
|
@@ -226,7 +226,7 @@ module ActiveMerchant #:nodoc:
|
|
226
226
|
commit('token', post)
|
227
227
|
end
|
228
228
|
|
229
|
-
def auth_or_sale(method, authorization, amount, credit_card, options={})
|
229
|
+
def auth_or_sale(method, authorization, amount, credit_card, options = {})
|
230
230
|
post = {}
|
231
231
|
post[:method] = method
|
232
232
|
add_request_id(post)
|
@@ -246,7 +246,7 @@ module ActiveMerchant #:nodoc:
|
|
246
246
|
commit('v1/', post)
|
247
247
|
end
|
248
248
|
|
249
|
-
def verifyOnly(action, authorization, credit_card, options={})
|
249
|
+
def verifyOnly(action, authorization, credit_card, options = {})
|
250
250
|
post = {}
|
251
251
|
post[:method] = 'verifyOnly'
|
252
252
|
add_request_id(post)
|
@@ -267,7 +267,7 @@ module ActiveMerchant #:nodoc:
|
|
267
267
|
commit('v1/', post)
|
268
268
|
end
|
269
269
|
|
270
|
-
def refundWithCard(authorization, amount, credit_card, options={})
|
270
|
+
def refundWithCard(authorization, amount, credit_card, options = {})
|
271
271
|
post = {}
|
272
272
|
post[:method] = 'refundWithCard'
|
273
273
|
add_request_id(post)
|
@@ -286,7 +286,7 @@ module ActiveMerchant #:nodoc:
|
|
286
286
|
commit('v1/', post)
|
287
287
|
end
|
288
288
|
|
289
|
-
def reverse_or_void(method, pgwTID, options={})
|
289
|
+
def reverse_or_void(method, pgwTID, options = {})
|
290
290
|
post = {}
|
291
291
|
post[:method] = method
|
292
292
|
add_request_id(post)
|
@@ -324,7 +324,7 @@ module ActiveMerchant #:nodoc:
|
|
324
324
|
|
325
325
|
def headers
|
326
326
|
{
|
327
|
-
'Content-Type'
|
327
|
+
'Content-Type' => 'application/json'
|
328
328
|
}
|
329
329
|
end
|
330
330
|
|
@@ -364,6 +364,7 @@ module ActiveMerchant #:nodoc:
|
|
364
364
|
def error_from(response)
|
365
365
|
return response['error'] if response['error']
|
366
366
|
return 'Failed' unless response.key?('result')
|
367
|
+
|
367
368
|
return response['result']['pgwResponseCode'] || response['result']['processor']['responseCode'] || 'Failed'
|
368
369
|
end
|
369
370
|
|
@@ -397,7 +398,7 @@ module ActiveMerchant #:nodoc:
|
|
397
398
|
false,
|
398
399
|
message_from(response),
|
399
400
|
response,
|
400
|
-
:
|
401
|
+
test: test?
|
401
402
|
)
|
402
403
|
end
|
403
404
|
|