activemerchant 1.79.2 → 1.80.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 +33 -0
- data/README.md +10 -2
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/check.rb +4 -4
- data/lib/active_merchant/billing/compatibility.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +21 -21
- data/lib/active_merchant/billing/credit_card_formatting.rb +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +13 -13
- data/lib/active_merchant/billing/gateways/adyen.rb +31 -15
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +22 -22
- data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -72
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +51 -51
- data/lib/active_merchant/billing/gateways/balanced.rb +29 -29
- data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
- data/lib/active_merchant/billing/gateways/banwire.rb +8 -8
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +69 -69
- data/lib/active_merchant/billing/gateways/blue_pay.rb +19 -19
- data/lib/active_merchant/billing/gateways/blue_snap.rb +42 -42
- data/lib/active_merchant/billing/gateways/bogus.rb +10 -10
- data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +94 -94
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +39 -39
- data/lib/active_merchant/billing/gateways/cams.rb +12 -12
- data/lib/active_merchant/billing/gateways/card_connect.rb +38 -13
- data/lib/active_merchant/billing/gateways/card_stream.rb +116 -116
- data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/cc5.rb +3 -5
- data/lib/active_merchant/billing/gateways/cecabank.rb +6 -6
- data/lib/active_merchant/billing/gateways/cenpos.rb +36 -36
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +31 -31
- data/lib/active_merchant/billing/gateways/clearhaus.rb +5 -5
- data/lib/active_merchant/billing/gateways/commercegate.rb +6 -6
- data/lib/active_merchant/billing/gateways/conekta.rb +24 -19
- data/lib/active_merchant/billing/gateways/creditcall.rb +41 -41
- data/lib/active_merchant/billing/gateways/credorax.rb +104 -103
- data/lib/active_merchant/billing/gateways/culqi.rb +25 -25
- data/lib/active_merchant/billing/gateways/cyber_source.rb +65 -65
- data/lib/active_merchant/billing/gateways/data_cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/dibs.rb +24 -24
- data/lib/active_merchant/billing/gateways/digitzs.rb +35 -35
- data/lib/active_merchant/billing/gateways/ebanx.rb +26 -26
- data/lib/active_merchant/billing/gateways/efsnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/elavon.rb +5 -5
- data/lib/active_merchant/billing/gateways/element.rb +35 -35
- data/lib/active_merchant/billing/gateways/epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +65 -65
- data/lib/active_merchant/billing/gateways/eway_managed.rb +11 -11
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +31 -31
- data/lib/active_merchant/billing/gateways/exact.rb +12 -12
- data/lib/active_merchant/billing/gateways/ezic.rb +13 -13
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -24
- data/lib/active_merchant/billing/gateways/federated_canada.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +16 -16
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +71 -71
- data/lib/active_merchant/billing/gateways/flo2cash.rb +12 -12
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +26 -16
- data/lib/active_merchant/billing/gateways/garanti.rb +10 -12
- data/lib/active_merchant/billing/gateways/global_collect.rb +88 -88
- data/lib/active_merchant/billing/gateways/global_transport.rb +4 -4
- data/lib/active_merchant/billing/gateways/hdfc.rb +33 -33
- data/lib/active_merchant/billing/gateways/hps.rb +28 -28
- data/lib/active_merchant/billing/gateways/iats_payments.rb +26 -26
- data/lib/active_merchant/billing/gateways/inspire.rb +15 -15
- data/lib/active_merchant/billing/gateways/instapay.rb +4 -4
- data/lib/active_merchant/billing/gateways/ipp.rb +17 -17
- data/lib/active_merchant/billing/gateways/iridium.rb +207 -207
- data/lib/active_merchant/billing/gateways/iveri.rb +8 -8
- data/lib/active_merchant/billing/gateways/jetpay.rb +134 -134
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +141 -141
- data/lib/active_merchant/billing/gateways/komoju.rb +15 -15
- data/lib/active_merchant/billing/gateways/kushki.rb +31 -37
- data/lib/active_merchant/billing/gateways/latitude19.rb +64 -64
- data/lib/active_merchant/billing/gateways/linkpoint.rb +22 -22
- data/lib/active_merchant/billing/gateways/litle.rb +4 -4
- data/lib/active_merchant/billing/gateways/mastercard.rb +3 -3
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +28 -28
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +9 -9
- data/lib/active_merchant/billing/gateways/merchant_one.rb +6 -6
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +24 -24
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +49 -49
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +36 -36
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercury.rb +28 -28
- data/lib/active_merchant/billing/gateways/metrics_global.rb +7 -7
- data/lib/active_merchant/billing/gateways/micropayment.rb +31 -31
- data/lib/active_merchant/billing/gateways/migs.rb +11 -9
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +16 -16
- data/lib/active_merchant/billing/gateways/monei.rb +5 -5
- data/lib/active_merchant/billing/gateways/moneris.rb +26 -26
- data/lib/active_merchant/billing/gateways/moneris_us.rb +81 -37
- data/lib/active_merchant/billing/gateways/money_movers.rb +3 -3
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/netaxept.rb +15 -15
- data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
- data/lib/active_merchant/billing/gateways/netbilling.rb +1 -1
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +18 -18
- data/lib/active_merchant/billing/gateways/ogone.rb +22 -22
- data/lib/active_merchant/billing/gateways/omise.rb +3 -3
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +4 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/orbital.rb +61 -61
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +4 -4
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +5 -5
- data/lib/active_merchant/billing/gateways/pagarme.rb +27 -27
- data/lib/active_merchant/billing/gateways/pago_facil.rb +8 -8
- data/lib/active_merchant/billing/gateways/pay_conex.rb +25 -25
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +32 -32
- data/lib/active_merchant/billing/gateways/pay_hub.rb +29 -29
- data/lib/active_merchant/billing/gateways/pay_junction.rb +7 -7
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +30 -30
- data/lib/active_merchant/billing/gateways/pay_secure.rb +4 -4
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +15 -15
- data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
- data/lib/active_merchant/billing/gateways/payex.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +23 -22
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +40 -37
- data/lib/active_merchant/billing/gateways/paymentez.rb +11 -3
- data/lib/active_merchant/billing/gateways/paymill.rb +115 -115
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +14 -14
- data/lib/active_merchant/billing/gateways/payu_in.rb +43 -43
- data/lib/active_merchant/billing/gateways/payu_latam.rb +41 -41
- data/lib/active_merchant/billing/gateways/payway.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +7 -7
- data/lib/active_merchant/billing/gateways/plugnpay.rb +62 -62
- data/lib/active_merchant/billing/gateways/pro_pay.rb +123 -123
- data/lib/active_merchant/billing/gateways/psigate.rb +16 -16
- data/lib/active_merchant/billing/gateways/psl_card.rb +13 -13
- data/lib/active_merchant/billing/gateways/qbms.rb +52 -52
- data/lib/active_merchant/billing/gateways/quantum.rb +5 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -10
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +11 -11
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +55 -55
- data/lib/active_merchant/billing/gateways/realex.rb +16 -15
- data/lib/active_merchant/billing/gateways/redsys.rb +128 -121
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +16 -16
- data/lib/active_merchant/billing/gateways/sage.rb +20 -20
- data/lib/active_merchant/billing/gateways/sage_pay.rb +32 -32
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -11
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -19
- data/lib/active_merchant/billing/gateways/secure_pay.rb +5 -5
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +7 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +9 -9
- data/lib/active_merchant/billing/gateways/securion_pay.rb +12 -12
- data/lib/active_merchant/billing/gateways/skip_jack.rb +28 -28
- data/lib/active_merchant/billing/gateways/smart_ps.rb +31 -31
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +63 -63
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/telr.rb +26 -26
- data/lib/active_merchant/billing/gateways/trans_first.rb +28 -28
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +224 -224
- data/lib/active_merchant/billing/gateways/transact_pro.rb +7 -7
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -5
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +38 -38
- data/lib/active_merchant/billing/gateways/usa_epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +37 -37
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
- data/lib/active_merchant/billing/gateways/vanco.rb +25 -25
- data/lib/active_merchant/billing/gateways/verifi.rb +40 -40
- data/lib/active_merchant/billing/gateways/viaklix.rb +5 -5
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +64 -36
- data/lib/active_merchant/billing/gateways/webpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/wepay.rb +25 -25
- data/lib/active_merchant/billing/gateways/wirecard.rb +26 -26
- data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +42 -42
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +17 -17
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/connection.rb +10 -8
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +12 -12
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +37 -0
- data/lib/support/gateway_support.rb +2 -2
- data/lib/support/ssl_verify.rb +5 -5
- data/lib/support/ssl_version.rb +7 -7
- metadata +3 -7
- 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
|
@@ -3,8 +3,8 @@ require 'json'
|
|
|
3
3
|
module ActiveMerchant #:nodoc:
|
|
4
4
|
module Billing #:nodoc:
|
|
5
5
|
class KomojuGateway < Gateway
|
|
6
|
-
self.test_url =
|
|
7
|
-
self.live_url =
|
|
6
|
+
self.test_url = 'https://sandbox.komoju.com/api/v1'
|
|
7
|
+
self.live_url = 'https://komoju.com/api/v1'
|
|
8
8
|
self.supported_countries = ['JP']
|
|
9
9
|
self.default_currency = 'JPY'
|
|
10
10
|
self.money_format = :cents
|
|
@@ -13,10 +13,10 @@ module ActiveMerchant #:nodoc:
|
|
|
13
13
|
self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
|
|
14
14
|
|
|
15
15
|
STANDARD_ERROR_CODE_MAPPING = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
'bad_verification_value' => 'incorrect_cvc',
|
|
17
|
+
'card_expired' => 'expired_card',
|
|
18
|
+
'card_declined' => 'card_declined',
|
|
19
|
+
'invalid_number' => 'invalid_number'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
def initialize(options = {})
|
|
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
|
|
|
34
34
|
post[:tax] = options[:tax] if options[:tax]
|
|
35
35
|
add_fraud_details(post, options)
|
|
36
36
|
|
|
37
|
-
commit(
|
|
37
|
+
commit('/payments', post)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def refund(money, identification, options = {})
|
|
@@ -82,15 +82,15 @@ module ActiveMerchant #:nodoc:
|
|
|
82
82
|
|
|
83
83
|
def commit(path, params)
|
|
84
84
|
response = api_request(path, params.to_json)
|
|
85
|
-
success = !response.key?(
|
|
86
|
-
message = (success ?
|
|
85
|
+
success = !response.key?('error')
|
|
86
|
+
message = (success ? 'Transaction succeeded' : response['error']['message'])
|
|
87
87
|
Response.new(
|
|
88
88
|
success,
|
|
89
89
|
message,
|
|
90
90
|
response,
|
|
91
91
|
test: test?,
|
|
92
|
-
error_code: (success ? nil : error_code(response[
|
|
93
|
-
authorization: (success ? response[
|
|
92
|
+
error_code: (success ? nil : error_code(response['error']['code'])),
|
|
93
|
+
authorization: (success ? response['id'] : nil)
|
|
94
94
|
)
|
|
95
95
|
end
|
|
96
96
|
|
|
@@ -104,10 +104,10 @@ module ActiveMerchant #:nodoc:
|
|
|
104
104
|
|
|
105
105
|
def headers
|
|
106
106
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
'Authorization' => 'Basic ' + Base64.encode64(@options[:login].to_s + ':').strip,
|
|
108
|
+
'Accept' => 'application/json',
|
|
109
|
+
'Content-Type' => 'application/json',
|
|
110
|
+
'User-Agent' => "Komoju/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
|
|
111
111
|
}
|
|
112
112
|
end
|
|
113
113
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
3
|
class KushkiGateway < Gateway
|
|
4
|
-
self.display_name =
|
|
5
|
-
self.homepage_url =
|
|
4
|
+
self.display_name = 'Kushki'
|
|
5
|
+
self.homepage_url = 'https://www.kushkipagos.com'
|
|
6
6
|
|
|
7
|
-
self.test_url =
|
|
8
|
-
self.live_url =
|
|
7
|
+
self.test_url = 'https://api-uat.kushkipagos.com/v1/'
|
|
8
|
+
self.live_url = 'https://api.kushkipagos.com/v1/'
|
|
9
9
|
|
|
10
|
-
self.supported_countries = [
|
|
11
|
-
self.default_currency =
|
|
10
|
+
self.supported_countries = ['CO', 'EC']
|
|
11
|
+
self.default_currency = 'USD'
|
|
12
12
|
self.money_format = :dollars
|
|
13
13
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def refund(amount, authorization, options={})
|
|
28
|
-
action =
|
|
28
|
+
action = 'refund'
|
|
29
29
|
|
|
30
30
|
post = {}
|
|
31
31
|
post[:ticketNumber] = authorization
|
|
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def void(authorization, options={})
|
|
37
|
-
action =
|
|
37
|
+
action = 'void'
|
|
38
38
|
|
|
39
39
|
post = {}
|
|
40
40
|
post[:ticketNumber] = authorization
|
|
@@ -56,7 +56,7 @@ module ActiveMerchant #:nodoc:
|
|
|
56
56
|
private
|
|
57
57
|
|
|
58
58
|
def tokenize(amount, payment_method, options)
|
|
59
|
-
action =
|
|
59
|
+
action = 'tokenize'
|
|
60
60
|
|
|
61
61
|
post = {}
|
|
62
62
|
add_invoice(action, post, amount, options)
|
|
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def charge(amount, authorization, options)
|
|
69
|
-
action =
|
|
69
|
+
action = 'charge'
|
|
70
70
|
|
|
71
71
|
post = {}
|
|
72
72
|
add_reference(post, authorization, options)
|
|
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def add_invoice(action, post, money, options)
|
|
79
|
-
if action ==
|
|
79
|
+
if action == 'tokenize'
|
|
80
80
|
post[:totalAmount] = amount(money).to_f
|
|
81
81
|
post[:currency] = options[:currency] || currency(money)
|
|
82
82
|
post[:isDeferred] = false
|
|
@@ -94,14 +94,7 @@ module ActiveMerchant #:nodoc:
|
|
|
94
94
|
sum[:iva] = 0
|
|
95
95
|
sum[:subtotalIva0] = 0
|
|
96
96
|
|
|
97
|
-
if sum[:currency]
|
|
98
|
-
extra_taxes = {}
|
|
99
|
-
extra_taxes[:propina] = 0
|
|
100
|
-
extra_taxes[:tasaAeroportuaria] = 0
|
|
101
|
-
extra_taxes[:agenciaDeViaje] = 0
|
|
102
|
-
extra_taxes[:iac] = 0
|
|
103
|
-
sum[:extraTaxes] = extra_taxes
|
|
104
|
-
else
|
|
97
|
+
if sum[:currency] != 'COP'
|
|
105
98
|
sum[:ice] = 0
|
|
106
99
|
end
|
|
107
100
|
end
|
|
@@ -112,7 +105,8 @@ module ActiveMerchant #:nodoc:
|
|
|
112
105
|
sum[:iva] = amount[:iva].to_f if amount[:iva]
|
|
113
106
|
sum[:subtotalIva0] = amount[:subtotal_iva_0].to_f if amount[:subtotal_iva_0]
|
|
114
107
|
sum[:ice] = amount[:ice].to_f if amount[:ice]
|
|
115
|
-
if extra_taxes = amount[:extra_taxes] && sum[:currency] ==
|
|
108
|
+
if (extra_taxes = amount[:extra_taxes]) && sum[:currency] == 'COP'
|
|
109
|
+
sum[:extraTaxes] ||= Hash.new
|
|
116
110
|
sum[:extraTaxes][:propina] = extra_taxes[:propina].to_f if extra_taxes[:propina]
|
|
117
111
|
sum[:extraTaxes][:tasaAeroportuaria] = extra_taxes[:tasa_aeroportuaria].to_f if extra_taxes[:tasa_aeroportuaria]
|
|
118
112
|
sum[:extraTaxes][:agenciaDeViaje] = extra_taxes[:agencia_de_viaje].to_f if extra_taxes[:agencia_de_viaje]
|
|
@@ -136,10 +130,10 @@ module ActiveMerchant #:nodoc:
|
|
|
136
130
|
end
|
|
137
131
|
|
|
138
132
|
ENDPOINT = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
'tokenize' => 'tokens',
|
|
134
|
+
'charge' => 'charges',
|
|
135
|
+
'void' => 'charges',
|
|
136
|
+
'refund' => 'refund'
|
|
143
137
|
}
|
|
144
138
|
|
|
145
139
|
def commit(action, params)
|
|
@@ -162,7 +156,7 @@ module ActiveMerchant #:nodoc:
|
|
|
162
156
|
end
|
|
163
157
|
|
|
164
158
|
def ssl_invoke(action, params)
|
|
165
|
-
if [
|
|
159
|
+
if ['void', 'refund'].include?(action)
|
|
166
160
|
ssl_request(:delete, url(action, params), nil, headers(action))
|
|
167
161
|
else
|
|
168
162
|
ssl_post(url(action, params), post_data(params), headers(action))
|
|
@@ -171,9 +165,9 @@ module ActiveMerchant #:nodoc:
|
|
|
171
165
|
|
|
172
166
|
def headers(action)
|
|
173
167
|
hfields = {}
|
|
174
|
-
hfields[
|
|
175
|
-
hfields[
|
|
176
|
-
hfields[
|
|
168
|
+
hfields['Public-Merchant-Id'] = @options[:public_merchant_id] if action == 'tokenize'
|
|
169
|
+
hfields['Private-Merchant-Id'] = @options[:private_merchant_id] unless action == 'tokenize'
|
|
170
|
+
hfields['Content-Type'] = 'application/json'
|
|
177
171
|
hfields
|
|
178
172
|
end
|
|
179
173
|
|
|
@@ -184,8 +178,8 @@ module ActiveMerchant #:nodoc:
|
|
|
184
178
|
def url(action, params)
|
|
185
179
|
base_url = test? ? test_url : live_url
|
|
186
180
|
|
|
187
|
-
if [
|
|
188
|
-
base_url + ENDPOINT[action] +
|
|
181
|
+
if ['void', 'refund'].include?(action)
|
|
182
|
+
base_url + ENDPOINT[action] + '/' + params[:ticketNumber].to_s
|
|
189
183
|
else
|
|
190
184
|
base_url + ENDPOINT[action]
|
|
191
185
|
end
|
|
@@ -195,32 +189,32 @@ module ActiveMerchant #:nodoc:
|
|
|
195
189
|
begin
|
|
196
190
|
JSON.parse(body)
|
|
197
191
|
rescue JSON::ParserError
|
|
198
|
-
message =
|
|
192
|
+
message = 'Invalid JSON response received from KushkiGateway. Please contact KushkiGateway if you continue to receive this message.'
|
|
199
193
|
message += " (The raw response returned by the API was #{body.inspect})"
|
|
200
194
|
{
|
|
201
|
-
|
|
195
|
+
'message' => message
|
|
202
196
|
}
|
|
203
197
|
end
|
|
204
198
|
end
|
|
205
199
|
|
|
206
200
|
def success_from(response)
|
|
207
|
-
return true if response[
|
|
201
|
+
return true if response['token'] || response['ticketNumber'] || response['code'] == 'K000'
|
|
208
202
|
end
|
|
209
203
|
|
|
210
204
|
def message_from(succeeded, response)
|
|
211
205
|
if succeeded
|
|
212
|
-
|
|
206
|
+
'Succeeded'
|
|
213
207
|
else
|
|
214
|
-
response[
|
|
208
|
+
response['message']
|
|
215
209
|
end
|
|
216
210
|
end
|
|
217
211
|
|
|
218
212
|
def authorization_from(response)
|
|
219
|
-
response[
|
|
213
|
+
response['token'] || response['ticketNumber']
|
|
220
214
|
end
|
|
221
215
|
|
|
222
216
|
def error_from(response)
|
|
223
|
-
response[
|
|
217
|
+
response['code']
|
|
224
218
|
end
|
|
225
219
|
end
|
|
226
220
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
3
|
class Latitude19Gateway < Gateway
|
|
4
|
-
self.display_name =
|
|
5
|
-
self.homepage_url =
|
|
4
|
+
self.display_name = 'Latitude19 Gateway'
|
|
5
|
+
self.homepage_url = 'http://www.l19tech.com'
|
|
6
6
|
|
|
7
|
-
self.live_url =
|
|
8
|
-
self.test_url =
|
|
7
|
+
self.live_url = 'https://gateway.l19tech.com/payments/'
|
|
8
|
+
self.test_url = 'https://gateway-sb.l19tech.com/payments/'
|
|
9
9
|
|
|
10
|
-
self.supported_countries = [
|
|
11
|
-
self.default_currency =
|
|
10
|
+
self.supported_countries = ['US', 'CA']
|
|
11
|
+
self.default_currency = 'USD'
|
|
12
12
|
self.money_format = :cents
|
|
13
13
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
|
|
14
14
|
|
|
@@ -43,12 +43,12 @@ module ActiveMerchant #:nodoc:
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
BRAND_MAP = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
'master' => 'MC',
|
|
47
|
+
'visa' => 'VI',
|
|
48
|
+
'american_express' => 'AX',
|
|
49
|
+
'discover' => 'DS',
|
|
50
|
+
'diners_club' => 'DC',
|
|
51
|
+
'jcb' => 'JC'
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
def initialize(options={})
|
|
@@ -58,31 +58,31 @@ module ActiveMerchant #:nodoc:
|
|
|
58
58
|
|
|
59
59
|
def purchase(amount, payment_method, options={})
|
|
60
60
|
if payment_method.is_a?(String)
|
|
61
|
-
auth_or_sale(
|
|
61
|
+
auth_or_sale('sale', payment_method, amount, nil, options)
|
|
62
62
|
else
|
|
63
63
|
MultiResponse.run() do |r|
|
|
64
64
|
r.process { get_session(options) }
|
|
65
65
|
r.process { get_token(r.authorization, payment_method, options) }
|
|
66
|
-
r.process { auth_or_sale(
|
|
66
|
+
r.process { auth_or_sale('sale', r.authorization, amount, payment_method, options) }
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def authorize(amount, payment_method, options={})
|
|
72
72
|
if payment_method.is_a?(String)
|
|
73
|
-
auth_or_sale(
|
|
73
|
+
auth_or_sale('auth', payment_method, amount, nil, options)
|
|
74
74
|
else
|
|
75
75
|
MultiResponse.run() do |r|
|
|
76
76
|
r.process { get_session(options) }
|
|
77
77
|
r.process { get_token(r.authorization, payment_method, options) }
|
|
78
|
-
r.process { auth_or_sale(
|
|
78
|
+
r.process { auth_or_sale('auth', r.authorization, amount, payment_method, options) }
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def capture(amount, authorization, options={})
|
|
84
84
|
post = {}
|
|
85
|
-
post[:method] =
|
|
85
|
+
post[:method] = 'deposit'
|
|
86
86
|
add_request_id(post)
|
|
87
87
|
|
|
88
88
|
params = {}
|
|
@@ -93,18 +93,18 @@ module ActiveMerchant #:nodoc:
|
|
|
93
93
|
add_credentials(params, post[:method])
|
|
94
94
|
|
|
95
95
|
post[:params] = [params]
|
|
96
|
-
commit(
|
|
96
|
+
commit('v1/', post)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def void(authorization, options={})
|
|
100
100
|
method, pgwTID = split_authorization(authorization)
|
|
101
101
|
case method
|
|
102
|
-
when
|
|
103
|
-
reverse_or_void(
|
|
104
|
-
when
|
|
105
|
-
reverse_or_void(
|
|
102
|
+
when 'auth'
|
|
103
|
+
reverse_or_void('reversal', pgwTID, options)
|
|
104
|
+
when 'deposit', 'sale'
|
|
105
|
+
reverse_or_void('void', pgwTID, options)
|
|
106
106
|
else
|
|
107
|
-
message =
|
|
107
|
+
message = 'Unsupported operation: successful Purchase, Authorize and unsettled Capture transactions can only be voided.'
|
|
108
108
|
return Response.new(false, message)
|
|
109
109
|
end
|
|
110
110
|
end
|
|
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
|
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
def store(payment_method, options={})
|
|
137
|
-
verify(payment_method, options,
|
|
137
|
+
verify(payment_method, options, 'store')
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
def supports_scrubbing?
|
|
@@ -155,14 +155,14 @@ module ActiveMerchant #:nodoc:
|
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
def add_timestamp()
|
|
158
|
-
Time.now.getutc.strftime(
|
|
158
|
+
Time.now.getutc.strftime('%Y%m%d%H%M%S')
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
def add_hmac(params, method)
|
|
162
|
-
if method ==
|
|
163
|
-
hmac_message = params[:pgwAccountNumber] +
|
|
162
|
+
if method == 'getSession'
|
|
163
|
+
hmac_message = params[:pgwAccountNumber] + '|' + params[:pgwConfigurationId] + '|' + params[:requestTimeStamp] + '|' + method
|
|
164
164
|
else
|
|
165
|
-
hmac_message = params[:pgwAccountNumber] +
|
|
165
|
+
hmac_message = params[:pgwAccountNumber] + '|' + params[:pgwConfigurationId] + '|' + (params[:orderNumber] || '') + '|' + method + '|' + (params[:amount] || '') + '|' + (params[:sessionToken] || '') + '|' + (params[:accountToken] || '')
|
|
166
166
|
end
|
|
167
167
|
|
|
168
168
|
OpenSSL::HMAC.hexdigest('sha512', @options[:secret], hmac_message)
|
|
@@ -172,7 +172,7 @@ module ActiveMerchant #:nodoc:
|
|
|
172
172
|
params[:pgwAccountNumber] = @options[:account_number]
|
|
173
173
|
params[:pgwConfigurationId] = @options[:configuration_id]
|
|
174
174
|
|
|
175
|
-
params[:requestTimeStamp] = add_timestamp() if method ==
|
|
175
|
+
params[:requestTimeStamp] = add_timestamp() if method == 'getSession'
|
|
176
176
|
|
|
177
177
|
params[:pgwHMAC] = add_hmac(params, method)
|
|
178
178
|
end
|
|
@@ -180,11 +180,11 @@ module ActiveMerchant #:nodoc:
|
|
|
180
180
|
def add_invoice(params, money, options)
|
|
181
181
|
params[:amount] = amount(money)
|
|
182
182
|
params[:orderNumber] = options[:order_id]
|
|
183
|
-
params[:transactionClass] = options[:transaction_class] ||
|
|
183
|
+
params[:transactionClass] = options[:transaction_class] || 'eCommerce'
|
|
184
184
|
end
|
|
185
185
|
|
|
186
186
|
def add_payment_method(params, credit_card)
|
|
187
|
-
params[:cardExp] = format(credit_card.month, :two_digits).to_s +
|
|
187
|
+
params[:cardExp] = format(credit_card.month, :two_digits).to_s + '/' + format(credit_card.year, :two_digits).to_s
|
|
188
188
|
params[:cardType] = BRAND_MAP[credit_card.brand.to_s]
|
|
189
189
|
params[:cvv] = credit_card.verification_value
|
|
190
190
|
params[:firstName] = credit_card.first_name
|
|
@@ -204,19 +204,19 @@ module ActiveMerchant #:nodoc:
|
|
|
204
204
|
|
|
205
205
|
def get_session(options={})
|
|
206
206
|
post = {}
|
|
207
|
-
post[:method] =
|
|
207
|
+
post[:method] = 'getSession'
|
|
208
208
|
add_request_id(post)
|
|
209
209
|
|
|
210
210
|
params = {}
|
|
211
211
|
add_credentials(params, post[:method])
|
|
212
212
|
|
|
213
213
|
post[:params] = [params]
|
|
214
|
-
commit(
|
|
214
|
+
commit('session', post)
|
|
215
215
|
end
|
|
216
216
|
|
|
217
217
|
def get_token(authorization, payment_method, options={})
|
|
218
218
|
post = {}
|
|
219
|
-
post[:method] =
|
|
219
|
+
post[:method] = 'tokenize'
|
|
220
220
|
add_request_id(post)
|
|
221
221
|
|
|
222
222
|
params = {}
|
|
@@ -224,7 +224,7 @@ module ActiveMerchant #:nodoc:
|
|
|
224
224
|
params[:cardNumber] = payment_method.number
|
|
225
225
|
|
|
226
226
|
post[:params] = [params]
|
|
227
|
-
commit(
|
|
227
|
+
commit('token', post)
|
|
228
228
|
end
|
|
229
229
|
|
|
230
230
|
def auth_or_sale(method, authorization, amount, credit_card, options={})
|
|
@@ -244,12 +244,12 @@ module ActiveMerchant #:nodoc:
|
|
|
244
244
|
add_credentials(params, post[:method])
|
|
245
245
|
|
|
246
246
|
post[:params] = [params]
|
|
247
|
-
commit(
|
|
247
|
+
commit('v1/', post)
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
def verifyOnly(action, authorization, credit_card, options={})
|
|
251
251
|
post = {}
|
|
252
|
-
post[:method] =
|
|
252
|
+
post[:method] = 'verifyOnly'
|
|
253
253
|
add_request_id(post)
|
|
254
254
|
|
|
255
255
|
params = {}
|
|
@@ -260,17 +260,17 @@ module ActiveMerchant #:nodoc:
|
|
|
260
260
|
else
|
|
261
261
|
_, params[:accountToken] = split_authorization(authorization)
|
|
262
262
|
end
|
|
263
|
-
params[:requestAccountToken] =
|
|
263
|
+
params[:requestAccountToken] = '1' if action == 'store'
|
|
264
264
|
add_invoice(params, 0, options)
|
|
265
265
|
add_credentials(params, post[:method])
|
|
266
266
|
|
|
267
267
|
post[:params] = [params]
|
|
268
|
-
commit(
|
|
268
|
+
commit('v1/', post)
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
def refundWithCard(authorization, amount, credit_card, options={})
|
|
272
272
|
post = {}
|
|
273
|
-
post[:method] =
|
|
273
|
+
post[:method] = 'refundWithCard'
|
|
274
274
|
add_request_id(post)
|
|
275
275
|
|
|
276
276
|
params = {}
|
|
@@ -284,7 +284,7 @@ module ActiveMerchant #:nodoc:
|
|
|
284
284
|
add_credentials(params, post[:method])
|
|
285
285
|
|
|
286
286
|
post[:params] = [params]
|
|
287
|
-
commit(
|
|
287
|
+
commit('v1/', post)
|
|
288
288
|
end
|
|
289
289
|
|
|
290
290
|
def reverse_or_void(method, pgwTID, options={})
|
|
@@ -298,7 +298,7 @@ module ActiveMerchant #:nodoc:
|
|
|
298
298
|
add_credentials(params, post[:method])
|
|
299
299
|
|
|
300
300
|
post[:params] = [params]
|
|
301
|
-
commit(
|
|
301
|
+
commit('v1/', post)
|
|
302
302
|
end
|
|
303
303
|
|
|
304
304
|
def commit(endpoint, post)
|
|
@@ -327,7 +327,7 @@ module ActiveMerchant #:nodoc:
|
|
|
327
327
|
|
|
328
328
|
def headers
|
|
329
329
|
{
|
|
330
|
-
|
|
330
|
+
'Content-Type' => 'application/json'
|
|
331
331
|
}
|
|
332
332
|
end
|
|
333
333
|
|
|
@@ -344,51 +344,51 @@ module ActiveMerchant #:nodoc:
|
|
|
344
344
|
end
|
|
345
345
|
|
|
346
346
|
def success_from(response)
|
|
347
|
-
return false if response[
|
|
347
|
+
return false if response['result'].nil? || response['error']
|
|
348
348
|
|
|
349
|
-
if response[
|
|
350
|
-
response[
|
|
349
|
+
if response['result'].key?('pgwResponseCode')
|
|
350
|
+
response['error'].nil? && response['result']['lastActionSucceeded'] == 1 && response['result']['pgwResponseCode'] == '100'
|
|
351
351
|
else
|
|
352
|
-
response[
|
|
352
|
+
response['error'].nil? && response['result']['lastActionSucceeded'] == 1
|
|
353
353
|
end
|
|
354
354
|
end
|
|
355
355
|
|
|
356
356
|
def message_from(response)
|
|
357
|
-
return response[
|
|
358
|
-
return
|
|
357
|
+
return response['error'] if response['error']
|
|
358
|
+
return 'Failed' unless response.key?('result')
|
|
359
359
|
|
|
360
|
-
if response[
|
|
361
|
-
RESPONSE_CODE_MAPPING[response[
|
|
360
|
+
if response['result'].key?('pgwResponseCode')
|
|
361
|
+
RESPONSE_CODE_MAPPING[response['result']['pgwResponseCode']] || response['result']['responseText']
|
|
362
362
|
else
|
|
363
|
-
response[
|
|
363
|
+
response['result']['lastActionSucceeded'] == 1 ? 'Succeeded' : 'Failed'
|
|
364
364
|
end
|
|
365
365
|
end
|
|
366
366
|
|
|
367
367
|
def error_from(response)
|
|
368
|
-
return response[
|
|
369
|
-
return
|
|
370
|
-
return response[
|
|
368
|
+
return response['error'] if response['error']
|
|
369
|
+
return 'Failed' unless response.key?('result')
|
|
370
|
+
return response['result']['pgwResponseCode'] || response['result']['processor']['responseCode'] || 'Failed'
|
|
371
371
|
end
|
|
372
372
|
|
|
373
373
|
def authorization_from(response, method)
|
|
374
|
-
method +
|
|
375
|
-
response[
|
|
376
|
-
response[
|
|
377
|
-
response[
|
|
378
|
-
response[
|
|
374
|
+
method + '|' + (
|
|
375
|
+
response['result']['sessionId'] ||
|
|
376
|
+
response['result']['sessionToken'] ||
|
|
377
|
+
response['result']['pgwTID'] ||
|
|
378
|
+
response['result']['accountToken']
|
|
379
379
|
)
|
|
380
380
|
end
|
|
381
381
|
|
|
382
382
|
def split_authorization(authorization)
|
|
383
|
-
authorization.split(
|
|
383
|
+
authorization.split('|')
|
|
384
384
|
end
|
|
385
385
|
|
|
386
386
|
def avs_from(response)
|
|
387
|
-
response[
|
|
387
|
+
response['result'].key?('avsResponse') ? AVSResult.new(code: response['result']['avsResponse']) : nil
|
|
388
388
|
end
|
|
389
389
|
|
|
390
390
|
def cvv_from(response)
|
|
391
|
-
response[
|
|
391
|
+
response['result'].key?('cvvResponse') ? CVVResult.new(response['result']['cvvResponse']) : nil
|
|
392
392
|
end
|
|
393
393
|
|
|
394
394
|
def response_error(raw_response)
|
|
@@ -407,7 +407,7 @@ module ActiveMerchant #:nodoc:
|
|
|
407
407
|
end
|
|
408
408
|
|
|
409
409
|
def unparsable_response(raw_response)
|
|
410
|
-
message =
|
|
410
|
+
message = 'Invalid JSON response received from Latitude19Gateway. Please contact Latitude19Gateway if you continue to receive this message.'
|
|
411
411
|
message += " (The raw response returned by the API was #{raw_response.inspect})"
|
|
412
412
|
return Response.new(false, message)
|
|
413
413
|
end
|