activemerchant 1.107.4 → 1.108.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +11 -0
- data/README.md +1 -1
- data/lib/active_merchant/billing/gateways/authorize_net.rb +1 -1
- data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +4 -6
- data/lib/active_merchant/billing/gateways/clearhaus.rb +1 -1
- data/lib/active_merchant/billing/gateways/cyber_source.rb +6 -2
- data/lib/active_merchant/billing/gateways/d_local.rb +13 -3
- data/lib/active_merchant/billing/gateways/decidir.rb +24 -0
- data/lib/active_merchant/billing/gateways/elavon.rb +4 -3
- data/lib/active_merchant/billing/gateways/element.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +1 -1
- data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +1 -1
- data/lib/active_merchant/billing/gateways/netaxept.rb +1 -1
- data/lib/active_merchant/billing/gateways/netbanx.rb +1 -1
- data/lib/active_merchant/billing/gateways/opp.rb +1 -1
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +1 -1
- data/lib/active_merchant/billing/gateways/pin.rb +1 -1
- data/lib/active_merchant/billing/gateways/quantum.rb +1 -1
- data/lib/active_merchant/billing/gateways/realex.rb +1 -1
- data/lib/active_merchant/billing/gateways/redsys.rb +1 -1
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +1 -1
- data/lib/active_merchant/billing/gateways/transact_pro.rb +2 -2
- data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
- data/lib/active_merchant/billing/gateways/worldpay.rb +1 -1
- data/lib/active_merchant/connection.rb +40 -42
- data/lib/active_merchant/network_connection_retries.rb +10 -12
- data/lib/active_merchant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11b837a742d2fd39e941f6aa861b3c3557fe2ddb6142b2e119c48d22e7b39749
|
4
|
+
data.tar.gz: 3aa9e72328ca32c4e84c2919dc61f3b58350d806f49fe2ea342fc9acb19a8056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5454b152692725df9ee05bf8cfc202642ca7fb535950996d5c521c76788f0bec214f707596293185fac78d38785ef1a53924f3b99fd38137f09014c4339d92d
|
7
|
+
data.tar.gz: d724f10b88a939d856454396e0a1b9a80d975fd40d0fe2db4e8a8c0da7cdc434f4fe8c2117f86e16acb40479295d8ba766a691e6accf059973e6af1359b26387
|
data/CHANGELOG
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
== HEAD
|
4
4
|
|
5
|
+
== Version 1.108.0 (Jun 9, 2020)
|
6
|
+
* Cybersource: Send cavv as xid is xid is missing [pi3r] #3658
|
7
|
+
* Forte: Change default sec_code value to PPD [molbrown] #3653
|
8
|
+
* Elavon: Add merchant initiated unscheduled field [leila-alderman] #3647
|
9
|
+
* Decidir: Add aggregate data fields [leila-alderman] #3648
|
10
|
+
* Vantiv: Vantiv(Element): add option to send terminal id in transactions [cdmackeyfree] #3654
|
11
|
+
* Update supported Ruby and Rails versions [leila-alderman] #3656
|
12
|
+
* CI: Drop unused sudo: false Travis directive [olleolleolle] #3616
|
13
|
+
* PayU Latam: Prevent blank country in billing_address [britth] #3657
|
14
|
+
* DLocal: Fix address field names [molbrown] #3651
|
15
|
+
|
5
16
|
== Version 1.107.4 (Jun 2, 2020)
|
6
17
|
* Elavon: Implement true verify action [leila-alderman] #3610
|
7
18
|
* Vantiv Express: Implement true verify [leila-alderman] #3617
|
data/README.md
CHANGED
@@ -244,4 +244,4 @@ Functionality or APIs that are deprecated will be marked as such. Deprecated fun
|
|
244
244
|
|
245
245
|
## Ruby and Rails compatibility policies
|
246
246
|
|
247
|
-
Because Active Merchant is a payment library, it needs to take security seriously. For this reason, Active Merchant guarantees compatibility only with actively supported versions of Ruby and Rails. At the time of this writing, that means that Ruby 2.
|
247
|
+
Because Active Merchant is a payment library, it needs to take security seriously. For this reason, Active Merchant guarantees compatibility only with actively supported versions of Ruby and Rails. At the time of this writing, that means that Ruby 2.5+ and Rails 5.0+ are supported.
|
@@ -488,7 +488,7 @@ module ActiveMerchant
|
|
488
488
|
|
489
489
|
def add_swipe_data(xml, credit_card)
|
490
490
|
TRACKS.each do |key, regex|
|
491
|
-
if regex.match(credit_card.track_data)
|
491
|
+
if regex.match?(credit_card.track_data)
|
492
492
|
@valid_track_data = true
|
493
493
|
xml.payment do
|
494
494
|
xml.trackData do
|
@@ -382,9 +382,9 @@ module ActiveMerchant #:nodoc:
|
|
382
382
|
end
|
383
383
|
elsif message == 'Missing ACCOUNT_ID'
|
384
384
|
message = 'The merchant login ID or password is invalid'
|
385
|
-
elsif
|
385
|
+
elsif /Approved/.match?(message)
|
386
386
|
message = 'This transaction has been approved'
|
387
|
-
elsif
|
387
|
+
elsif /Expired/.match?(message)
|
388
388
|
message = 'The credit card has expired'
|
389
389
|
end
|
390
390
|
message
|
@@ -204,12 +204,10 @@ module ActiveMerchant #:nodoc:
|
|
204
204
|
|
205
205
|
def check_customer_exists(customer_vault_id)
|
206
206
|
commit do
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
|
212
|
-
end
|
207
|
+
@braintree_gateway.customer.find(customer_vault_id)
|
208
|
+
ActiveMerchant::Billing::Response.new(true, 'Customer found', {exists: true}, authorization: customer_vault_id)
|
209
|
+
rescue Braintree::NotFoundError
|
210
|
+
ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
|
213
211
|
end
|
214
212
|
end
|
215
213
|
|
@@ -206,7 +206,7 @@ module ActiveMerchant #:nodoc:
|
|
206
206
|
|
207
207
|
def generate_signature(body)
|
208
208
|
key = OpenSSL::PKey::RSA.new(@options[:private_key])
|
209
|
-
hex = key.sign(OpenSSL::Digest.new('sha256'), body).
|
209
|
+
hex = key.sign(OpenSSL::Digest.new('sha256'), body).unpack1('H*')
|
210
210
|
|
211
211
|
"#{@options[:signing_key]} RS256-hex #{hex}"
|
212
212
|
end
|
@@ -617,7 +617,10 @@ module ActiveMerchant #:nodoc:
|
|
617
617
|
xml.tag!('directoryServerTransactionID', threeds_2_options[:ds_transaction_id]) if threeds_2_options[:ds_transaction_id]
|
618
618
|
xml.tag!('commerceIndicator', options[:commerce_indicator] || ECI_BRAND_MAPPING[card_brand(payment_method).to_sym])
|
619
619
|
xml.tag!('eciRaw', threeds_2_options[:eci]) if threeds_2_options[:eci]
|
620
|
-
|
620
|
+
|
621
|
+
xid = threeds_2_options[:xid] || threeds_2_options[:cavv]
|
622
|
+
xml.tag!('xid', xid) if xid
|
623
|
+
|
621
624
|
xml.tag!('veresEnrolled', threeds_2_options[:enrolled]) if threeds_2_options[:enrolled]
|
622
625
|
xml.tag!('paresStatus', threeds_2_options[:authentication_response_status]) if threeds_2_options[:authentication_response_status]
|
623
626
|
end
|
@@ -820,6 +823,7 @@ module ActiveMerchant #:nodoc:
|
|
820
823
|
|
821
824
|
def add_stored_credential_options(xml, options={})
|
822
825
|
return unless options[:stored_credential]
|
826
|
+
|
823
827
|
xml.tag! 'subsequentAuth', 'true' if options[:stored_credential][:initiator] == 'merchant'
|
824
828
|
xml.tag! 'subsequentAuthFirst', 'true' if options[:stored_credential][:initial_transaction]
|
825
829
|
xml.tag! 'subsequentAuthTransactionID', options[:stored_credential][:network_transaction_id] if options[:stored_credential][:initiator] == 'merchant'
|
@@ -912,7 +916,7 @@ module ActiveMerchant #:nodoc:
|
|
912
916
|
if node.has_elements?
|
913
917
|
node.elements.each { |e| parse_element(reply, e) }
|
914
918
|
else
|
915
|
-
if node.parent.name
|
919
|
+
if /item/.match?(node.parent.name)
|
916
920
|
parent = node.parent.name
|
917
921
|
parent += '_' + node.parent.attributes['id'] if node.parent.attributes['id']
|
918
922
|
parent += '_'
|
@@ -118,12 +118,22 @@ module ActiveMerchant #:nodoc:
|
|
118
118
|
address_object = {}
|
119
119
|
address_object[:state] = address[:state] if address[:state]
|
120
120
|
address_object[:city] = address[:city] if address[:city]
|
121
|
-
address_object[:zip_code] = address[:
|
122
|
-
address_object[:street] = address[:street] if address
|
123
|
-
address_object[:number] = address[:number] if address
|
121
|
+
address_object[:zip_code] = address[:zip] if address[:zip]
|
122
|
+
address_object[:street] = address[:street] || parse_street(address) if parse_street(address)
|
123
|
+
address_object[:number] = address[:number] || parse_house_number(address) if parse_house_number(address)
|
124
124
|
address_object
|
125
125
|
end
|
126
126
|
|
127
|
+
def parse_street(address)
|
128
|
+
street = address[:address1].split(/\s+/).keep_if { |x| x !~ /\d/ }.join(' ')
|
129
|
+
street.empty? ? nil : street
|
130
|
+
end
|
131
|
+
|
132
|
+
def parse_house_number(address)
|
133
|
+
house = address[:address1].split(/\s+/).keep_if { |x| x =~ /\d/ }.join(' ')
|
134
|
+
house.empty? ? nil : house
|
135
|
+
end
|
136
|
+
|
127
137
|
def add_card(post, card, action, options={})
|
128
138
|
post[:card] = {}
|
129
139
|
post[:card][:holder_name] = card.name
|
@@ -121,6 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
|
122
122
|
add_invoice(post, money, options)
|
123
123
|
add_payment(post, credit_card, options)
|
124
|
+
add_aggregate_data(post, options) if options[:aggregate_data]
|
124
125
|
end
|
125
126
|
|
126
127
|
def add_payment_method_id(credit_card, options)
|
@@ -180,6 +181,29 @@ module ActiveMerchant #:nodoc:
|
|
180
181
|
post[:card_data] = card_data
|
181
182
|
end
|
182
183
|
|
184
|
+
def add_aggregate_data(post, options)
|
185
|
+
aggregate_data = {}
|
186
|
+
data = options[:aggregate_data]
|
187
|
+
aggregate_data[:indicator] = data[:indicator] if data[:indicator]
|
188
|
+
aggregate_data[:identification_number] = data[:identification_number] if data[:identification_number]
|
189
|
+
aggregate_data[:bill_to_pay] = data[:bill_to_pay] if data[:bill_to_pay]
|
190
|
+
aggregate_data[:bill_to_refund] = data[:bill_to_refund] if data[:bill_to_refund]
|
191
|
+
aggregate_data[:merchant_name] = data[:merchant_name] if data[:merchant_name]
|
192
|
+
aggregate_data[:street] = data[:street] if data[:street]
|
193
|
+
aggregate_data[:number] = data[:number] if data[:number]
|
194
|
+
aggregate_data[:postal_code] = data[:postal_code] if data[:postal_code]
|
195
|
+
aggregate_data[:category] = data[:category] if data[:category]
|
196
|
+
aggregate_data[:channel] = data[:channel] if data[:channel]
|
197
|
+
aggregate_data[:geographic_code] = data[:geographic_code] if data[:geographic_code]
|
198
|
+
aggregate_data[:city] = data[:city] if data[:city]
|
199
|
+
aggregate_data[:merchant_id] = data[:merchant_id] if data[:merchant_id]
|
200
|
+
aggregate_data[:province] = data[:province] if data[:province]
|
201
|
+
aggregate_data[:country] = data[:country] if data[:country]
|
202
|
+
aggregate_data[:merchant_email] = data[:merchant_email] if data[:merchant_email]
|
203
|
+
aggregate_data[:merchant_phone] = data[:merchant_phone] if data[:merchant_phone]
|
204
|
+
post[:aggregate_data] = aggregate_data
|
205
|
+
end
|
206
|
+
|
183
207
|
def add_fraud_detection(options = {})
|
184
208
|
{}.tap do |hsh|
|
185
209
|
hsh[:send_to_cs] = options[:send_to_cs] if valid_fraud_detection_option?(options[:send_to_cs]) # true/false
|
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
add_customer_data(form, options)
|
49
49
|
add_test_mode(form, options)
|
50
50
|
add_ip(form, options)
|
51
|
-
|
51
|
+
add_auth_purchase_params(form, options)
|
52
52
|
add_level_3_fields(form, options) if options[:level_3_data]
|
53
53
|
commit(:purchase, money, form, options)
|
54
54
|
end
|
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
|
|
63
63
|
add_customer_data(form, options)
|
64
64
|
add_test_mode(form, options)
|
65
65
|
add_ip(form, options)
|
66
|
-
|
66
|
+
add_auth_purchase_params(form, options)
|
67
67
|
add_level_3_fields(form, options) if options[:level_3_data]
|
68
68
|
commit(:authorize, money, form, options)
|
69
69
|
end
|
@@ -257,8 +257,9 @@ module ActiveMerchant #:nodoc:
|
|
257
257
|
form[:cardholder_ip] = options[:ip] if options.has_key?(:ip)
|
258
258
|
end
|
259
259
|
|
260
|
-
def
|
260
|
+
def add_auth_purchase_params(form, options)
|
261
261
|
form[:dynamic_dba] = options[:dba] if options.has_key?(:dba)
|
262
|
+
form[:merchant_initiated_unscheduled] = options[:merchant_initiated_unscheduled] if options.has_key?(:merchant_initiated_unscheduled)
|
262
263
|
end
|
263
264
|
|
264
265
|
def add_level_3_fields(form, options)
|
@@ -193,7 +193,7 @@ module ActiveMerchant #:nodoc:
|
|
193
193
|
|
194
194
|
def add_terminal(xml, options)
|
195
195
|
xml.terminal do
|
196
|
-
xml.TerminalID '01'
|
196
|
+
xml.TerminalID options[:terminal_id] || '01'
|
197
197
|
xml.CardPresentCode options[:card_present_code] || 'UseDefault'
|
198
198
|
xml.CardholderPresentCode 'UseDefault'
|
199
199
|
xml.CardInputCode 'UseDefault'
|
@@ -255,7 +255,7 @@ module ActiveMerchant #:nodoc:
|
|
255
255
|
(credit_card.respond_to?(:eci) ? credit_card.eci : nil) || options[:eci] || DEFAULT_ECI
|
256
256
|
end
|
257
257
|
|
258
|
-
xml.tag! 'Ecommerce_Flag',
|
258
|
+
xml.tag! 'Ecommerce_Flag', /^[0-9]+$/.match?(eci.to_s) ? eci.to_s.rjust(2, '0') : eci
|
259
259
|
end
|
260
260
|
|
261
261
|
def add_credit_card_verification_strings(xml, credit_card, options)
|
@@ -229,7 +229,7 @@ module ActiveMerchant #:nodoc:
|
|
229
229
|
(credit_card.respond_to?(:eci) ? credit_card.eci : nil) || options[:eci] || DEFAULT_ECI
|
230
230
|
end
|
231
231
|
|
232
|
-
xml.tag! 'Ecommerce_Flag',
|
232
|
+
xml.tag! 'Ecommerce_Flag', /^[0-9]+$/.match?(eci.to_s) ? eci.to_s.rjust(2, '0') : eci
|
233
233
|
end
|
234
234
|
|
235
235
|
def add_credit_card_verification_strings(xml, credit_card, options)
|
@@ -166,7 +166,7 @@ module ActiveMerchant #:nodoc:
|
|
166
166
|
post[:echeck][:routing_number] = payment.routing_number
|
167
167
|
post[:echeck][:account_type] = payment.account_type
|
168
168
|
post[:echeck][:check_number] = payment.number
|
169
|
-
post[:echeck][:sec_code] = options[:sec_code] ||
|
169
|
+
post[:echeck][:sec_code] = options[:sec_code] || 'PPD'
|
170
170
|
end
|
171
171
|
|
172
172
|
def add_credit_card(post, payment)
|
@@ -123,7 +123,7 @@ module ActiveMerchant #:nodoc:
|
|
123
123
|
|
124
124
|
success = false
|
125
125
|
authorization = (raw['TransactionId'] || parameters[:transactionId])
|
126
|
-
if raw[:container]
|
126
|
+
if /Exception|Error/.match?(raw[:container])
|
127
127
|
message = (raw['Message'] || raw['Error']['Message'])
|
128
128
|
elsif raw['Error'] && !raw['Error'].empty?
|
129
129
|
message = (raw['Error']['ResponseText'] || raw['Error']['ResponseCode'])
|
@@ -222,7 +222,7 @@ module ActiveMerchant #:nodoc:
|
|
222
222
|
|
223
223
|
def get_url(uri)
|
224
224
|
url = (test? ? test_url : live_url)
|
225
|
-
if
|
225
|
+
if /^customervault/.match?(uri)
|
226
226
|
"#{url}#{uri}"
|
227
227
|
else
|
228
228
|
"#{url}cardpayments/v1/accounts/#{@options[:account_number]}/#{uri}"
|
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
|
|
181
181
|
node.xpath('.//*').each { |e| parse_element(payment_result_response, e) }
|
182
182
|
when node.xpath('.//*').to_a.any?
|
183
183
|
node.xpath('.//*').each { |e| parse_element(response, e) }
|
184
|
-
when node_name.to_s
|
184
|
+
when /amt$/.match?(node_name.to_s)
|
185
185
|
# *Amt elements don't put the value in the #text - instead they use a Currency attribute
|
186
186
|
response[node_name] = node.attributes['Currency'].to_s
|
187
187
|
when node_name == :ext_data
|
@@ -186,7 +186,7 @@ module ActiveMerchant #:nodoc:
|
|
186
186
|
billing_address[:street2] = address[:address2]
|
187
187
|
billing_address[:city] = address[:city]
|
188
188
|
billing_address[:state] = address[:state]
|
189
|
-
billing_address[:country] = address[:country]
|
189
|
+
billing_address[:country] = address[:country] unless address[:country].blank?
|
190
190
|
billing_address[:postalCode] = address[:zip] if @options[:payment_country] == 'MX'
|
191
191
|
billing_address[:phone] = address[:phone]
|
192
192
|
billing_address
|
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
|
|
138
138
|
name: creditcard.name
|
139
139
|
)
|
140
140
|
elsif creditcard.kind_of?(String)
|
141
|
-
if
|
141
|
+
if /^card_/.match?(creditcard)
|
142
142
|
post[:card_token] = get_card_token(creditcard)
|
143
143
|
else
|
144
144
|
post[:customer_token] = creditcard
|
@@ -253,7 +253,7 @@ module ActiveMerchant #:nodoc:
|
|
253
253
|
if node.has_elements?
|
254
254
|
node.elements.each { |e| parse_element(reply, e) }
|
255
255
|
else
|
256
|
-
if node.parent.name
|
256
|
+
if /item/.match?(node.parent.name)
|
257
257
|
parent = node.parent.name + (node.parent.attributes['id'] ? '_' + node.parent.attributes['id'] : '')
|
258
258
|
reply[(parent + '_' + node.name).to_sym] = node.text
|
259
259
|
else
|
@@ -310,7 +310,7 @@ module ActiveMerchant
|
|
310
310
|
|
311
311
|
version = three_d_secure.fetch(:version, '')
|
312
312
|
xml.tag! 'mpi' do
|
313
|
-
if
|
313
|
+
if /^2/.match?(version)
|
314
314
|
xml.tag! 'authentication_value', three_d_secure[:cavv]
|
315
315
|
xml.tag! 'ds_trans_id', three_d_secure[:ds_transaction_id]
|
316
316
|
else
|
@@ -565,7 +565,7 @@ module ActiveMerchant #:nodoc:
|
|
565
565
|
|
566
566
|
def clean_order_id(order_id)
|
567
567
|
cleansed = order_id.gsub(/[^\da-zA-Z]/, '')
|
568
|
-
if
|
568
|
+
if /^\d{4}/.match?(cleansed)
|
569
569
|
cleansed[0..11]
|
570
570
|
else
|
571
571
|
'%04d%s' % [rand(0..9999), cleansed[0...8]]
|
@@ -149,7 +149,7 @@ module ActiveMerchant #:nodoc:
|
|
149
149
|
def parse(response, action)
|
150
150
|
result = {}
|
151
151
|
document = REXML::Document.new(response)
|
152
|
-
response_element = document.root.get_elements("
|
152
|
+
response_element = document.root.get_elements("//*[@xsi:type='tns:#{action}Response']").first
|
153
153
|
response_element.elements.each do |element|
|
154
154
|
result[element.name.underscore] = element.text
|
155
155
|
end
|
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
|
|
121
121
|
|
122
122
|
if charge_id.nil?
|
123
123
|
error_message = "No associated charge for #{intent['id']}"
|
124
|
-
error_message <<
|
124
|
+
error_message << "; payment_intent has a status of #{intent['status']}" if intent.try(:[], 'status') && intent.try(:[], 'status') != 'succeeded'
|
125
125
|
return Response.new(false, error_message, intent)
|
126
126
|
end
|
127
127
|
else
|
@@ -162,7 +162,7 @@ module ActiveMerchant #:nodoc:
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def parse(body)
|
165
|
-
if
|
165
|
+
if /^ID:/.match?(body)
|
166
166
|
body.split('~').reduce(Hash.new) { |h, v|
|
167
167
|
m = v.match('(.*?):(.*)')
|
168
168
|
h.merge!(m[1].underscore.to_sym => m[2])
|
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
|
|
197
197
|
end
|
198
198
|
|
199
199
|
def split_authorization(authorization)
|
200
|
-
if authorization
|
200
|
+
if /|/.match?(authorization)
|
201
201
|
identifier, amount = authorization.split('|')
|
202
202
|
[identifier, amount.to_i]
|
203
203
|
else
|
@@ -406,7 +406,7 @@ module ActiveMerchant #:nodoc:
|
|
406
406
|
def add_three_d_secure(three_d_secure, xml)
|
407
407
|
xml.info3DSecure do
|
408
408
|
xml.threeDSVersion three_d_secure[:version]
|
409
|
-
if three_d_secure[:version]
|
409
|
+
if /^2/.match?(three_d_secure[:version])
|
410
410
|
xml.dsTransactionId three_d_secure[:ds_transaction_id]
|
411
411
|
else
|
412
412
|
xml.xid three_d_secure[:xid]
|
@@ -73,52 +73,50 @@ module ActiveMerchant
|
|
73
73
|
headers['connection'] ||= 'close'
|
74
74
|
|
75
75
|
retry_exceptions(max_retries: max_retries, logger: logger, tag: tag) do
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
76
|
+
info "connection_http_method=#{method.to_s.upcase} connection_uri=#{endpoint}", tag
|
77
|
+
|
78
|
+
result = nil
|
79
|
+
|
80
|
+
realtime = Benchmark.realtime do
|
81
|
+
http.start unless http.started?
|
82
|
+
@ssl_connection = http.ssl_connection
|
83
|
+
info "connection_ssl_version=#{ssl_connection[:version]} connection_ssl_cipher=#{ssl_connection[:cipher]}", tag
|
84
|
+
|
85
|
+
result =
|
86
|
+
case method
|
87
|
+
when :get
|
88
|
+
raise ArgumentError, 'GET requests do not support a request body' if body
|
89
|
+
|
90
|
+
http.get(endpoint.request_uri, headers)
|
91
|
+
when :post
|
92
|
+
debug body
|
93
|
+
http.post(endpoint.request_uri, body, RUBY_184_POST_HEADERS.merge(headers))
|
94
|
+
when :put
|
95
|
+
debug body
|
96
|
+
http.put(endpoint.request_uri, body, headers)
|
97
|
+
when :patch
|
98
|
+
debug body
|
99
|
+
http.patch(endpoint.request_uri, body, headers)
|
100
|
+
when :delete
|
101
|
+
# It's kind of ambiguous whether the RFC allows bodies
|
102
|
+
# for DELETE requests. But Net::HTTP's delete method
|
103
|
+
# very unambiguously does not.
|
104
|
+
if body
|
93
105
|
debug body
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
http.put(endpoint.request_uri, body, headers)
|
98
|
-
when :patch
|
99
|
-
debug body
|
100
|
-
http.patch(endpoint.request_uri, body, headers)
|
101
|
-
when :delete
|
102
|
-
# It's kind of ambiguous whether the RFC allows bodies
|
103
|
-
# for DELETE requests. But Net::HTTP's delete method
|
104
|
-
# very unambiguously does not.
|
105
|
-
if body
|
106
|
-
debug body
|
107
|
-
req = Net::HTTP::Delete.new(endpoint.request_uri, headers)
|
108
|
-
req.body = body
|
109
|
-
http.request(req)
|
110
|
-
else
|
111
|
-
http.delete(endpoint.request_uri, headers)
|
112
|
-
end
|
106
|
+
req = Net::HTTP::Delete.new(endpoint.request_uri, headers)
|
107
|
+
req.body = body
|
108
|
+
http.request(req)
|
113
109
|
else
|
114
|
-
|
110
|
+
http.delete(endpoint.request_uri, headers)
|
115
111
|
end
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
debug result.body
|
120
|
-
result
|
112
|
+
else
|
113
|
+
raise ArgumentError, "Unsupported request method #{method.to_s.upcase}"
|
114
|
+
end
|
121
115
|
end
|
116
|
+
|
117
|
+
info '--> %d %s (%d %.4fs)' % [result.code, result.message, result.body ? result.body.length : 0, realtime], tag
|
118
|
+
debug result.body
|
119
|
+
result
|
122
120
|
end
|
123
121
|
ensure
|
124
122
|
info 'connection_request_total_time=%.4fs' % [Process.clock_gettime(Process::CLOCK_MONOTONIC) - request_start], tag
|
@@ -21,18 +21,16 @@ module ActiveMerchant
|
|
21
21
|
connection_errors = DEFAULT_CONNECTION_ERRORS.merge(options[:connection_exceptions] || {})
|
22
22
|
|
23
23
|
retry_network_exceptions(options) do
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
raise ActiveMerchant::ConnectionError.new(derived_error_message(connection_errors, e.class), e)
|
35
|
-
end
|
24
|
+
yield
|
25
|
+
rescue Errno::ECONNREFUSED => e
|
26
|
+
raise ActiveMerchant::RetriableConnectionError.new('The remote server refused the connection', e)
|
27
|
+
rescue OpenSSL::X509::CertificateError => e
|
28
|
+
NetworkConnectionRetries.log(options[:logger], :error, e.message, options[:tag])
|
29
|
+
raise ActiveMerchant::ClientCertificateError, 'The remote server did not accept the provided SSL certificate'
|
30
|
+
rescue Zlib::BufError
|
31
|
+
raise ActiveMerchant::InvalidResponseError, 'The remote server replied with an invalid response'
|
32
|
+
rescue *connection_errors.keys => e
|
33
|
+
raise ActiveMerchant::ConnectionError.new(derived_error_message(connection_errors, e.class), e)
|
36
34
|
end
|
37
35
|
end
|
38
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemerchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.108.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -422,7 +422,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
422
422
|
requirements:
|
423
423
|
- - ">="
|
424
424
|
- !ruby/object:Gem::Version
|
425
|
-
version: '2.
|
425
|
+
version: '2.5'
|
426
426
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
427
427
|
requirements:
|
428
428
|
- - ">="
|