activemerchant 1.109.0 → 1.114.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +47 -1
  3. data/README.md +2 -2
  4. data/lib/active_merchant/billing/credit_card.rb +1 -1
  5. data/lib/active_merchant/billing/credit_card_methods.rb +1 -1
  6. data/lib/active_merchant/billing/gateway.rb +1 -1
  7. data/lib/active_merchant/billing/gateways/adyen.rb +17 -6
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +6 -6
  9. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
  12. data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/blue_snap.rb +74 -16
  14. data/lib/active_merchant/billing/gateways/borgun.rb +1 -1
  15. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -7
  16. data/lib/active_merchant/billing/gateways/cardknox.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
  18. data/lib/active_merchant/billing/gateways/checkout_v2.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/credorax.rb +7 -1
  20. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  21. data/lib/active_merchant/billing/gateways/cyber_source.rb +53 -16
  22. data/lib/active_merchant/billing/gateways/decidir.rb +1 -1
  23. data/lib/active_merchant/billing/gateways/digitzs.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/efsnet.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/element.rb +4 -0
  26. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  27. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/fat_zebra.rb +5 -3
  29. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +8 -0
  30. data/lib/active_merchant/billing/gateways/flo2cash.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/global_collect.rb +5 -0
  32. data/lib/active_merchant/billing/gateways/hdfc.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/hps.rb +9 -6
  34. data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/iridium.rb +2 -2
  36. data/lib/active_merchant/billing/gateways/linkpoint.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/litle.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/netbanx.rb +8 -2
  41. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/opp.rb +3 -3
  43. data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/orbital.rb +8 -1
  45. data/lib/active_merchant/billing/gateways/pagarme.rb +1 -1
  46. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -2
  47. data/lib/active_merchant/billing/gateways/payeezy.rb +3 -3
  48. data/lib/active_merchant/billing/gateways/payex.rb +5 -5
  49. data/lib/active_merchant/billing/gateways/payflow.rb +3 -0
  50. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  51. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  52. data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
  53. data/lib/active_merchant/billing/gateways/payu_latam.rb +4 -1
  54. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  56. data/lib/active_merchant/billing/gateways/qbms.rb +3 -3
  57. data/lib/active_merchant/billing/gateways/quickbooks.rb +3 -2
  58. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/realex.rb +1 -0
  60. data/lib/active_merchant/billing/gateways/redsys.rb +3 -3
  61. data/lib/active_merchant/billing/gateways/sage_pay.rb +4 -4
  62. data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -1
  63. data/lib/active_merchant/billing/gateways/stripe.rb +2 -2
  64. data/lib/active_merchant/billing/gateways/telr.rb +1 -1
  65. data/lib/active_merchant/billing/gateways/trans_first.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -2
  67. data/lib/active_merchant/billing/gateways/trust_commerce.rb +7 -7
  68. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +4 -4
  69. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  70. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  71. data/lib/active_merchant/version.rb +1 -1
  72. metadata +16 -2
@@ -364,7 +364,7 @@ module ActiveMerchant #:nodoc:
364
364
  dlstate: options[:telecheck_dlstate],
365
365
  void: options[:telecheck_void],
366
366
  accounttype: options[:telecheck_accounttype],
367
- ssn: options[:telecheck_ssn],
367
+ ssn: options[:telecheck_ssn]
368
368
  }
369
369
  }
370
370
 
@@ -274,7 +274,7 @@ module ActiveMerchant #:nodoc:
274
274
  doc.accType(payment_method.account_type.capitalize)
275
275
  doc.accNum(payment_method.account_number)
276
276
  doc.routingNum(payment_method.routing_number)
277
- doc.checkNum(payment_method.number)
277
+ doc.checkNum(payment_method.number) if payment_method.number
278
278
  end
279
279
  else
280
280
  doc.card do
@@ -105,7 +105,7 @@ module ActiveMerchant
105
105
  billing: {},
106
106
  device: {},
107
107
  shipping: {},
108
- transaction: {},
108
+ transaction: {}
109
109
  }
110
110
  end
111
111
 
@@ -190,7 +190,7 @@ module ActiveMerchant
190
190
  def headers
191
191
  {
192
192
  'Authorization' => 'Basic ' + Base64.encode64("merchant.#{@options[:userid]}:#{@options[:password]}").strip.delete("\r\n"),
193
- 'Content-Type' => 'application/json',
193
+ 'Content-Type' => 'application/json'
194
194
  }
195
195
  end
196
196
 
@@ -311,7 +311,7 @@ module ActiveMerchant #:nodoc:
311
311
  headers = {
312
312
  'Content-Type' => 'application/json'
313
313
  }
314
- headers['X-Device-Session-ID'] = options[:device_id] if options[:device_id]
314
+ headers['X-meli-session-id'] = options[:device_id] if options[:device_id]
315
315
  headers
316
316
  end
317
317
 
@@ -28,6 +28,10 @@ module ActiveMerchant #:nodoc:
28
28
  end
29
29
 
30
30
  def purchase(money, payment, options={})
31
+ # Do a Verification with AVS prior to purchase
32
+ verification_response = verify(payment, options)
33
+ return verification_response if verification_response.message != 'OK'
34
+
31
35
  post = {}
32
36
  add_invoice(post, money, options)
33
37
  add_settle_with_auth(post)
@@ -61,9 +65,11 @@ module ActiveMerchant #:nodoc:
61
65
  return settlement_data if settlement_data.message != 'OK'
62
66
 
63
67
  post = {}
64
- if settlement_data.params['status'] == 'PENDING'
68
+ if settlement_data.params['status'] == 'PENDING' && money == settlement_data.params['amount']
65
69
  post[:status] = 'CANCELLED'
66
70
  commit(:put, "settlements/#{authorization}", post)
71
+ elsif settlement_data.params['status'] == 'PENDING' && (money < settlement_data.params['amount'] || money > settlement_data.params['amount'])
72
+ return Response.new(false, 'Transaction not settled. Either do a full refund or try partial refund after settlement.')
67
73
  else
68
74
  add_invoice(post, money, options)
69
75
 
@@ -192,7 +198,7 @@ module ActiveMerchant #:nodoc:
192
198
  street: address[:address1],
193
199
  city: address[:city],
194
200
  zip: address[:zip],
195
- state: address[:state],
201
+ state: address[:state]
196
202
  }
197
203
  mapped[:country] = country.code(:alpha2).value unless country.blank?
198
204
 
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
4
4
  self.live_url = 'https://api.openpay.mx/v1/'
5
5
  self.test_url = 'https://sandbox-api.openpay.mx/v1/'
6
6
 
7
- self.supported_countries = ['MX']
7
+ self.supported_countries = %w(CO MX)
8
8
  self.supported_cardtypes = %i[visa master american_express carnet]
9
9
  self.homepage_url = 'http://www.openpay.mx/'
10
10
  self.display_name = 'Openpay'
@@ -243,7 +243,7 @@ module ActiveMerchant #:nodoc:
243
243
  city: address[:city],
244
244
  state: address[:state],
245
245
  postcode: address[:zip],
246
- country: address[:country],
246
+ country: address[:country]
247
247
  }
248
248
  end
249
249
 
@@ -260,7 +260,7 @@ module ActiveMerchant #:nodoc:
260
260
 
261
261
  if options[:registrationId]
262
262
  post[:card] = {
263
- cvv: payment.verification_value,
263
+ cvv: payment.verification_value
264
264
  }
265
265
  else
266
266
  post[:paymentBrand] = payment.brand.upcase
@@ -269,7 +269,7 @@ module ActiveMerchant #:nodoc:
269
269
  number: payment.number,
270
270
  expiryMonth: '%02d' % payment.month,
271
271
  expiryYear: payment.year,
272
- cvv: payment.verification_value,
272
+ cvv: payment.verification_value
273
273
  }
274
274
  end
275
275
  end
@@ -325,7 +325,7 @@ module ActiveMerchant #:nodoc:
325
325
  'master' => 'MC',
326
326
  'american_express' => 'AM',
327
327
  'discover' => 'DI',
328
- 'diners_club' => 'DC', }[key]
328
+ 'diners_club' => 'DC' }[key]
329
329
  end
330
330
  end
331
331
  end
@@ -421,6 +421,10 @@ module ActiveMerchant #:nodoc:
421
421
  end
422
422
  end
423
423
 
424
+ def add_card_indicators(xml, options)
425
+ xml.tag! :CardIndicators, options[:card_indicators] if options[:card_indicators]
426
+ end
427
+
424
428
  def add_address(xml, creditcard, options)
425
429
  if (address = (options[:billing_address] || options[:address]))
426
430
  avs_supported = AVS_SUPPORTED_COUNTRIES.include?(address[:country].to_s) || empty?(address[:country])
@@ -756,6 +760,7 @@ module ActiveMerchant #:nodoc:
756
760
  add_level_2_purchase(xml, parameters)
757
761
  add_level_3_purchase(xml, parameters)
758
762
  add_level_3_tax(xml, parameters)
763
+ add_card_indicators(xml, parameters)
759
764
  add_line_items(xml, parameters) if parameters[:line_items]
760
765
  add_stored_credentials(xml, parameters)
761
766
  add_pymt_brand_program_code(xml, creditcard, three_d_secure)
@@ -788,6 +793,8 @@ module ActiveMerchant #:nodoc:
788
793
  xml.tag! :TxRefNum, tx_ref_num
789
794
  add_level_2_purchase(xml, parameters)
790
795
  add_level_2_advice_addendum(xml, parameters)
796
+ add_level_3_purchase(xml, parameters)
797
+ add_level_3_tax(xml, parameters)
791
798
  end
792
799
  end
793
800
  xml.target!
@@ -979,7 +986,7 @@ module ActiveMerchant #:nodoc:
979
986
  'R' => 'Issuer does not participate in AVS',
980
987
  'UK' => 'Unknown',
981
988
  'X' => 'Zip Match/Zip 4 Match/Address Match',
982
- 'Z' => 'Zip Match/Locale no match',
989
+ 'Z' => 'Zip Match/Locale no match'
983
990
  }
984
991
 
985
992
  # Map vendor's AVS result code to a postal match code
@@ -13,7 +13,7 @@ module ActiveMerchant #:nodoc:
13
13
 
14
14
  STANDARD_ERROR_CODE_MAPPING = {
15
15
  'refused' => STANDARD_ERROR_CODE[:card_declined],
16
- 'processing_error' => STANDARD_ERROR_CODE[:processing_error],
16
+ 'processing_error' => STANDARD_ERROR_CODE[:processing_error]
17
17
  }
18
18
 
19
19
  def initialize(options={})
@@ -165,7 +165,7 @@ module ActiveMerchant #:nodoc:
165
165
  # transaction_id that can be used later to postauthorize (capture) the funds.
166
166
  def authorize(money, payment_source, options = {})
167
167
  parameters = {
168
- transaction_amount: amount(money),
168
+ transaction_amount: amount(money)
169
169
  }
170
170
 
171
171
  add_payment_source(parameters, payment_source)
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  # Execute authorization and capture in a single step.
179
179
  def purchase(money, payment_source, options = {})
180
180
  parameters = {
181
- transaction_amount: amount(money),
181
+ transaction_amount: amount(money)
182
182
  }
183
183
 
184
184
  add_payment_source(parameters, payment_source)
@@ -155,7 +155,7 @@ module ActiveMerchant
155
155
  params[:auth] = 'false'
156
156
  end
157
157
 
158
- def is_store_action?(params)
158
+ def store_action?(params)
159
159
  params[:transaction_type] == 'store'
160
160
  end
161
161
 
@@ -295,7 +295,7 @@ module ActiveMerchant
295
295
  end
296
296
 
297
297
  def endpoint(params)
298
- is_store_action?(params) ? '/transactions/tokens' : '/transactions'
298
+ store_action?(params) ? '/transactions/tokens' : '/transactions'
299
299
  end
300
300
 
301
301
  def api_request(url, params)
@@ -373,7 +373,7 @@ module ActiveMerchant
373
373
  end
374
374
 
375
375
  def authorization_from(params, response)
376
- if is_store_action?(params)
376
+ if store_action?(params)
377
377
  if success_from(response)
378
378
  [
379
379
  response['token']['type'],
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  authorize: '3',
26
26
  cancel: '4',
27
27
  failure: '5',
28
- capture: '6',
28
+ capture: '6'
29
29
  }
30
30
 
31
31
  SOAP_ACTIONS = {
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
36
36
  credit: { name: 'Credit5', url: 'pxorder/pxorder.asmx', xmlns: 'http://external.payex.com/PxOrder/' },
37
37
  create_agreement: { name: 'CreateAgreement3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
38
38
  delete_agreement: { name: 'DeleteAgreement', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
39
- autopay: { name: 'AutoPay3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' },
39
+ autopay: { name: 'AutoPay3', url: 'pxagreement/pxagreement.asmx', xmlns: 'http://external.payex.com/PxAgreement/' }
40
40
  }
41
41
 
42
42
  def initialize(options = {})
@@ -231,7 +231,7 @@ module ActiveMerchant #:nodoc:
231
231
  description: options[:description] || options[:order_id],
232
232
  orderId: options[:order_id],
233
233
  purchaseOperation: is_auth ? 'AUTHORIZATION' : 'SALE',
234
- currency: (options[:currency] || default_currency),
234
+ currency: (options[:currency] || default_currency)
235
235
  }
236
236
  hash_fields = %i[accountNumber agreementRef price productNumber description orderId purchaseOperation currency]
237
237
  add_request_hash(properties, hash_fields)
@@ -278,7 +278,7 @@ module ActiveMerchant #:nodoc:
278
278
  def send_cancel(transaction_number)
279
279
  properties = {
280
280
  accountNumber: @options[:account],
281
- transactionNumber: transaction_number,
281
+ transactionNumber: transaction_number
282
282
  }
283
283
  hash_fields = %i[accountNumber transactionNumber]
284
284
  add_request_hash(properties, hash_fields)
@@ -310,7 +310,7 @@ module ActiveMerchant #:nodoc:
310
310
  def send_delete_agreement(authorization)
311
311
  properties = {
312
312
  accountNumber: @options[:account],
313
- agreementRef: authorization,
313
+ agreementRef: authorization
314
314
  }
315
315
  hash_fields = %i[accountNumber agreementRef]
316
316
  add_request_hash(properties, hash_fields)
@@ -154,6 +154,7 @@ module ActiveMerchant #:nodoc:
154
154
  end
155
155
  end
156
156
  end
157
+ xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
157
158
  end
158
159
  xml.target!
159
160
  end
@@ -187,6 +188,7 @@ module ActiveMerchant #:nodoc:
187
188
  add_credit_card(xml, credit_card, options)
188
189
  end
189
190
  end
191
+ xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
190
192
  end
191
193
  add_level_two_three_fields(xml.target!, options)
192
194
  end
@@ -250,6 +252,7 @@ module ActiveMerchant #:nodoc:
250
252
  end
251
253
  end
252
254
  end
255
+ xml.tag! 'ExtData', 'Name' => 'BUTTONSOURCE', 'Value' => application_id unless application_id.blank?
253
256
  end
254
257
  add_level_two_three_fields(xml.target!, options)
255
258
  end
@@ -42,7 +42,7 @@ module ActiveMerchant #:nodoc:
42
42
  discover: 'Discover',
43
43
  american_express: 'Amex',
44
44
  jcb: 'JCB',
45
- diners_club: 'DinersClub',
45
+ diners_club: 'DinersClub'
46
46
  }
47
47
 
48
48
  TRANSACTIONS = {
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
35
35
  'state' => @params['state'],
36
36
  'country' => @params['country'],
37
37
  'zip' => @params['zip'],
38
- 'phone' => phone, }
38
+ 'phone' => phone }
39
39
  end
40
40
  end
41
41
  end
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
113
113
  parsed = JSON.parse(raw_response)
114
114
  options = {
115
115
  authorization: authorization_from(parsed),
116
- test: (parsed['mode'] == 'test'),
116
+ test: (parsed['mode'] == 'test')
117
117
  }
118
118
 
119
119
  succeeded = (parsed['data'] == []) || (parsed['data']['response_code'].to_i == 20000)
@@ -357,10 +357,10 @@ module ActiveMerchant #:nodoc:
357
357
 
358
358
  def handle_response_correct_parsing
359
359
  @message = parsed['transaction']['processing']['return']['message']
360
- @options[:authorization] = parsed['transaction']['identification']['uniqueId'] if @succeeded = is_ack?
360
+ @options[:authorization] = parsed['transaction']['identification']['uniqueId'] if @succeeded = ack?
361
361
  end
362
362
 
363
- def is_ack?
363
+ def ack?
364
364
  parsed['transaction']['processing']['result'] == 'ACK'
365
365
  end
366
366
  end
@@ -391,11 +391,14 @@ module ActiveMerchant #:nodoc:
391
391
  else
392
392
  if response['transactionResponse']
393
393
  response_message = response['transactionResponse']['responseMessage']
394
+
394
395
  response_code = response['transactionResponse']['responseCode'] || response['transactionResponse']['pendingReason']
396
+
397
+ response_message = response_code + ' | ' + response['transactionResponse']['paymentNetworkResponseErrorMessage'] unless response['transactionResponse']['paymentNetworkResponseErrorMessage'].nil?
395
398
  end
396
399
  return response_code if success
397
400
 
398
- response['error'] || response_message || response_code || 'FAILED'
401
+ response_message || response['error'] || response_code || 'FAILED'
399
402
  end
400
403
  end
401
404
 
@@ -31,7 +31,7 @@ module ActiveMerchant
31
31
  'W' => '9-digit zip/postal code matches billing information, street address does not',
32
32
  'X' => 'Street address and 9-digit zip/postal code matches billing information',
33
33
  'Y' => 'Street address and 5-digit zip/postal code matches billing information',
34
- 'Z' => '5-digit zip/postal code matches billing information, street address does not',
34
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not'
35
35
  }
36
36
 
37
37
  AVS_ERRORS = %w(A E N R W Z)
@@ -163,7 +163,7 @@ module ActiveMerchant #:nodoc:
163
163
  SubTotal: amount(money),
164
164
  Tax1: options[:tax1],
165
165
  Tax2: options[:tax2],
166
- ShippingTotal: options[:shipping_total],
166
+ ShippingTotal: options[:shipping_total]
167
167
  }
168
168
 
169
169
  if creditcard
@@ -20,7 +20,7 @@ module ActiveMerchant #:nodoc:
20
20
  purchase: 'CustomerCreditCardCharge',
21
21
  refund: 'CustomerCreditCardTxnVoidOrRefund',
22
22
  void: 'CustomerCreditCardTxnVoid',
23
- query: 'MerchantAccountQuery',
23
+ query: 'MerchantAccountQuery'
24
24
  }
25
25
 
26
26
  # Creates a new QbmsGateway
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
168
168
  if status_code != 0
169
169
  return {
170
170
  status_code: status_code,
171
- status_message: signon.attributes['statusMessage'],
171
+ status_message: signon.attributes['statusMessage']
172
172
  }
173
173
  end
174
174
 
@@ -176,7 +176,7 @@ module ActiveMerchant #:nodoc:
176
176
 
177
177
  results = {
178
178
  status_code: response.attributes['statusCode'].to_i,
179
- status_message: response.attributes['statusMessage'],
179
+ status_message: response.attributes['statusMessage']
180
180
  }
181
181
 
182
182
  response.elements.each do |e|
@@ -151,8 +151,9 @@ module ActiveMerchant #:nodoc:
151
151
  if address = options[:billing_address] || options[:address]
152
152
  card_address[:streetAddress] = address[:address1]
153
153
  card_address[:city] = address[:city]
154
- card_address[:region] = address[:state] || address[:region]
155
- card_address[:country] = address[:country]
154
+ region = address[:state] || address[:region]
155
+ card_address[:region] = region if region.present?
156
+ card_address[:country] = address[:country] if address[:country].present?
156
157
  card_address[:postalCode] = address[:zip] if address[:zip]
157
158
  end
158
159
  post[:card][:address] = card_address
@@ -280,7 +280,7 @@ module ActiveMerchant #:nodoc:
280
280
  '12' => STANDARD_ERROR_CODE[:card_declined],
281
281
  '06' => STANDARD_ERROR_CODE[:processing_error],
282
282
  '01' => STANDARD_ERROR_CODE[:call_issuer],
283
- '04' => STANDARD_ERROR_CODE[:pickup_card],
283
+ '04' => STANDARD_ERROR_CODE[:pickup_card]
284
284
  }
285
285
 
286
286
  def error_code_from(succeeded, response)
@@ -316,6 +316,7 @@ module ActiveMerchant
316
316
  else
317
317
  xml.tag! 'cavv', three_d_secure[:cavv]
318
318
  xml.tag! 'xid', three_d_secure[:xid]
319
+ version = '1'
319
320
  end
320
321
  xml.tag! 'eci', three_d_secure[:eci]
321
322
  xml.tag! 'message_version', version
@@ -476,7 +476,7 @@ module ActiveMerchant #:nodoc:
476
476
  if validate_signature(params)
477
477
  message = response_text(params[:ds_response])
478
478
  options[:authorization] = build_authorization(params)
479
- success = is_success_response?(params[:ds_response])
479
+ success = success_response?(params[:ds_response])
480
480
  else
481
481
  message = 'Response failed validation check'
482
482
  end
@@ -490,7 +490,7 @@ module ActiveMerchant #:nodoc:
490
490
  end
491
491
  message = response_text_3ds(xml, params)
492
492
  options[:authorization] = build_authorization(params)
493
- success = params.size > 0 && is_success_response?(params[:ds_response])
493
+ success = params.size > 0 && success_response?(params[:ds_response])
494
494
  else
495
495
  # Some kind of programmer error with the request!
496
496
  message = "#{code} ERROR"
@@ -559,7 +559,7 @@ module ActiveMerchant #:nodoc:
559
559
  message
560
560
  end
561
561
 
562
- def is_success_response?(code)
562
+ def success_response?(code)
563
563
  (code.to_i < 100) || [400, 481, 500, 900].include?(code.to_i)
564
564
  end
565
565