activemerchant 1.101.0 → 1.102.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 +15 -0
- data/README.md +1 -1
- data/lib/active_merchant/billing/credit_card.rb +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +7 -6
- data/lib/active_merchant/billing/gateways/adyen.rb +2 -2
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +1 -1
- data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -56
- data/lib/active_merchant/billing/gateways/balanced.rb +14 -12
- data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +19 -19
- data/lib/active_merchant/billing/gateways/blue_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/card_stream.rb +1 -1
- data/lib/active_merchant/billing/gateways/cardknox.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +5 -5
- data/lib/active_merchant/billing/gateways/cc5.rb +1 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +27 -26
- data/lib/active_merchant/billing/gateways/checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +3 -1
- data/lib/active_merchant/billing/gateways/clearhaus.rb +9 -8
- data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
- data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/culqi.rb +11 -10
- data/lib/active_merchant/billing/gateways/cyber_source.rb +8 -8
- data/lib/active_merchant/billing/gateways/efsnet.rb +9 -9
- data/lib/active_merchant/billing/gateways/eway.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +9 -8
- data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
- data/lib/active_merchant/billing/gateways/finansbank.rb +1 -1
- data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +9 -8
- data/lib/active_merchant/billing/gateways/garanti.rb +1 -1
- data/lib/active_merchant/billing/gateways/global_collect.rb +1 -1
- data/lib/active_merchant/billing/gateways/inspire.rb +10 -10
- data/lib/active_merchant/billing/gateways/iridium.rb +1 -1
- data/lib/active_merchant/billing/gateways/iveri.rb +1 -1
- data/lib/active_merchant/billing/gateways/ixopay.rb +287 -0
- data/lib/active_merchant/billing/gateways/linkpoint.rb +6 -6
- data/lib/active_merchant/billing/gateways/litle.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +4 -4
- data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
- data/lib/active_merchant/billing/gateways/metrics_global.rb +2 -2
- data/lib/active_merchant/billing/gateways/micropayment.rb +1 -1
- data/lib/active_merchant/billing/gateways/migs.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
- data/lib/active_merchant/billing/gateways/moneris.rb +2 -2
- data/lib/active_merchant/billing/gateways/moneris_us.rb +4 -4
- data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
- data/lib/active_merchant/billing/gateways/nmi.rb +3 -3
- data/lib/active_merchant/billing/gateways/ogone.rb +12 -11
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +19 -18
- data/lib/active_merchant/billing/gateways/orbital.rb +13 -11
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +8 -7
- data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +5 -5
- data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
- data/lib/active_merchant/billing/gateways/pay_junction.rb +11 -10
- data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +2 -2
- data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_in.rb +15 -14
- data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -2
- data/lib/active_merchant/billing/gateways/pro_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/psl_card.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickbooks.rb +19 -12
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +12 -12
- data/lib/active_merchant/billing/gateways/s5.rb +1 -1
- data/lib/active_merchant/billing/gateways/safe_charge.rb +3 -3
- data/lib/active_merchant/billing/gateways/sage.rb +4 -4
- data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -6
- data/lib/active_merchant/billing/gateways/secure_net.rb +2 -2
- data/lib/active_merchant/billing/gateways/secure_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -1
- data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -5
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +15 -14
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +10 -9
- data/lib/active_merchant/billing/gateways/wepay.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
- data/lib/active_merchant/billing/response.rb +2 -2
- data/lib/active_merchant/connection.rb +26 -25
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 676020bb24cc6d3a8b17a3d2ed035398803a436371c3c6a368ab3b49104d618e
|
|
4
|
+
data.tar.gz: 5a46ff06616a3b914c599d7da7455f0a4dc1b7579907a03a2c51463d6c81a8ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b06c1bd98e25faed372c68877041f127a64b21021f88ec102dd0910d976eeaba2f19a4414a5b9d122fb5a92f64489d34e961652ad1a7aac6f85e802ada89d1cf
|
|
7
|
+
data.tar.gz: 7cb0c86d44cbc7d23ea441aba7dc90ec58d7d5be2d972dd63c0b3545c4372c752d7fc068a173f0d26532f4cede6a97dcecae8fd86c40f17551c6017a9c07db1c
|
data/CHANGELOG
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
|
2
2
|
|
|
3
3
|
== HEAD
|
|
4
|
+
|
|
5
|
+
== Version 1.102.0 (Nov 14, 2019)
|
|
6
|
+
* Quickbooks: Make token refresh optional with allow_refresh flag [britth] #3419
|
|
7
|
+
* Paymentez: Update supported countries [curiousepic] #3425
|
|
8
|
+
* Ixopay: Add new gateway [jasonxp] #3426
|
|
9
|
+
* Ixopay: Add support for currency option to refund method #3433
|
|
10
|
+
* Ixopay: Remove default callback URL #3436
|
|
11
|
+
* Ixopay: Refactor capture #3431
|
|
12
|
+
* Update supported countries list. Add currencies without fractions / with 3 decimal places #3424
|
|
13
|
+
* RuboCop: Fix Layout/EndAlignment [leila-alderman] #3427
|
|
14
|
+
* RuboCop: Fix Layout/ExtraSpacing [leila-alderman] #3429
|
|
15
|
+
* RuboCop: Fix Layout/MultilineOperationIndentation [leila-alderman] #3439
|
|
16
|
+
* Worldpay: Update logic to set cardholderName for 3DS transactions [britth] #3444
|
|
17
|
+
* Adopt new enrolled key for 3DS1 transactions. enrolled contains the 3… #3442
|
|
18
|
+
|
|
4
19
|
== Version 1.101.0 (Nov 4, 2019)
|
|
5
20
|
* Add UYI to list of currencies without fractions [curiousepic] #3416
|
|
6
21
|
* Quickbooks: Add OAuth 2.0 support and void action [britth] #3397
|
data/README.md
CHANGED
|
@@ -112,7 +112,7 @@ The [ActiveMerchant Wiki](https://github.com/activemerchant/active_merchant/wiki
|
|
|
112
112
|
* [Cecabank](http://www.ceca.es/es/) - ES
|
|
113
113
|
* [Cenpos](https://www.cenpos.com/) - AD, AI, AG, AR, AU, AT, BS, BB, BE, BZ, BM, BR, BN, BG, CA, HR, CY, CZ, DK, DM, EE, FI, FR, DE, GR, GD, GY, HK, HU, IS, IN, IL, IT, JP, LV, LI, LT, LU, MY, MT, MX, MC, MS, NL, PA, PL, PT, KN, LC, MF, VC, SM, SG, SK, SI, ZA, ES, SR, SE, CH, TR, GB, US, UY
|
|
114
114
|
* [CAMS: Central Account Management System](https://www.centralams.com/) - US
|
|
115
|
-
* [Checkout.com](https://www.checkout.com/) - AT, BE, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GR, HR, HU, IE, IS, IT, LI, LT, LU, LV, MT,
|
|
115
|
+
* [Checkout.com](https://www.checkout.com/) - AD, AE, AR, AT, AU, BE, BG, BH, BR, CH, CL, CN, CO, CY, CZ, DE, DK, EE, EG, ES, FI, FR, GB, GR, HK, HR, HU, IE, IS, IT, JO, JP, KW, LI, LT, LU, LV, MC, MT, MX, MY, NL, NO, NZ, OM, PE, PL, PT, QA, RO, SA, SE, SG, SI, SK, SM, TR, US
|
|
116
116
|
* [Clearhaus](https://www.clearhaus.com) - AD, AT, BE, BG, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GL, GR, HR, HU, IE, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK
|
|
117
117
|
* [Commercegate](http://www.commercegate.com/) - AD, AT, AX, BE, BG, CH, CY, CZ, DE, DK, ES, FI, FR, GB, GG, GI, GR, HR, HU, IE, IM, IS, IT, JE, LI, LT, LU, LV, MC, MT, NL, NO, PL, PT, RO, SE, SI, SK, VA
|
|
118
118
|
* [Conekta](https://conekta.io) - MX
|
|
@@ -336,7 +336,7 @@ module ActiveMerchant #:nodoc:
|
|
|
336
336
|
if expired?
|
|
337
337
|
errors << [:year, 'expired']
|
|
338
338
|
else
|
|
339
|
-
errors << [:year, 'is not a valid year']
|
|
339
|
+
errors << [:year, 'is not a valid year'] if !valid_expiry_year?(year)
|
|
340
340
|
end
|
|
341
341
|
end
|
|
342
342
|
|
|
@@ -347,7 +347,7 @@ module ActiveMerchant #:nodoc:
|
|
|
347
347
|
errors = []
|
|
348
348
|
|
|
349
349
|
if !empty?(brand)
|
|
350
|
-
errors << [:brand, 'is invalid']
|
|
350
|
+
errors << [:brand, 'is invalid'] if !CreditCard.card_companies.include?(brand)
|
|
351
351
|
end
|
|
352
352
|
|
|
353
353
|
if empty?(number)
|
|
@@ -197,8 +197,8 @@ module ActiveMerchant #:nodoc:
|
|
|
197
197
|
def valid_number?(number)
|
|
198
198
|
valid_test_mode_card_number?(number) ||
|
|
199
199
|
valid_card_number_length?(number) &&
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
valid_card_number_characters?(number) &&
|
|
201
|
+
valid_by_algorithm?(brand?(number), number)
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
def card_companies
|
|
@@ -249,12 +249,13 @@ module ActiveMerchant #:nodoc:
|
|
|
249
249
|
|
|
250
250
|
def amount(money)
|
|
251
251
|
return nil if money.nil?
|
|
252
|
-
cents =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
cents =
|
|
253
|
+
if money.respond_to?(:cents)
|
|
254
|
+
ActiveMerchant.deprecated 'Support for Money objects is deprecated and will be removed from a future release of ActiveMerchant. Please use an Integer value in cents'
|
|
255
|
+
money.cents
|
|
256
|
+
else
|
|
257
|
+
money
|
|
258
|
+
end
|
|
258
259
|
|
|
259
260
|
raise ArgumentError, 'money amount must be a positive Integer in cents.' if money.is_a?(String)
|
|
260
261
|
|
|
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
|
|
|
10
10
|
self.supported_countries = ['AT', 'AU', 'BE', 'BG', 'BR', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GI', 'GR', 'HK', 'HU', 'IE', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SG', 'SK', 'SI', 'US']
|
|
11
11
|
self.default_currency = 'USD'
|
|
12
12
|
self.currencies_without_fractions = %w(CVE DJF GNF IDR JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
|
|
13
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb, :dankort, :maestro,
|
|
13
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb, :dankort, :maestro, :discover, :elo, :naranja, :cabal]
|
|
14
14
|
|
|
15
15
|
self.money_format = :cents
|
|
16
16
|
|
|
@@ -371,7 +371,7 @@ module ActiveMerchant #:nodoc:
|
|
|
371
371
|
cavvAlgorithm: three_d_secure_options[:cavv_algorithm],
|
|
372
372
|
eci: three_d_secure_options[:eci],
|
|
373
373
|
xid: three_d_secure_options[:xid],
|
|
374
|
-
directoryResponse: three_d_secure_options[:
|
|
374
|
+
directoryResponse: three_d_secure_options[:enrolled],
|
|
375
375
|
authenticationResponse: three_d_secure_options[:authentication_response_status]
|
|
376
376
|
}
|
|
377
377
|
end
|
|
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
|
|
|
113
113
|
post[:city] = billing_address[:city]
|
|
114
114
|
post[:state] = billing_address[:state]
|
|
115
115
|
post[:countryId] = billing_address[:country]
|
|
116
|
-
post[:postalCode]
|
|
116
|
+
post[:postalCode] = billing_address[:zip]
|
|
117
117
|
post[:phone] = billing_address[:phone]
|
|
118
118
|
end
|
|
119
119
|
end
|
|
@@ -132,11 +132,12 @@ module ActiveMerchant
|
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def refund(amount, authorization, options={})
|
|
135
|
-
response =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
response =
|
|
136
|
+
if auth_was_for_cim?(authorization)
|
|
137
|
+
cim_refund(amount, authorization, options)
|
|
138
|
+
else
|
|
139
|
+
normal_refund(amount, authorization, options)
|
|
140
|
+
end
|
|
140
141
|
|
|
141
142
|
return response if response.success?
|
|
142
143
|
return response unless options[:force_full_refund_if_unsettled]
|
|
@@ -596,11 +597,12 @@ module ActiveMerchant
|
|
|
596
597
|
return unless address
|
|
597
598
|
|
|
598
599
|
xml.send(root_node) do
|
|
599
|
-
first_name, last_name =
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
600
|
+
first_name, last_name =
|
|
601
|
+
if address[:name]
|
|
602
|
+
split_names(address[:name])
|
|
603
|
+
else
|
|
604
|
+
[address[:first_name], address[:last_name]]
|
|
605
|
+
end
|
|
604
606
|
full_address = "#{address[:address1]} #{address[:address2]}".strip
|
|
605
607
|
|
|
606
608
|
xml.firstName(truncate(first_name, 50)) unless empty?(first_name)
|
|
@@ -840,8 +842,8 @@ module ActiveMerchant
|
|
|
840
842
|
response = {action: action}
|
|
841
843
|
|
|
842
844
|
response[:response_code] = if(element = doc.at_xpath('//transactionResponse/responseCode'))
|
|
843
|
-
|
|
844
|
-
|
|
845
|
+
empty?(element.content) ? nil : element.content.to_i
|
|
846
|
+
end
|
|
845
847
|
|
|
846
848
|
if(element = doc.at_xpath('//errors/error'))
|
|
847
849
|
response[:response_reason_code] = element.at_xpath('errorCode').content[/0*(\d+)$/, 1]
|
|
@@ -857,37 +859,45 @@ module ActiveMerchant
|
|
|
857
859
|
response[:response_reason_text] = ''
|
|
858
860
|
end
|
|
859
861
|
|
|
860
|
-
response[:avs_result_code] =
|
|
861
|
-
|
|
862
|
-
|
|
862
|
+
response[:avs_result_code] =
|
|
863
|
+
if(element = doc.at_xpath('//avsResultCode'))
|
|
864
|
+
empty?(element.content) ? nil : element.content
|
|
865
|
+
end
|
|
863
866
|
|
|
864
|
-
response[:transaction_id] =
|
|
865
|
-
|
|
866
|
-
|
|
867
|
+
response[:transaction_id] =
|
|
868
|
+
if element = doc.at_xpath('//transId')
|
|
869
|
+
empty?(element.content) ? nil : element.content
|
|
870
|
+
end
|
|
867
871
|
|
|
868
|
-
response[:card_code] =
|
|
869
|
-
|
|
870
|
-
|
|
872
|
+
response[:card_code] =
|
|
873
|
+
if element = doc.at_xpath('//cvvResultCode')
|
|
874
|
+
empty?(element.content) ? nil : element.content
|
|
875
|
+
end
|
|
871
876
|
|
|
872
|
-
response[:authorization_code] =
|
|
873
|
-
|
|
874
|
-
|
|
877
|
+
response[:authorization_code] =
|
|
878
|
+
if element = doc.at_xpath('//authCode')
|
|
879
|
+
empty?(element.content) ? nil : element.content
|
|
880
|
+
end
|
|
875
881
|
|
|
876
|
-
response[:cardholder_authentication_code] =
|
|
877
|
-
|
|
878
|
-
|
|
882
|
+
response[:cardholder_authentication_code] =
|
|
883
|
+
if element = doc.at_xpath('//cavvResultCode')
|
|
884
|
+
empty?(element.content) ? nil : element.content
|
|
885
|
+
end
|
|
879
886
|
|
|
880
|
-
response[:account_number] =
|
|
881
|
-
|
|
882
|
-
|
|
887
|
+
response[:account_number] =
|
|
888
|
+
if element = doc.at_xpath('//accountNumber')
|
|
889
|
+
empty?(element.content) ? nil : element.content[-4..-1]
|
|
890
|
+
end
|
|
883
891
|
|
|
884
|
-
response[:test_request] =
|
|
885
|
-
|
|
886
|
-
|
|
892
|
+
response[:test_request] =
|
|
893
|
+
if element = doc.at_xpath('//testRequest')
|
|
894
|
+
empty?(element.content) ? nil : element.content
|
|
895
|
+
end
|
|
887
896
|
|
|
888
|
-
response[:full_response_code] =
|
|
889
|
-
|
|
890
|
-
|
|
897
|
+
response[:full_response_code] =
|
|
898
|
+
if element = doc.at_xpath('//messages/message/code')
|
|
899
|
+
empty?(element.content) ? nil : element.content
|
|
900
|
+
end
|
|
891
901
|
|
|
892
902
|
response
|
|
893
903
|
end
|
|
@@ -897,35 +907,41 @@ module ActiveMerchant
|
|
|
897
907
|
|
|
898
908
|
doc = Nokogiri::XML(body).remove_namespaces!
|
|
899
909
|
|
|
900
|
-
if
|
|
910
|
+
if element = doc.at_xpath('//messages/message')
|
|
901
911
|
response[:message_code] = element.at_xpath('code').content[/0*(\d+)$/, 1]
|
|
902
912
|
response[:message_text] = element.at_xpath('text').content.chomp('.')
|
|
903
913
|
end
|
|
904
914
|
|
|
905
|
-
response[:result_code] =
|
|
906
|
-
|
|
907
|
-
|
|
915
|
+
response[:result_code] =
|
|
916
|
+
if element = doc.at_xpath('//messages/resultCode')
|
|
917
|
+
empty?(element.content) ? nil : element.content
|
|
918
|
+
end
|
|
908
919
|
|
|
909
|
-
response[:test_request] =
|
|
910
|
-
|
|
911
|
-
|
|
920
|
+
response[:test_request] =
|
|
921
|
+
if element = doc.at_xpath('//testRequest')
|
|
922
|
+
empty?(element.content) ? nil : element.content
|
|
923
|
+
end
|
|
912
924
|
|
|
913
|
-
response[:customer_profile_id] =
|
|
914
|
-
|
|
915
|
-
|
|
925
|
+
response[:customer_profile_id] =
|
|
926
|
+
if element = doc.at_xpath('//customerProfileId')
|
|
927
|
+
empty?(element.content) ? nil : element.content
|
|
928
|
+
end
|
|
916
929
|
|
|
917
|
-
response[:customer_payment_profile_id] =
|
|
918
|
-
|
|
919
|
-
|
|
930
|
+
response[:customer_payment_profile_id] =
|
|
931
|
+
if element = doc.at_xpath('//customerPaymentProfileIdList/numericString')
|
|
932
|
+
empty?(element.content) ? nil : element.content
|
|
933
|
+
end
|
|
920
934
|
|
|
921
|
-
response[:customer_payment_profile_id] =
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
935
|
+
response[:customer_payment_profile_id] =
|
|
936
|
+
if element = doc.at_xpath('//customerPaymentProfileIdList/numericString') ||
|
|
937
|
+
doc.at_xpath('//customerPaymentProfileId')
|
|
938
|
+
empty?(element.content) ? nil : element.content
|
|
939
|
+
end
|
|
925
940
|
|
|
926
|
-
response[:direct_response] =
|
|
927
|
-
|
|
928
|
-
|
|
941
|
+
response[:direct_response] =
|
|
942
|
+
if element = doc.at_xpath('//directResponse')
|
|
943
|
+
empty?(element.content) ? nil : element.content
|
|
944
|
+
end
|
|
929
945
|
|
|
930
946
|
response.merge!(parse_direct_response_elements(response, options))
|
|
931
947
|
|
|
@@ -44,12 +44,13 @@ module ActiveMerchant #:nodoc:
|
|
|
44
44
|
add_common_params(post, options)
|
|
45
45
|
|
|
46
46
|
MultiResponse.run do |r|
|
|
47
|
-
identifier =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
identifier =
|
|
48
|
+
if(payment_method.respond_to?(:number))
|
|
49
|
+
r.process { store(payment_method, options) }
|
|
50
|
+
r.authorization
|
|
51
|
+
else
|
|
52
|
+
payment_method
|
|
53
|
+
end
|
|
53
54
|
r.process { commit('debits', "cards/#{card_identifier_from(identifier)}/debits", post) }
|
|
54
55
|
end
|
|
55
56
|
end
|
|
@@ -61,12 +62,13 @@ module ActiveMerchant #:nodoc:
|
|
|
61
62
|
add_common_params(post, options)
|
|
62
63
|
|
|
63
64
|
MultiResponse.run do |r|
|
|
64
|
-
identifier =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
identifier =
|
|
66
|
+
if(payment_method.respond_to?(:number))
|
|
67
|
+
r.process { store(payment_method, options) }
|
|
68
|
+
r.authorization
|
|
69
|
+
else
|
|
70
|
+
payment_method
|
|
71
|
+
end
|
|
70
72
|
r.process { commit('card_holds', "cards/#{card_identifier_from(identifier)}/card_holds", post) }
|
|
71
73
|
end
|
|
72
74
|
end
|
|
@@ -97,7 +97,7 @@ module ActiveMerchant #:nodoc:
|
|
|
97
97
|
post[:zip] = address[:zip].to_s
|
|
98
98
|
post[:city] = address[:city].to_s
|
|
99
99
|
post[:country] = address[:country].to_s
|
|
100
|
-
post[:state] = address[:state].blank?
|
|
100
|
+
post[:state] = address[:state].blank? ? 'n/a' : address[:state]
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -119,7 +119,7 @@ module ActiveMerchant #:nodoc:
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def parse(body)
|
|
122
|
-
results
|
|
122
|
+
results = {}
|
|
123
123
|
xml = Nokogiri::XML(body)
|
|
124
124
|
resp = xml.xpath('//Response/Transaction/Identification')
|
|
125
125
|
resp.children.each do |element|
|
|
@@ -129,25 +129,25 @@ module ActiveMerchant #:nodoc:
|
|
|
129
129
|
# Smartpay may return AVS codes not covered by standard AVSResult codes.
|
|
130
130
|
# Smartpay's descriptions noted below.
|
|
131
131
|
AVS_MAPPING = {
|
|
132
|
-
'0' => 'R',
|
|
133
|
-
'1' => 'A',
|
|
134
|
-
'2' => 'N',
|
|
135
|
-
'3' => 'R',
|
|
136
|
-
'4' => 'E',
|
|
137
|
-
'5' => 'U',
|
|
138
|
-
'6' => 'Z',
|
|
139
|
-
'7' => 'D',
|
|
140
|
-
'8' => 'U',
|
|
141
|
-
'9' => 'B',
|
|
142
|
-
'10' => 'N',
|
|
143
|
-
'11' => 'U',
|
|
144
|
-
'12' => 'B',
|
|
145
|
-
'13' => 'U',
|
|
146
|
-
'14' => 'P',
|
|
147
|
-
'15' => 'P',
|
|
148
|
-
'16' => 'N',
|
|
149
|
-
'17' => 'U',
|
|
150
|
-
'18' => 'I'
|
|
132
|
+
'0' => 'R', # Unknown
|
|
133
|
+
'1' => 'A', # Address matches, postal code doesn't
|
|
134
|
+
'2' => 'N', # Neither postal code nor address match
|
|
135
|
+
'3' => 'R', # AVS unavailable
|
|
136
|
+
'4' => 'E', # AVS not supported for this card type
|
|
137
|
+
'5' => 'U', # No AVS data provided
|
|
138
|
+
'6' => 'Z', # Postal code matches, address doesn't match
|
|
139
|
+
'7' => 'D', # Both postal code and address match
|
|
140
|
+
'8' => 'U', # Address not checked, postal code unknown
|
|
141
|
+
'9' => 'B', # Address matches, postal code unknown
|
|
142
|
+
'10' => 'N', # Address doesn't match, postal code unknown
|
|
143
|
+
'11' => 'U', # Postal code not checked, address unknown
|
|
144
|
+
'12' => 'B', # Address matches, postal code not checked
|
|
145
|
+
'13' => 'U', # Address doesn't match, postal code not checked
|
|
146
|
+
'14' => 'P', # Postal code matches, address unknown
|
|
147
|
+
'15' => 'P', # Postal code matches, address not checked
|
|
148
|
+
'16' => 'N', # Postal code doesn't match, address unknown
|
|
149
|
+
'17' => 'U', # Postal code doesn't match, address not checked
|
|
150
|
+
'18' => 'I' # Neither postal code nor address were checked
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
def commit(action, post, account = 'ws', password = @options[:password])
|
|
@@ -84,7 +84,7 @@ module ActiveMerchant #:nodoc:
|
|
|
84
84
|
add_customer_data(post, options)
|
|
85
85
|
add_rebill(post, options) if options[:rebill]
|
|
86
86
|
add_duplicate_override(post, options)
|
|
87
|
-
post[:TRANS_TYPE]
|
|
87
|
+
post[:TRANS_TYPE] = 'AUTH'
|
|
88
88
|
commit('AUTH_ONLY', money, post, options)
|
|
89
89
|
end
|
|
90
90
|
|
|
@@ -107,7 +107,7 @@ module ActiveMerchant #:nodoc:
|
|
|
107
107
|
add_customer_data(post, options)
|
|
108
108
|
add_rebill(post, options) if options[:rebill]
|
|
109
109
|
add_duplicate_override(post, options)
|
|
110
|
-
post[:TRANS_TYPE]
|
|
110
|
+
post[:TRANS_TYPE] = 'SALE'
|
|
111
111
|
commit('AUTH_CAPTURE', money, post, options)
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -385,7 +385,7 @@ module ActiveMerchant #:nodoc:
|
|
|
385
385
|
elsif message =~ /Approved/
|
|
386
386
|
message = 'This transaction has been approved'
|
|
387
387
|
elsif message =~ /Expired/
|
|
388
|
-
message =
|
|
388
|
+
message = 'The credit card has expired'
|
|
389
389
|
end
|
|
390
390
|
message
|
|
391
391
|
end
|
|
@@ -186,7 +186,7 @@ module ActiveMerchant #:nodoc:
|
|
|
186
186
|
post[address_key(prefix, 'FirstName')] = address[:first_name]
|
|
187
187
|
post[address_key(prefix, 'LastName')] = address[:last_name]
|
|
188
188
|
end
|
|
189
|
-
post[address_key(prefix, 'MiddleName')]
|
|
189
|
+
post[address_key(prefix, 'MiddleName')] = address[:middle_name]
|
|
190
190
|
|
|
191
191
|
post[address_key(prefix, 'Company')] = address[:company]
|
|
192
192
|
post[address_key(prefix, 'Street')] = address[:address1]
|