activemerchant 1.79.2 → 1.129.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +1391 -0
- data/README.md +29 -14
- data/lib/active_merchant/billing/avs_result.rb +25 -28
- data/lib/active_merchant/billing/base.rb +0 -13
- data/lib/active_merchant/billing/check.rb +55 -22
- data/lib/active_merchant/billing/compatibility.rb +10 -12
- data/lib/active_merchant/billing/credit_card.rb +82 -62
- data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
- data/lib/active_merchant/billing/credit_card_methods.rb +328 -58
- data/lib/active_merchant/billing/cvv_result.rb +0 -1
- data/lib/active_merchant/billing/gateway.rb +61 -56
- data/lib/active_merchant/billing/gateways/adyen.rb +562 -87
- 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 +35 -36
- data/lib/active_merchant/billing/gateways/authorize_net.rb +297 -196
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +94 -98
- data/lib/active_merchant/billing/gateways/axcessms.rb +64 -66
- data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
- data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
- data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
- data/lib/active_merchant/billing/gateways/banwire.rb +12 -12
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +140 -69
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
- data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +115 -115
- data/lib/active_merchant/billing/gateways/beanstream.rb +39 -13
- data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -2
- data/lib/active_merchant/billing/gateways/blue_pay.rb +87 -58
- data/lib/active_merchant/billing/gateways/blue_snap.rb +405 -104
- data/lib/active_merchant/billing/gateways/bogus.rb +34 -30
- data/lib/active_merchant/billing/gateways/borgun.rb +97 -47
- data/lib/active_merchant/billing/gateways/bpoint.rb +20 -20
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -3
- 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 +561 -259
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +53 -54
- data/lib/active_merchant/billing/gateways/cams.rb +31 -31
- data/lib/active_merchant/billing/gateways/card_connect.rb +85 -33
- data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +187 -169
- data/lib/active_merchant/billing/gateways/cardknox.rb +24 -25
- data/lib/active_merchant/billing/gateways/cardprocess.rb +9 -7
- data/lib/active_merchant/billing/gateways/cashnet.rb +43 -27
- data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
- data/lib/active_merchant/billing/gateways/cecabank.rb +62 -52
- data/lib/active_merchant/billing/gateways/cenpos.rb +63 -62
- data/lib/active_merchant/billing/gateways/checkout.rb +21 -23
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +391 -113
- data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -3
- data/lib/active_merchant/billing/gateways/clearhaus.rb +40 -41
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +361 -0
- data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
- data/lib/active_merchant/billing/gateways/conekta.rb +35 -30
- data/lib/active_merchant/billing/gateways/creditcall.rb +59 -59
- data/lib/active_merchant/billing/gateways/credorax.rb +326 -145
- data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
- data/lib/active_merchant/billing/gateways/culqi.rb +53 -53
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +566 -208
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +456 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +342 -0
- data/lib/active_merchant/billing/gateways/data_cash.rb +40 -56
- data/lib/active_merchant/billing/gateways/decidir.rb +358 -0
- data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
- data/lib/active_merchant/billing/gateways/dibs.rb +34 -40
- data/lib/active_merchant/billing/gateways/digitzs.rb +48 -45
- data/lib/active_merchant/billing/gateways/ebanx.rb +110 -60
- data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
- data/lib/active_merchant/billing/gateways/elavon.rb +351 -189
- data/lib/active_merchant/billing/gateways/element.rb +106 -56
- data/lib/active_merchant/billing/gateways/epay.rb +74 -64
- data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
- data/lib/active_merchant/billing/gateways/eway.rb +74 -73
- data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +105 -60
- data/lib/active_merchant/billing/gateways/exact.rb +29 -37
- data/lib/active_merchant/billing/gateways/ezic.rb +21 -22
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +70 -48
- data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
- data/lib/active_merchant/billing/gateways/finansbank.rb +3 -4
- data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
- data/lib/active_merchant/billing/gateways/first_pay.rb +33 -13
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +106 -105
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
- data/lib/active_merchant/billing/gateways/flo2cash.rb +36 -36
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
- data/lib/active_merchant/billing/gateways/forte.rb +70 -40
- data/lib/active_merchant/billing/gateways/garanti.rb +24 -31
- data/lib/active_merchant/billing/gateways/global_collect.rb +378 -154
- data/lib/active_merchant/billing/gateways/global_transport.rb +12 -13
- data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
- data/lib/active_merchant/billing/gateways/hps.rb +236 -69
- data/lib/active_merchant/billing/gateways/iats_payments.rb +61 -39
- data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +41 -47
- data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
- data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
- data/lib/active_merchant/billing/gateways/ipp.rb +25 -24
- data/lib/active_merchant/billing/gateways/iridium.rb +243 -244
- data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
- data/lib/active_merchant/billing/gateways/iveri.rb +73 -34
- data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
- data/lib/active_merchant/billing/gateways/jetpay.rb +145 -152
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +154 -159
- data/lib/active_merchant/billing/gateways/komoju.rb +16 -16
- data/lib/active_merchant/billing/gateways/kushki.rb +127 -57
- data/lib/active_merchant/billing/gateways/latitude19.rb +111 -115
- data/lib/active_merchant/billing/gateways/linkpoint.rb +82 -85
- data/lib/active_merchant/billing/gateways/litle.rb +247 -53
- data/lib/active_merchant/billing/gateways/mastercard.rb +41 -23
- data/lib/active_merchant/billing/gateways/maxipago.rb +5 -5
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +135 -49
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +62 -29
- data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +40 -40
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +42 -44
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +52 -14
- data/lib/active_merchant/billing/gateways/mercury.rb +47 -51
- data/lib/active_merchant/billing/gateways/metrics_global.rb +32 -42
- data/lib/active_merchant/billing/gateways/micropayment.rb +42 -45
- data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
- data/lib/active_merchant/billing/gateways/migs.rb +45 -40
- data/lib/active_merchant/billing/gateways/mit.rb +260 -0
- data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +29 -31
- data/lib/active_merchant/billing/gateways/moka.rb +290 -0
- data/lib/active_merchant/billing/gateways/monei.rb +255 -138
- data/lib/active_merchant/billing/gateways/moneris.rb +226 -88
- data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
- data/lib/active_merchant/billing/gateways/mundipagg.rb +117 -43
- data/lib/active_merchant/billing/gateways/nab_transact.rb +28 -31
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +13 -15
- data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
- data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
- data/lib/active_merchant/billing/gateways/netbanx.rb +167 -80
- data/lib/active_merchant/billing/gateways/netbilling.rb +27 -30
- data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
- data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
- data/lib/active_merchant/billing/gateways/nmi.rb +134 -48
- data/lib/active_merchant/billing/gateways/ogone.rb +88 -58
- data/lib/active_merchant/billing/gateways/omise.rb +30 -31
- data/lib/active_merchant/billing/gateways/openpay.rb +45 -26
- data/lib/active_merchant/billing/gateways/opp.rb +166 -144
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +67 -64
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
- data/lib/active_merchant/billing/gateways/orbital.rb +726 -382
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +26 -27
- data/lib/active_merchant/billing/gateways/pagarme.rb +47 -56
- data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
- data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
- data/lib/active_merchant/billing/gateways/pay_conex.rb +39 -40
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +65 -65
- data/lib/active_merchant/billing/gateways/pay_hub.rb +39 -39
- data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +70 -54
- data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
- data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +71 -47
- data/lib/active_merchant/billing/gateways/payeezy.rb +159 -32
- data/lib/active_merchant/billing/gateways/payex.rb +39 -42
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +41 -36
- data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
- data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
- data/lib/active_merchant/billing/gateways/payflow.rb +178 -54
- data/lib/active_merchant/billing/gateways/payflow_express.rb +61 -65
- data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +0 -1
- data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +66 -58
- data/lib/active_merchant/billing/gateways/paymentez.rb +114 -25
- data/lib/active_merchant/billing/gateways/paymill.rb +134 -133
- 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 +27 -14
- data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
- data/lib/active_merchant/billing/gateways/paypal_express.rb +5 -2
- 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 +10 -13
- data/lib/active_merchant/billing/gateways/paystation.rb +79 -82
- data/lib/active_merchant/billing/gateways/payu_in.rb +59 -58
- data/lib/active_merchant/billing/gateways/payu_latam.rb +139 -97
- data/lib/active_merchant/billing/gateways/payway.rb +27 -27
- data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
- data/lib/active_merchant/billing/gateways/pin.rb +87 -34
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
- data/lib/active_merchant/billing/gateways/priority.rb +392 -0
- data/lib/active_merchant/billing/gateways/pro_pay.rb +139 -140
- data/lib/active_merchant/billing/gateways/psigate.rb +44 -44
- data/lib/active_merchant/billing/gateways/psl_card.rb +29 -37
- data/lib/active_merchant/billing/gateways/qbms.rb +75 -76
- data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
- data/lib/active_merchant/billing/gateways/quickbooks.rb +142 -55
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +103 -107
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +156 -158
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +7 -8
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +137 -68
- 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 +132 -50
- data/lib/active_merchant/billing/gateways/redsys.rb +382 -186
- data/lib/active_merchant/billing/gateways/s5.rb +16 -16
- data/lib/active_merchant/billing/gateways/safe_charge.rb +83 -47
- data/lib/active_merchant/billing/gateways/sage.rb +49 -48
- data/lib/active_merchant/billing/gateways/sage_pay.rb +76 -83
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
- data/lib/active_merchant/billing/gateways/secure_net.rb +32 -40
- data/lib/active_merchant/billing/gateways/secure_pay.rb +30 -40
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +23 -26
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
- data/lib/active_merchant/billing/gateways/securion_pay.rb +69 -31
- data/lib/active_merchant/billing/gateways/shift4.rb +342 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
- data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -53
- data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +66 -47
- data/lib/active_merchant/billing/gateways/stripe.rb +309 -148
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +556 -0
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +18 -23
- data/lib/active_merchant/billing/gateways/telr.rb +46 -48
- data/lib/active_merchant/billing/gateways/tns.rb +8 -7
- data/lib/active_merchant/billing/gateways/trans_first.rb +37 -37
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +249 -245
- data/lib/active_merchant/billing/gateways/transact_pro.rb +25 -27
- data/lib/active_merchant/billing/gateways/transax.rb +6 -8
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +22 -18
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +161 -88
- data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +231 -238
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +129 -55
- data/lib/active_merchant/billing/gateways/vanco.rb +42 -33
- data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
- data/lib/active_merchant/billing/gateways/viaklix.rb +18 -22
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +115 -74
- data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
- data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +38 -41
- data/lib/active_merchant/billing/gateways/wirecard.rb +36 -37
- data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
- data/lib/active_merchant/billing/gateways/world_net.rb +39 -38
- data/lib/active_merchant/billing/gateways/worldpay.rb +756 -142
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +73 -83
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +31 -31
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +3 -3
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/billing/response.rb +32 -13
- 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 +24 -38
- data/lib/active_merchant/country.rb +9 -5
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +2 -0
- data/lib/active_merchant/network_connection_retries.rb +28 -31
- data/lib/active_merchant/post_data.rb +5 -3
- data/lib/active_merchant/posts_data.rb +5 -7
- data/lib/active_merchant/version.rb +1 -1
- data/lib/active_merchant.rb +3 -3
- data/lib/activemerchant.rb +1 -1
- data/lib/certs/cacert.pem +1592 -2329
- data/lib/support/gateway_support.rb +8 -10
- data/lib/support/ssl_verify.rb +9 -14
- data/lib/support/ssl_version.rb +9 -10
- metadata +98 -37
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
- data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -309
@@ -1,16 +1,16 @@
|
|
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 =
|
12
|
-
self.money_format = :
|
13
|
-
self.supported_cardtypes = [
|
10
|
+
self.supported_countries = %w[US CA]
|
11
|
+
self.default_currency = 'USD'
|
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',
|
@@ -43,46 +43,46 @@ 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
|
-
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
|
-
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
|
-
def authorize(amount, payment_method, options={})
|
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
|
-
def capture(amount, authorization, options={})
|
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,23 +93,23 @@ 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
|
-
def void(authorization, options={})
|
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
|
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,8 +133,8 @@ module ActiveMerchant #:nodoc:
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
def store(payment_method, options={})
|
137
|
-
verify(payment_method, options,
|
136
|
+
def store(payment_method, options = {})
|
137
|
+
verify(payment_method, options, 'store')
|
138
138
|
end
|
139
139
|
|
140
140
|
def supports_scrubbing?
|
@@ -147,22 +147,21 @@ module ActiveMerchant #:nodoc:
|
|
147
147
|
gsub(%r((\"cvv\\\":\\\")\d+), '\1[FILTERED]')
|
148
148
|
end
|
149
149
|
|
150
|
-
|
151
150
|
private
|
152
151
|
|
153
152
|
def add_request_id(post)
|
154
153
|
post[:id] = SecureRandom.hex(16)
|
155
154
|
end
|
156
155
|
|
157
|
-
def add_timestamp
|
158
|
-
Time.now.getutc.strftime(
|
156
|
+
def add_timestamp
|
157
|
+
Time.now.getutc.strftime('%Y%m%d%H%M%S')
|
159
158
|
end
|
160
159
|
|
161
160
|
def add_hmac(params, method)
|
162
|
-
if method ==
|
163
|
-
hmac_message = params[:pgwAccountNumber] +
|
161
|
+
if method == 'getSession'
|
162
|
+
hmac_message = params[:pgwAccountNumber] + '|' + params[:pgwConfigurationId] + '|' + params[:requestTimeStamp] + '|' + method
|
164
163
|
else
|
165
|
-
hmac_message = params[:pgwAccountNumber] +
|
164
|
+
hmac_message = params[:pgwAccountNumber] + '|' + params[:pgwConfigurationId] + '|' + (params[:orderNumber] || '') + '|' + method + '|' + (params[:amount] || '') + '|' + (params[:sessionToken] || '') + '|' + (params[:accountToken] || '')
|
166
165
|
end
|
167
166
|
|
168
167
|
OpenSSL::HMAC.hexdigest('sha512', @options[:secret], hmac_message)
|
@@ -172,7 +171,7 @@ module ActiveMerchant #:nodoc:
|
|
172
171
|
params[:pgwAccountNumber] = @options[:account_number]
|
173
172
|
params[:pgwConfigurationId] = @options[:configuration_id]
|
174
173
|
|
175
|
-
params[:requestTimeStamp] = add_timestamp() if method ==
|
174
|
+
params[:requestTimeStamp] = add_timestamp() if method == 'getSession'
|
176
175
|
|
177
176
|
params[:pgwHMAC] = add_hmac(params, method)
|
178
177
|
end
|
@@ -180,11 +179,11 @@ module ActiveMerchant #:nodoc:
|
|
180
179
|
def add_invoice(params, money, options)
|
181
180
|
params[:amount] = amount(money)
|
182
181
|
params[:orderNumber] = options[:order_id]
|
183
|
-
params[:transactionClass] = options[:transaction_class] ||
|
182
|
+
params[:transactionClass] = options[:transaction_class] || 'eCommerce'
|
184
183
|
end
|
185
184
|
|
186
185
|
def add_payment_method(params, credit_card)
|
187
|
-
params[:cardExp] = format(credit_card.month, :two_digits).to_s +
|
186
|
+
params[:cardExp] = format(credit_card.month, :two_digits).to_s + '/' + format(credit_card.year, :two_digits).to_s
|
188
187
|
params[:cardType] = BRAND_MAP[credit_card.brand.to_s]
|
189
188
|
params[:cvv] = credit_card.verification_value
|
190
189
|
params[:firstName] = credit_card.first_name
|
@@ -202,21 +201,21 @@ module ActiveMerchant #:nodoc:
|
|
202
201
|
end
|
203
202
|
end
|
204
203
|
|
205
|
-
def get_session(options={})
|
204
|
+
def get_session(options = {})
|
206
205
|
post = {}
|
207
|
-
post[:method] =
|
206
|
+
post[:method] = 'getSession'
|
208
207
|
add_request_id(post)
|
209
208
|
|
210
209
|
params = {}
|
211
210
|
add_credentials(params, post[:method])
|
212
211
|
|
213
212
|
post[:params] = [params]
|
214
|
-
commit(
|
213
|
+
commit('session', post)
|
215
214
|
end
|
216
215
|
|
217
|
-
def get_token(authorization, payment_method, options={})
|
216
|
+
def get_token(authorization, payment_method, options = {})
|
218
217
|
post = {}
|
219
|
-
post[:method] =
|
218
|
+
post[:method] = 'tokenize'
|
220
219
|
add_request_id(post)
|
221
220
|
|
222
221
|
params = {}
|
@@ -224,10 +223,10 @@ module ActiveMerchant #:nodoc:
|
|
224
223
|
params[:cardNumber] = payment_method.number
|
225
224
|
|
226
225
|
post[:params] = [params]
|
227
|
-
commit(
|
226
|
+
commit('token', post)
|
228
227
|
end
|
229
228
|
|
230
|
-
def auth_or_sale(method, authorization, amount, credit_card, options={})
|
229
|
+
def auth_or_sale(method, authorization, amount, credit_card, options = {})
|
231
230
|
post = {}
|
232
231
|
post[:method] = method
|
233
232
|
add_request_id(post)
|
@@ -244,12 +243,12 @@ module ActiveMerchant #:nodoc:
|
|
244
243
|
add_credentials(params, post[:method])
|
245
244
|
|
246
245
|
post[:params] = [params]
|
247
|
-
commit(
|
246
|
+
commit('v1/', post)
|
248
247
|
end
|
249
248
|
|
250
|
-
def verifyOnly(action, authorization, credit_card, options={})
|
249
|
+
def verifyOnly(action, authorization, credit_card, options = {})
|
251
250
|
post = {}
|
252
|
-
post[:method] =
|
251
|
+
post[:method] = 'verifyOnly'
|
253
252
|
add_request_id(post)
|
254
253
|
|
255
254
|
params = {}
|
@@ -260,17 +259,17 @@ module ActiveMerchant #:nodoc:
|
|
260
259
|
else
|
261
260
|
_, params[:accountToken] = split_authorization(authorization)
|
262
261
|
end
|
263
|
-
params[:requestAccountToken] =
|
262
|
+
params[:requestAccountToken] = '1' if action == 'store'
|
264
263
|
add_invoice(params, 0, options)
|
265
264
|
add_credentials(params, post[:method])
|
266
265
|
|
267
266
|
post[:params] = [params]
|
268
|
-
commit(
|
267
|
+
commit('v1/', post)
|
269
268
|
end
|
270
269
|
|
271
|
-
def refundWithCard(authorization, amount, credit_card, options={})
|
270
|
+
def refundWithCard(authorization, amount, credit_card, options = {})
|
272
271
|
post = {}
|
273
|
-
post[:method] =
|
272
|
+
post[:method] = 'refundWithCard'
|
274
273
|
add_request_id(post)
|
275
274
|
|
276
275
|
params = {}
|
@@ -284,10 +283,10 @@ module ActiveMerchant #:nodoc:
|
|
284
283
|
add_credentials(params, post[:method])
|
285
284
|
|
286
285
|
post[:params] = [params]
|
287
|
-
commit(
|
286
|
+
commit('v1/', post)
|
288
287
|
end
|
289
288
|
|
290
|
-
def reverse_or_void(method, pgwTID, options={})
|
289
|
+
def reverse_or_void(method, pgwTID, options = {})
|
291
290
|
post = {}
|
292
291
|
post[:method] = method
|
293
292
|
add_request_id(post)
|
@@ -298,36 +297,34 @@ module ActiveMerchant #:nodoc:
|
|
298
297
|
add_credentials(params, post[:method])
|
299
298
|
|
300
299
|
post[:params] = [params]
|
301
|
-
commit(
|
300
|
+
commit('v1/', post)
|
302
301
|
end
|
303
302
|
|
304
303
|
def commit(endpoint, post)
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
)
|
325
|
-
end
|
304
|
+
raw_response = ssl_post(url() + endpoint, post_data(post), headers)
|
305
|
+
response = parse(raw_response)
|
306
|
+
rescue ResponseError => e
|
307
|
+
raw_response = e.response.body
|
308
|
+
response_error(raw_response)
|
309
|
+
rescue JSON::ParserError
|
310
|
+
unparsable_response(raw_response)
|
311
|
+
else
|
312
|
+
success = success_from(response)
|
313
|
+
Response.new(
|
314
|
+
success,
|
315
|
+
message_from(response),
|
316
|
+
response,
|
317
|
+
authorization: success ? authorization_from(response, post[:method]) : nil,
|
318
|
+
avs_result: success ? avs_from(response) : nil,
|
319
|
+
cvv_result: success ? cvv_from(response) : nil,
|
320
|
+
error_code: success ? nil : error_from(response),
|
321
|
+
test: test?
|
322
|
+
)
|
326
323
|
end
|
327
324
|
|
328
325
|
def headers
|
329
326
|
{
|
330
|
-
|
327
|
+
'Content-Type' => 'application/json'
|
331
328
|
}
|
332
329
|
end
|
333
330
|
|
@@ -344,70 +341,69 @@ module ActiveMerchant #:nodoc:
|
|
344
341
|
end
|
345
342
|
|
346
343
|
def success_from(response)
|
347
|
-
return false if response[
|
344
|
+
return false if response['result'].nil? || response['error']
|
348
345
|
|
349
|
-
if response[
|
350
|
-
response[
|
346
|
+
if response['result'].key?('pgwResponseCode')
|
347
|
+
response['error'].nil? && response['result']['lastActionSucceeded'] == 1 && response['result']['pgwResponseCode'] == '100'
|
351
348
|
else
|
352
|
-
response[
|
349
|
+
response['error'].nil? && response['result']['lastActionSucceeded'] == 1
|
353
350
|
end
|
354
351
|
end
|
355
352
|
|
356
353
|
def message_from(response)
|
357
|
-
return response[
|
358
|
-
return
|
354
|
+
return response['error'] if response['error']
|
355
|
+
return 'Failed' unless response.key?('result')
|
359
356
|
|
360
|
-
if response[
|
361
|
-
RESPONSE_CODE_MAPPING[response[
|
357
|
+
if response['result'].key?('pgwResponseCode')
|
358
|
+
RESPONSE_CODE_MAPPING[response['result']['pgwResponseCode']] || response['result']['responseText']
|
362
359
|
else
|
363
|
-
response[
|
360
|
+
response['result']['lastActionSucceeded'] == 1 ? 'Succeeded' : 'Failed'
|
364
361
|
end
|
365
362
|
end
|
366
363
|
|
367
364
|
def error_from(response)
|
368
|
-
return response[
|
369
|
-
return
|
370
|
-
|
365
|
+
return response['error'] if response['error']
|
366
|
+
return 'Failed' unless response.key?('result')
|
367
|
+
|
368
|
+
return response['result']['pgwResponseCode'] || response['result']['processor']['responseCode'] || 'Failed'
|
371
369
|
end
|
372
370
|
|
373
371
|
def authorization_from(response, method)
|
374
|
-
method +
|
375
|
-
response[
|
376
|
-
response[
|
377
|
-
response[
|
378
|
-
response[
|
372
|
+
method + '|' + (
|
373
|
+
response['result']['sessionId'] ||
|
374
|
+
response['result']['sessionToken'] ||
|
375
|
+
response['result']['pgwTID'] ||
|
376
|
+
response['result']['accountToken']
|
379
377
|
)
|
380
378
|
end
|
381
379
|
|
382
380
|
def split_authorization(authorization)
|
383
|
-
authorization.split(
|
381
|
+
authorization.split('|')
|
384
382
|
end
|
385
383
|
|
386
384
|
def avs_from(response)
|
387
|
-
response[
|
385
|
+
response['result'].key?('avsResponse') ? AVSResult.new(code: response['result']['avsResponse']) : nil
|
388
386
|
end
|
389
387
|
|
390
388
|
def cvv_from(response)
|
391
|
-
response[
|
389
|
+
response['result'].key?('cvvResponse') ? CVVResult.new(response['result']['cvvResponse']) : nil
|
392
390
|
end
|
393
391
|
|
394
392
|
def response_error(raw_response)
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
)
|
406
|
-
end
|
393
|
+
response = parse(raw_response)
|
394
|
+
rescue JSON::ParserError
|
395
|
+
unparsable_response(raw_response)
|
396
|
+
else
|
397
|
+
return Response.new(
|
398
|
+
false,
|
399
|
+
message_from(response),
|
400
|
+
response,
|
401
|
+
test: test?
|
402
|
+
)
|
407
403
|
end
|
408
404
|
|
409
405
|
def unparsable_response(raw_response)
|
410
|
-
message =
|
406
|
+
message = 'Invalid JSON response received from Latitude19Gateway. Please contact Latitude19Gateway if you continue to receive this message.'
|
411
407
|
message += " (The raw response returned by the API was #{raw_response.inspect})"
|
412
408
|
return Response.new(false, message)
|
413
409
|
end
|