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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module ActiveMerchant #:nodoc:
|
|
2
2
|
module Billing #:nodoc:
|
|
3
3
|
class AlliedWalletGateway < Gateway
|
|
4
|
-
self.display_name =
|
|
5
|
-
self.homepage_url =
|
|
4
|
+
self.display_name = 'Allied Wallet'
|
|
5
|
+
self.homepage_url = 'https://www.alliedwallet.com'
|
|
6
6
|
|
|
7
|
-
self.live_url =
|
|
7
|
+
self.live_url = 'https://api.alliedwallet.com/merchants/'
|
|
8
8
|
|
|
9
|
-
self.supported_countries = [
|
|
10
|
-
self.default_currency =
|
|
9
|
+
self.supported_countries = ['US']
|
|
10
|
+
self.default_currency = 'USD'
|
|
11
11
|
self.money_format = :dollars
|
|
12
12
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover,
|
|
13
13
|
:diners_club, :jcb, :maestro]
|
|
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def add_customer_data(post, options)
|
|
107
|
-
post[:email] = options[:email] ||
|
|
107
|
+
post[:email] = options[:email] || 'unspecified@example.com'
|
|
108
108
|
post[:iPAddress] = options[:ip]
|
|
109
109
|
if (billing_address = options[:billing_address])
|
|
110
110
|
post[:firstName], post[:lastName] = split_names(billing_address[:name])
|
|
@@ -130,11 +130,11 @@ module ActiveMerchant #:nodoc:
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
ACTIONS = {
|
|
133
|
-
purchase:
|
|
134
|
-
authorize:
|
|
135
|
-
capture:
|
|
136
|
-
void:
|
|
137
|
-
refund:
|
|
133
|
+
purchase: 'SALE',
|
|
134
|
+
authorize: 'AUTHORIZE',
|
|
135
|
+
capture: 'CAPTURE',
|
|
136
|
+
void: 'VOID',
|
|
137
|
+
refund: 'REFUND'
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
def commit(action, post)
|
|
@@ -146,14 +146,14 @@ module ActiveMerchant #:nodoc:
|
|
|
146
146
|
response = parse(e.response.body)
|
|
147
147
|
end
|
|
148
148
|
|
|
149
|
-
succeeded = success_from(response[
|
|
149
|
+
succeeded = success_from(response['status'])
|
|
150
150
|
Response.new(
|
|
151
151
|
succeeded,
|
|
152
152
|
message_from(succeeded, response),
|
|
153
153
|
response,
|
|
154
|
-
authorization: response[
|
|
155
|
-
:avs_result => AVSResult.new(code: response[
|
|
156
|
-
:cvv_result => CVVResult.new(response[
|
|
154
|
+
authorization: response['id'],
|
|
155
|
+
:avs_result => AVSResult.new(code: response['avs_response']),
|
|
156
|
+
:cvv_result => CVVResult.new(response['cvv2_response']),
|
|
157
157
|
test: test?
|
|
158
158
|
)
|
|
159
159
|
rescue JSON::ParserError
|
|
@@ -161,20 +161,20 @@ module ActiveMerchant #:nodoc:
|
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
def unparsable_response(raw_response)
|
|
164
|
-
message =
|
|
164
|
+
message = 'Unparsable response received from Allied Wallet. Please contact Allied Wallet if you continue to receive this message.'
|
|
165
165
|
message += " (The raw response returned by the API was #{raw_response.inspect})"
|
|
166
166
|
return Response.new(false, message)
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
def headers
|
|
170
170
|
{
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
'Content-type' => 'application/json',
|
|
172
|
+
'Authorization' => 'Bearer ' + @options[:token]
|
|
173
173
|
}
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
def url(action)
|
|
177
|
-
live_url + CGI.escape(@options[:merchant_id]) +
|
|
177
|
+
live_url + CGI.escape(@options[:merchant_id]) + '/' + ACTIONS[action] + 'transactions'
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
def parse(body)
|
|
@@ -190,14 +190,14 @@ module ActiveMerchant #:nodoc:
|
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
def success_from(response)
|
|
193
|
-
response ==
|
|
193
|
+
response == 'Successful'
|
|
194
194
|
end
|
|
195
195
|
|
|
196
196
|
def message_from(succeeded, response)
|
|
197
197
|
if succeeded
|
|
198
|
-
|
|
198
|
+
'Succeeded'
|
|
199
199
|
else
|
|
200
|
-
response[
|
|
200
|
+
response['message'] || 'Unable to read error message'
|
|
201
201
|
end
|
|
202
202
|
end
|
|
203
203
|
|
|
@@ -89,10 +89,10 @@ module ActiveMerchant
|
|
|
89
89
|
2 => /\A;(?<pan>[\d]{1,19}+)=(?<expiration>[\d]{0,4}|=)(?<service_code>[\d]{0,3}|=)(?<discretionary_data>.*)\?\Z/
|
|
90
90
|
}.freeze
|
|
91
91
|
|
|
92
|
-
APPLE_PAY_DATA_DESCRIPTOR =
|
|
92
|
+
APPLE_PAY_DATA_DESCRIPTOR = 'COMMON.APPLE.INAPP.PAYMENT'
|
|
93
93
|
|
|
94
|
-
PAYMENT_METHOD_NOT_SUPPORTED_ERROR =
|
|
95
|
-
INELIGIBLE_FOR_ISSUING_CREDIT_ERROR =
|
|
94
|
+
PAYMENT_METHOD_NOT_SUPPORTED_ERROR = '155'
|
|
95
|
+
INELIGIBLE_FOR_ISSUING_CREDIT_ERROR = '54'
|
|
96
96
|
|
|
97
97
|
def initialize(options={})
|
|
98
98
|
requires!(options, :login, :password)
|
|
@@ -102,11 +102,11 @@ module ActiveMerchant
|
|
|
102
102
|
def purchase(amount, payment, options = {})
|
|
103
103
|
if payment.is_a?(String)
|
|
104
104
|
commit(:cim_purchase) do |xml|
|
|
105
|
-
add_cim_auth_purchase(xml,
|
|
105
|
+
add_cim_auth_purchase(xml, 'profileTransAuthCapture', amount, payment, options)
|
|
106
106
|
end
|
|
107
107
|
else
|
|
108
108
|
commit(:purchase) do |xml|
|
|
109
|
-
add_auth_purchase(xml,
|
|
109
|
+
add_auth_purchase(xml, 'authCaptureTransaction', amount, payment, options)
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
end
|
|
@@ -114,11 +114,11 @@ module ActiveMerchant
|
|
|
114
114
|
def authorize(amount, payment, options={})
|
|
115
115
|
if payment.is_a?(String)
|
|
116
116
|
commit(:cim_authorize) do |xml|
|
|
117
|
-
add_cim_auth_purchase(xml,
|
|
117
|
+
add_cim_auth_purchase(xml, 'profileTransAuthOnly', amount, payment, options)
|
|
118
118
|
end
|
|
119
119
|
else
|
|
120
120
|
commit(:authorize) do |xml|
|
|
121
|
-
add_auth_purchase(xml,
|
|
121
|
+
add_auth_purchase(xml, 'authOnlyTransaction', amount, payment, options)
|
|
122
122
|
end
|
|
123
123
|
end
|
|
124
124
|
end
|
|
@@ -141,7 +141,7 @@ module ActiveMerchant
|
|
|
141
141
|
return response if response.success?
|
|
142
142
|
return response unless options[:force_full_refund_if_unsettled]
|
|
143
143
|
|
|
144
|
-
if response.params[
|
|
144
|
+
if response.params['response_reason_code'] == INELIGIBLE_FOR_ISSUING_CREDIT_ERROR
|
|
145
145
|
void(authorization, options)
|
|
146
146
|
else
|
|
147
147
|
response
|
|
@@ -158,7 +158,7 @@ module ActiveMerchant
|
|
|
158
158
|
|
|
159
159
|
def credit(amount, payment, options={})
|
|
160
160
|
if payment.is_a?(String)
|
|
161
|
-
raise ArgumentError,
|
|
161
|
+
raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card or use the #refund method.'
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
commit(:credit) do |xml|
|
|
@@ -222,7 +222,7 @@ module ActiveMerchant
|
|
|
222
222
|
|
|
223
223
|
def supports_network_tokenization?
|
|
224
224
|
card = Billing::NetworkTokenizationCreditCard.new({
|
|
225
|
-
:number =>
|
|
225
|
+
:number => '4111111111111111',
|
|
226
226
|
:month => 12,
|
|
227
227
|
:year => 20,
|
|
228
228
|
:first_name => 'John',
|
|
@@ -232,7 +232,7 @@ module ActiveMerchant
|
|
|
232
232
|
})
|
|
233
233
|
|
|
234
234
|
request = post_data(:authorize) do |xml|
|
|
235
|
-
add_auth_purchase(xml,
|
|
235
|
+
add_auth_purchase(xml, 'authOnlyTransaction', 1, card, {})
|
|
236
236
|
end
|
|
237
237
|
raw_response = ssl_post(url, request, headers)
|
|
238
238
|
response = parse(:authorize, raw_response)
|
|
@@ -302,7 +302,7 @@ module ActiveMerchant
|
|
|
302
302
|
add_tax_exempt_status(xml, options)
|
|
303
303
|
add_po_number(xml, options)
|
|
304
304
|
xml.refTransId(transaction_id_from(authorization))
|
|
305
|
-
add_invoice(xml,
|
|
305
|
+
add_invoice(xml, 'capture', options)
|
|
306
306
|
add_user_fields(xml, amount, options)
|
|
307
307
|
end
|
|
308
308
|
end
|
|
@@ -320,7 +320,7 @@ module ActiveMerchant
|
|
|
320
320
|
add_shipping_fields(xml, options)
|
|
321
321
|
add_duty_fields(xml, options)
|
|
322
322
|
xml.creditCardNumberMasked(card_number)
|
|
323
|
-
add_invoice(xml,
|
|
323
|
+
add_invoice(xml, 'profileTransRefund', options)
|
|
324
324
|
xml.transId(transaction_id)
|
|
325
325
|
end
|
|
326
326
|
end
|
|
@@ -396,38 +396,38 @@ module ActiveMerchant
|
|
|
396
396
|
xml.transactionSettings do
|
|
397
397
|
if options[:recurring]
|
|
398
398
|
xml.setting do
|
|
399
|
-
xml.settingName(
|
|
400
|
-
xml.settingValue(
|
|
399
|
+
xml.settingName('recurringBilling')
|
|
400
|
+
xml.settingValue('true')
|
|
401
401
|
end
|
|
402
402
|
end
|
|
403
403
|
if options[:disable_partial_auth]
|
|
404
404
|
xml.setting do
|
|
405
|
-
xml.settingName(
|
|
406
|
-
xml.settingValue(
|
|
405
|
+
xml.settingName('allowPartialAuth')
|
|
406
|
+
xml.settingValue('false')
|
|
407
407
|
end
|
|
408
408
|
end
|
|
409
409
|
if options[:duplicate_window]
|
|
410
410
|
set_duplicate_window(xml, options[:duplicate_window])
|
|
411
411
|
elsif self.class.duplicate_window
|
|
412
|
-
ActiveMerchant.deprecated
|
|
412
|
+
ActiveMerchant.deprecated 'Using the duplicate_window class_attribute is deprecated. Use the transaction options hash instead.'
|
|
413
413
|
set_duplicate_window(xml, self.class.duplicate_window)
|
|
414
414
|
end
|
|
415
415
|
if options.key?(:email_customer)
|
|
416
416
|
xml.setting do
|
|
417
|
-
xml.settingName(
|
|
418
|
-
xml.settingValue(options[:email_customer] ?
|
|
417
|
+
xml.settingName('emailCustomer')
|
|
418
|
+
xml.settingValue(options[:email_customer] ? 'true' : 'false')
|
|
419
419
|
end
|
|
420
420
|
end
|
|
421
421
|
if options[:header_email_receipt]
|
|
422
422
|
xml.setting do
|
|
423
|
-
xml.settingName(
|
|
423
|
+
xml.settingName('headerEmailReceipt')
|
|
424
424
|
xml.settingValue(options[:header_email_receipt])
|
|
425
425
|
end
|
|
426
426
|
end
|
|
427
427
|
if options[:test_request]
|
|
428
428
|
xml.setting do
|
|
429
|
-
xml.settingName(
|
|
430
|
-
xml.settingValue(
|
|
429
|
+
xml.settingName('testRequest')
|
|
430
|
+
xml.settingValue('1')
|
|
431
431
|
end
|
|
432
432
|
end
|
|
433
433
|
end
|
|
@@ -435,7 +435,7 @@ module ActiveMerchant
|
|
|
435
435
|
|
|
436
436
|
def set_duplicate_window(xml, value)
|
|
437
437
|
xml.setting do
|
|
438
|
-
xml.settingName(
|
|
438
|
+
xml.settingName('duplicateWindow')
|
|
439
439
|
xml.settingValue(value)
|
|
440
440
|
end
|
|
441
441
|
end
|
|
@@ -444,13 +444,13 @@ module ActiveMerchant
|
|
|
444
444
|
xml.userFields do
|
|
445
445
|
if currency = (options[:currency] || currency(amount))
|
|
446
446
|
xml.userField do
|
|
447
|
-
xml.name(
|
|
447
|
+
xml.name('x_currency_code')
|
|
448
448
|
xml.value(currency)
|
|
449
449
|
end
|
|
450
450
|
end
|
|
451
451
|
if application_id.present?
|
|
452
452
|
xml.userField do
|
|
453
|
-
xml.name(
|
|
453
|
+
xml.name('x_solution_id')
|
|
454
454
|
xml.value(application_id)
|
|
455
455
|
end
|
|
456
456
|
end
|
|
@@ -583,7 +583,7 @@ module ActiveMerchant
|
|
|
583
583
|
end
|
|
584
584
|
end
|
|
585
585
|
|
|
586
|
-
def add_shipping_address(xml, options, root_node=
|
|
586
|
+
def add_shipping_address(xml, options, root_node='shipTo')
|
|
587
587
|
address = options[:shipping_address] || options[:address]
|
|
588
588
|
return unless address
|
|
589
589
|
|
|
@@ -615,7 +615,7 @@ module ActiveMerchant
|
|
|
615
615
|
xml.order do
|
|
616
616
|
xml.invoiceNumber(truncate(options[:order_id], 20))
|
|
617
617
|
xml.description(truncate(options[:description], 255))
|
|
618
|
-
xml.purchaseOrderNumber(options[:po_number]) if options[:po_number] && transaction_type.start_with?(
|
|
618
|
+
xml.purchaseOrderNumber(options[:po_number]) if options[:po_number] && transaction_type.start_with?('profileTrans')
|
|
619
619
|
end
|
|
620
620
|
|
|
621
621
|
# Authorize.net API requires lineItems to be placed directly after order tag
|
|
@@ -697,9 +697,9 @@ module ActiveMerchant
|
|
|
697
697
|
xml.email(options[:email]) unless empty?(options[:email])
|
|
698
698
|
|
|
699
699
|
xml.paymentProfiles do
|
|
700
|
-
xml.customerType(
|
|
700
|
+
xml.customerType('individual')
|
|
701
701
|
add_billing_address(xml, credit_card, options)
|
|
702
|
-
add_shipping_address(xml, options,
|
|
702
|
+
add_shipping_address(xml, options, 'shipToList')
|
|
703
703
|
xml.payment do
|
|
704
704
|
xml.creditCard do
|
|
705
705
|
xml.cardNumber(truncate(credit_card.number, 16))
|
|
@@ -728,7 +728,7 @@ module ActiveMerchant
|
|
|
728
728
|
end
|
|
729
729
|
|
|
730
730
|
def state_from(address, options)
|
|
731
|
-
if [
|
|
731
|
+
if ['US', 'CA'].include?(address[:country])
|
|
732
732
|
address[:state] || 'NC'
|
|
733
733
|
else
|
|
734
734
|
address[:state] || 'n/a'
|
|
@@ -759,7 +759,7 @@ module ActiveMerchant
|
|
|
759
759
|
avs_result = AVSResult.new(code: STANDARD_AVS_CODE_MAPPING[avs_result_code])
|
|
760
760
|
cvv_result = CVVResult.new(response[:card_code])
|
|
761
761
|
if using_live_gateway_in_test_mode?(response)
|
|
762
|
-
Response.new(false,
|
|
762
|
+
Response.new(false, 'Using a live Authorize.net account in Test Mode is not permitted.')
|
|
763
763
|
else
|
|
764
764
|
Response.new(
|
|
765
765
|
success_from(action, response),
|
|
@@ -776,7 +776,7 @@ module ActiveMerchant
|
|
|
776
776
|
end
|
|
777
777
|
|
|
778
778
|
def is_cim_action?(action)
|
|
779
|
-
action.to_s.start_with?(
|
|
779
|
+
action.to_s.start_with?('cim')
|
|
780
780
|
end
|
|
781
781
|
|
|
782
782
|
def post_data(action)
|
|
@@ -790,17 +790,17 @@ module ActiveMerchant
|
|
|
790
790
|
|
|
791
791
|
def root_for(action)
|
|
792
792
|
if action == :cim_store
|
|
793
|
-
|
|
793
|
+
'createCustomerProfileRequest'
|
|
794
794
|
elsif action == :cim_store_update
|
|
795
|
-
|
|
795
|
+
'createCustomerPaymentProfileRequest'
|
|
796
796
|
elsif action == :cim_store_delete_customer
|
|
797
|
-
|
|
797
|
+
'deleteCustomerProfileRequest'
|
|
798
798
|
elsif action == :verify_credentials
|
|
799
|
-
|
|
799
|
+
'authenticateTestRequest'
|
|
800
800
|
elsif is_cim_action?(action)
|
|
801
|
-
|
|
801
|
+
'createCustomerProfileTransactionRequest'
|
|
802
802
|
else
|
|
803
|
-
|
|
803
|
+
'createTransactionRequest'
|
|
804
804
|
end
|
|
805
805
|
end
|
|
806
806
|
|
|
@@ -817,49 +817,49 @@ module ActiveMerchant
|
|
|
817
817
|
|
|
818
818
|
response = {action: action}
|
|
819
819
|
|
|
820
|
-
response[:response_code] = if(element = doc.at_xpath(
|
|
820
|
+
response[:response_code] = if(element = doc.at_xpath('//transactionResponse/responseCode'))
|
|
821
821
|
(empty?(element.content) ? nil : element.content.to_i)
|
|
822
822
|
end
|
|
823
823
|
|
|
824
|
-
if(element = doc.at_xpath(
|
|
825
|
-
response[:response_reason_code] = element.at_xpath(
|
|
826
|
-
response[:response_reason_text] = element.at_xpath(
|
|
827
|
-
elsif(element = doc.at_xpath(
|
|
828
|
-
response[:response_reason_code] = element.at_xpath(
|
|
829
|
-
response[:response_reason_text] = element.at_xpath(
|
|
830
|
-
elsif(element = doc.at_xpath(
|
|
831
|
-
response[:response_reason_code] = element.at_xpath(
|
|
832
|
-
response[:response_reason_text] = element.at_xpath(
|
|
824
|
+
if(element = doc.at_xpath('//errors/error'))
|
|
825
|
+
response[:response_reason_code] = element.at_xpath('errorCode').content[/0*(\d+)$/, 1]
|
|
826
|
+
response[:response_reason_text] = element.at_xpath('errorText').content.chomp('.')
|
|
827
|
+
elsif(element = doc.at_xpath('//transactionResponse/messages/message'))
|
|
828
|
+
response[:response_reason_code] = element.at_xpath('code').content[/0*(\d+)$/, 1]
|
|
829
|
+
response[:response_reason_text] = element.at_xpath('description').content.chomp('.')
|
|
830
|
+
elsif(element = doc.at_xpath('//messages/message'))
|
|
831
|
+
response[:response_reason_code] = element.at_xpath('code').content[/0*(\d+)$/, 1]
|
|
832
|
+
response[:response_reason_text] = element.at_xpath('text').content.chomp('.')
|
|
833
833
|
else
|
|
834
834
|
response[:response_reason_code] = nil
|
|
835
|
-
response[:response_reason_text] =
|
|
835
|
+
response[:response_reason_text] = ''
|
|
836
836
|
end
|
|
837
837
|
|
|
838
|
-
response[:avs_result_code] = if(element = doc.at_xpath(
|
|
838
|
+
response[:avs_result_code] = if(element = doc.at_xpath('//avsResultCode'))
|
|
839
839
|
(empty?(element.content) ? nil : element.content)
|
|
840
840
|
end
|
|
841
841
|
|
|
842
|
-
response[:transaction_id] = if(element = doc.at_xpath(
|
|
842
|
+
response[:transaction_id] = if(element = doc.at_xpath('//transId'))
|
|
843
843
|
(empty?(element.content) ? nil : element.content)
|
|
844
844
|
end
|
|
845
845
|
|
|
846
|
-
response[:card_code] = if(element = doc.at_xpath(
|
|
846
|
+
response[:card_code] = if(element = doc.at_xpath('//cvvResultCode'))
|
|
847
847
|
(empty?(element.content) ? nil : element.content)
|
|
848
848
|
end
|
|
849
849
|
|
|
850
|
-
response[:authorization_code] = if(element = doc.at_xpath(
|
|
850
|
+
response[:authorization_code] = if(element = doc.at_xpath('//authCode'))
|
|
851
851
|
(empty?(element.content) ? nil : element.content)
|
|
852
852
|
end
|
|
853
853
|
|
|
854
|
-
response[:cardholder_authentication_code] = if(element = doc.at_xpath(
|
|
854
|
+
response[:cardholder_authentication_code] = if(element = doc.at_xpath('//cavvResultCode'))
|
|
855
855
|
(empty?(element.content) ? nil : element.content)
|
|
856
856
|
end
|
|
857
857
|
|
|
858
|
-
response[:account_number] = if(element = doc.at_xpath(
|
|
858
|
+
response[:account_number] = if(element = doc.at_xpath('//accountNumber'))
|
|
859
859
|
(empty?(element.content) ? nil : element.content[-4..-1])
|
|
860
860
|
end
|
|
861
861
|
|
|
862
|
-
response[:test_request] = if(element = doc.at_xpath(
|
|
862
|
+
response[:test_request] = if(element = doc.at_xpath('//testRequest'))
|
|
863
863
|
(empty?(element.content) ? nil : element.content)
|
|
864
864
|
end
|
|
865
865
|
|
|
@@ -871,33 +871,33 @@ module ActiveMerchant
|
|
|
871
871
|
|
|
872
872
|
doc = Nokogiri::XML(body).remove_namespaces!
|
|
873
873
|
|
|
874
|
-
if (element = doc.at_xpath(
|
|
875
|
-
response[:message_code] = element.at_xpath(
|
|
876
|
-
response[:message_text] = element.at_xpath(
|
|
874
|
+
if (element = doc.at_xpath('//messages/message'))
|
|
875
|
+
response[:message_code] = element.at_xpath('code').content[/0*(\d+)$/, 1]
|
|
876
|
+
response[:message_text] = element.at_xpath('text').content.chomp('.')
|
|
877
877
|
end
|
|
878
878
|
|
|
879
|
-
response[:result_code] = if(element = doc.at_xpath(
|
|
879
|
+
response[:result_code] = if(element = doc.at_xpath('//messages/resultCode'))
|
|
880
880
|
(empty?(element.content) ? nil : element.content)
|
|
881
881
|
end
|
|
882
882
|
|
|
883
|
-
response[:test_request] = if(element = doc.at_xpath(
|
|
883
|
+
response[:test_request] = if(element = doc.at_xpath('//testRequest'))
|
|
884
884
|
(empty?(element.content) ? nil : element.content)
|
|
885
885
|
end
|
|
886
886
|
|
|
887
|
-
response[:customer_profile_id] = if(element = doc.at_xpath(
|
|
887
|
+
response[:customer_profile_id] = if(element = doc.at_xpath('//customerProfileId'))
|
|
888
888
|
(empty?(element.content) ? nil : element.content)
|
|
889
889
|
end
|
|
890
890
|
|
|
891
|
-
response[:customer_payment_profile_id] = if(element = doc.at_xpath(
|
|
891
|
+
response[:customer_payment_profile_id] = if(element = doc.at_xpath('//customerPaymentProfileIdList/numericString'))
|
|
892
892
|
(empty?(element.content) ? nil : element.content)
|
|
893
893
|
end
|
|
894
894
|
|
|
895
|
-
response[:customer_payment_profile_id] = if(element = doc.at_xpath(
|
|
896
|
-
doc.at_xpath(
|
|
895
|
+
response[:customer_payment_profile_id] = if(element = doc.at_xpath('//customerPaymentProfileIdList/numericString') ||
|
|
896
|
+
doc.at_xpath('//customerPaymentProfileId'))
|
|
897
897
|
(empty?(element.content) ? nil : element.content)
|
|
898
898
|
end
|
|
899
899
|
|
|
900
|
-
response[:direct_response] = if(element = doc.at_xpath(
|
|
900
|
+
response[:direct_response] = if(element = doc.at_xpath('//directResponse'))
|
|
901
901
|
(empty?(element.content) ? nil : element.content)
|
|
902
902
|
end
|
|
903
903
|
|
|
@@ -908,7 +908,7 @@ module ActiveMerchant
|
|
|
908
908
|
|
|
909
909
|
def success_from(action, response)
|
|
910
910
|
if cim?(action) || (action == :verify_credentials)
|
|
911
|
-
response[:result_code] ==
|
|
911
|
+
response[:result_code] == 'Ok'
|
|
912
912
|
else
|
|
913
913
|
[APPROVED, FRAUD_REVIEW].include?(response[:response_code]) && TRANSACTION_ALREADY_ACTIONED.exclude?(response[:response_reason_code])
|
|
914
914
|
end
|
|
@@ -928,14 +928,14 @@ module ActiveMerchant
|
|
|
928
928
|
|
|
929
929
|
def authorization_from(action, response)
|
|
930
930
|
if cim?(action)
|
|
931
|
-
[response[:customer_profile_id], response[:customer_payment_profile_id], action].join(
|
|
931
|
+
[response[:customer_profile_id], response[:customer_payment_profile_id], action].join('#')
|
|
932
932
|
else
|
|
933
|
-
[response[:transaction_id], response[:account_number], action].join(
|
|
933
|
+
[response[:transaction_id], response[:account_number], action].join('#')
|
|
934
934
|
end
|
|
935
935
|
end
|
|
936
936
|
|
|
937
937
|
def split_authorization(authorization)
|
|
938
|
-
authorization.split(
|
|
938
|
+
authorization.split('#')
|
|
939
939
|
end
|
|
940
940
|
|
|
941
941
|
def cim?(action)
|
|
@@ -952,7 +952,7 @@ module ActiveMerchant
|
|
|
952
952
|
end
|
|
953
953
|
|
|
954
954
|
def using_live_gateway_in_test_mode?(response)
|
|
955
|
-
!test? && response[:test_request] ==
|
|
955
|
+
!test? && response[:test_request] == '1'
|
|
956
956
|
end
|
|
957
957
|
|
|
958
958
|
def map_error_code(response_code, response_reason_code)
|