activemerchant 1.100.0 → 1.101.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +10 -0
  3. data/lib/active_merchant/billing/check.rb +2 -6
  4. data/lib/active_merchant/billing/credit_card.rb +1 -3
  5. data/lib/active_merchant/billing/gateway.rb +4 -7
  6. data/lib/active_merchant/billing/gateways/authorize_net.rb +3 -9
  7. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +1 -3
  8. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +4 -12
  9. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -3
  10. data/lib/active_merchant/billing/gateways/balanced.rb +12 -11
  11. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -6
  12. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -3
  13. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -21
  14. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -3
  15. data/lib/active_merchant/billing/gateways/checkout.rb +1 -3
  16. data/lib/active_merchant/billing/gateways/checkout_v2.rb +1 -3
  17. data/lib/active_merchant/billing/gateways/clearhaus.rb +9 -12
  18. data/lib/active_merchant/billing/gateways/credorax.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/culqi.rb +6 -5
  20. data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -0
  21. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -3
  22. data/lib/active_merchant/billing/gateways/decidir.rb +1 -3
  23. data/lib/active_merchant/billing/gateways/ebanx.rb +1 -3
  24. data/lib/active_merchant/billing/gateways/elavon.rb +2 -6
  25. data/lib/active_merchant/billing/gateways/element.rb +1 -3
  26. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -5
  27. data/lib/active_merchant/billing/gateways/fat_zebra.rb +7 -6
  28. data/lib/active_merchant/billing/gateways/forte.rb +2 -6
  29. data/lib/active_merchant/billing/gateways/garanti.rb +1 -3
  30. data/lib/active_merchant/billing/gateways/global_collect.rb +1 -3
  31. data/lib/active_merchant/billing/gateways/hdfc.rb +1 -3
  32. data/lib/active_merchant/billing/gateways/hps.rb +6 -5
  33. data/lib/active_merchant/billing/gateways/inspire.rb +2 -6
  34. data/lib/active_merchant/billing/gateways/instapay.rb +1 -3
  35. data/lib/active_merchant/billing/gateways/iridium.rb +1 -3
  36. data/lib/active_merchant/billing/gateways/iveri.rb +7 -8
  37. data/lib/active_merchant/billing/gateways/jetpay.rb +3 -9
  38. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -6
  39. data/lib/active_merchant/billing/gateways/kushki.rb +7 -8
  40. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +6 -5
  41. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -3
  42. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -3
  43. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +1 -3
  44. data/lib/active_merchant/billing/gateways/mercury.rb +2 -6
  45. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -12
  46. data/lib/active_merchant/billing/gateways/migs.rb +1 -3
  47. data/lib/active_merchant/billing/gateways/moneris.rb +1 -3
  48. data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -3
  49. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -3
  50. data/lib/active_merchant/billing/gateways/netbanx.rb +24 -9
  51. data/lib/active_merchant/billing/gateways/netbilling.rb +1 -3
  52. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -3
  53. data/lib/active_merchant/billing/gateways/opp.rb +12 -13
  54. data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -3
  55. data/lib/active_merchant/billing/gateways/orbital.rb +8 -11
  56. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -3
  57. data/lib/active_merchant/billing/gateways/pagarme.rb +4 -12
  58. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -3
  59. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -3
  60. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +1 -3
  61. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +6 -5
  62. data/lib/active_merchant/billing/gateways/payflow.rb +2 -6
  63. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -3
  64. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -3
  65. data/lib/active_merchant/billing/gateways/paymill.rb +1 -3
  66. data/lib/active_merchant/billing/gateways/pro_pay.rb +1 -3
  67. data/lib/active_merchant/billing/gateways/quickbooks.rb +104 -31
  68. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +2 -6
  69. data/lib/active_merchant/billing/gateways/realex.rb +1 -3
  70. data/lib/active_merchant/billing/gateways/redsys.rb +17 -27
  71. data/lib/active_merchant/billing/gateways/safe_charge.rb +1 -3
  72. data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -3
  73. data/lib/active_merchant/billing/gateways/secure_net.rb +2 -6
  74. data/lib/active_merchant/billing/gateways/secure_pay.rb +4 -12
  75. data/lib/active_merchant/billing/gateways/smart_ps.rb +2 -6
  76. data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -6
  77. data/lib/active_merchant/billing/gateways/stripe.rb +3 -9
  78. data/lib/active_merchant/billing/gateways/telr.rb +2 -6
  79. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +6 -5
  80. data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -3
  81. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -3
  82. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +4 -12
  83. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -9
  84. data/lib/active_merchant/billing/gateways/viaklix.rb +2 -6
  85. data/lib/active_merchant/billing/gateways/wepay.rb +2 -6
  86. data/lib/active_merchant/billing/gateways/wirecard.rb +2 -6
  87. data/lib/active_merchant/billing/gateways/worldpay.rb +5 -15
  88. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +2 -6
  89. data/lib/active_merchant/version.rb +1 -1
  90. data/lib/support/ssl_verify.rb +1 -3
  91. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 823ed7b22c50e7910c846fe99b621d38589cc4ae2b01825219a344d08dee0024
4
- data.tar.gz: 8cc6c8294cb70df4df71e805b7d9b336237540ada7e4867388eba7677ba37641
3
+ metadata.gz: cadecd1cc8fe450e59061eac7cf2c2ce023513d1338858809fe828df46a1b745
4
+ data.tar.gz: cc7e81f49b5b4b0f17cbd73c921a7b73cbd4c8f468d70722dc844a4973191ffa
5
5
  SHA512:
6
- metadata.gz: 85b8024522112e07fd028f1331574ce47c4a7e343d8a92906d043f2448f4c656723151202f53de0f49627a4d5815fbda5d7ab81274268dd1cd2decf61b8b69bf
7
- data.tar.gz: ce6135c3bd5c0c6985b60083abde4eef4a8bec4fb75c857ddb49a1a10d60608821ccca6337a7928d649b5fef7f847a191658db62004ec225c36b48e7ed9719c7
6
+ metadata.gz: 4d3889d6325099cff6ffef0dc9de3259afac3ff6d86292cd5dfa9e85208e9eae671436222ec84e08ad1104e77ede4ab475519229f5121c61498f79adaf7da104
7
+ data.tar.gz: 3e0b7935750ab8d772d62d78d6c359187d287835e997076ba0a1d66a3586424e63897892a736cbf7b720aa7e04633112aca6fb4cad57a8bcbee2885f13701ea7
data/CHANGELOG CHANGED
@@ -1,6 +1,16 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
3
  == HEAD
4
+ == Version 1.101.0 (Nov 4, 2019)
5
+ * Add UYI to list of currencies without fractions [curiousepic] #3416
6
+ * Quickbooks: Add OAuth 2.0 support and void action [britth] #3397
7
+ * Credorax: Stop always sending r1 parameter [molbrown] #3415
8
+ * Rubocop: Layout/RescueEnsureAlignment fix [leila-alderman] #3411
9
+ * CyberSource: Send issuer data on capture [leila-alderman] #3404
10
+ * Rubocop: Style/IfUnlessModifier [nfarve] #3390
11
+ * Redsys: Updates to parse method for non-3DS responses [britth] #3391
12
+ * Netbanx: Add 3DS2 Support [Jujhar] #3394
13
+
4
14
  == Version 1.100.0 (Oct 16, 2019)
5
15
  * Stripe: Restore non-auto capture behaviour for card present transactions [PatrickFang] #3258
6
16
  * Revert "Revert "Worldpay: Switch to Nokogiri"" [curiousepic] #3373
@@ -35,13 +35,9 @@ module ActiveMerchant #:nodoc:
35
35
 
36
36
  errors << [:routing_number, 'is invalid'] unless valid_routing_number?
37
37
 
38
- if(!empty?(account_holder_type) && !%w[business personal].include?(account_holder_type.to_s))
39
- errors << [:account_holder_type, 'must be personal or business']
40
- end
38
+ errors << [:account_holder_type, 'must be personal or business'] if !empty?(account_holder_type) && !%w[business personal].include?(account_holder_type.to_s)
41
39
 
42
- if(!empty?(account_type) && !%w[checking savings].include?(account_type.to_s))
43
- errors << [:account_type, 'must be checking or savings']
44
- end
40
+ errors << [:account_type, 'must be checking or savings'] if !empty?(account_type) && !%w[checking savings].include?(account_type.to_s)
45
41
 
46
42
  errors_hash(errors)
47
43
  end
@@ -367,9 +367,7 @@ module ActiveMerchant #:nodoc:
367
367
  errors = []
368
368
 
369
369
  if verification_value?
370
- unless valid_card_verification_value?(verification_value, brand)
371
- errors << [:verification_value, "should be #{card_verification_value_length(brand)} digits"]
372
- end
370
+ errors << [:verification_value, "should be #{card_verification_value_length(brand)} digits"] unless valid_card_verification_value?(verification_value, brand)
373
371
  elsif requires_verification_value? && !valid_card_verification_value?(verification_value, brand)
374
372
  errors << [:verification_value, 'is required']
375
373
  end
@@ -123,8 +123,9 @@ module ActiveMerchant #:nodoc:
123
123
  class_attribute :supported_cardtypes
124
124
  self.supported_cardtypes = []
125
125
 
126
+ # This default list of currencies without fractions are from https://en.wikipedia.org/wiki/ISO_4217
126
127
  class_attribute :currencies_without_fractions, :currencies_with_three_decimal_places
127
- self.currencies_without_fractions = %w(BIF BYR CLP CVE DJF GNF ISK JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
128
+ self.currencies_without_fractions = %w(BIF BYR CLP CVE DJF GNF ISK JPY KMF KRW PYG RWF UGX UYI VND VUV XAF XOF XPF)
128
129
  self.currencies_with_three_decimal_places = %w()
129
130
 
130
131
  class_attribute :homepage_url
@@ -155,9 +156,7 @@ module ActiveMerchant #:nodoc:
155
156
 
156
157
  def self.supported_countries=(country_codes)
157
158
  country_codes.each do |country_code|
158
- unless ActiveMerchant::Country.find(country_code)
159
- raise ActiveMerchant::InvalidCountryCodeError, "No country could be found for the country #{country_code}"
160
- end
159
+ raise ActiveMerchant::InvalidCountryCodeError, "No country could be found for the country #{country_code}" unless ActiveMerchant::Country.find(country_code)
161
160
  end
162
161
  @supported_countries = country_codes.dup
163
162
  end
@@ -257,9 +256,7 @@ module ActiveMerchant #:nodoc:
257
256
  money
258
257
  end
259
258
 
260
- if money.is_a?(String)
261
- raise ArgumentError, 'money amount must be a positive Integer in cents.'
262
- end
259
+ raise ArgumentError, 'money amount must be a positive Integer in cents.' if money.is_a?(String)
263
260
 
264
261
  if self.money_format == :cents
265
262
  cents.to_s
@@ -157,9 +157,7 @@ module ActiveMerchant
157
157
  end
158
158
 
159
159
  def credit(amount, payment, options={})
160
- if payment.is_a?(String)
161
- raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card or use the #refund method.'
162
- end
160
+ raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card or use the #refund method.' if payment.is_a?(String)
163
161
 
164
162
  commit(:credit) do |xml|
165
163
  add_order_id(xml, options)
@@ -479,12 +477,8 @@ module ActiveMerchant
479
477
  xml.creditCard do
480
478
  xml.cardNumber(truncate(credit_card.number, 16))
481
479
  xml.expirationDate(format(credit_card.month, :two_digits) + '/' + format(credit_card.year, :four_digits))
482
- if credit_card.valid_card_verification_value?(credit_card.verification_value, credit_card.brand)
483
- xml.cardCode(credit_card.verification_value)
484
- end
485
- if credit_card.is_a?(NetworkTokenizationCreditCard) && action != :credit
486
- xml.cryptogram(credit_card.payment_cryptogram)
487
- end
480
+ xml.cardCode(credit_card.verification_value) if credit_card.valid_card_verification_value?(credit_card.verification_value, credit_card.brand)
481
+ xml.cryptogram(credit_card.payment_cryptogram) if credit_card.is_a?(NetworkTokenizationCreditCard) && action != :credit
488
482
  end
489
483
  end
490
484
  end
@@ -147,9 +147,7 @@ module ActiveMerchant #:nodoc:
147
147
 
148
148
  # Builds recurring billing request
149
149
  def build_recurring_request(action, options = {})
150
- unless RECURRING_ACTIONS.include?(action)
151
- raise StandardError, "Invalid Automated Recurring Billing Action: #{action}"
152
- end
150
+ raise StandardError, "Invalid Automated Recurring Billing Action: #{action}" unless RECURRING_ACTIONS.include?(action)
153
151
 
154
152
  xml = Builder::XmlMarkup.new(:indent => 2)
155
153
  xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
@@ -485,9 +485,7 @@ module ActiveMerchant #:nodoc:
485
485
  end
486
486
 
487
487
  def build_request(action, options = {})
488
- unless CIM_ACTIONS.include?(action)
489
- raise StandardError, "Invalid Customer Information Manager Action: #{action}"
490
- end
488
+ raise StandardError, "Invalid Customer Information Manager Action: #{action}" unless CIM_ACTIONS.include?(action)
491
489
 
492
490
  xml = Builder::XmlMarkup.new(:indent => 2)
493
491
  xml.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
@@ -657,9 +655,7 @@ module ActiveMerchant #:nodoc:
657
655
  end
658
656
 
659
657
  def add_transaction(xml, transaction)
660
- unless CIM_TRANSACTION_TYPES.include?(transaction[:type])
661
- raise StandardError, "Invalid Customer Information Manager Transaction Type: #{transaction[:type]}"
662
- end
658
+ raise StandardError, "Invalid Customer Information Manager Transaction Type: #{transaction[:type]}" unless CIM_TRANSACTION_TYPES.include?(transaction[:type])
663
659
 
664
660
  xml.tag!('transaction') do
665
661
  xml.tag!(CIM_TRANSACTION_TYPES[transaction[:type]]) do
@@ -698,9 +694,7 @@ module ActiveMerchant #:nodoc:
698
694
  if [:auth_capture, :auth_only, :capture_only].include?(transaction[:type])
699
695
  xml.tag!('recurringBilling', transaction[:recurring_billing]) if transaction.has_key?(:recurring_billing)
700
696
  end
701
- unless [:void, :refund, :prior_auth_capture].include?(transaction[:type])
702
- tag_unless_blank(xml, 'cardCode', transaction[:card_code])
703
- end
697
+ tag_unless_blank(xml, 'cardCode', transaction[:card_code]) unless [:void, :refund, :prior_auth_capture].include?(transaction[:type])
704
698
  end
705
699
  end
706
700
  end
@@ -942,9 +936,7 @@ module ActiveMerchant #:nodoc:
942
936
  xml = REXML::Document.new(xml)
943
937
  root = REXML::XPath.first(xml, "//#{CIM_ACTIONS[action]}Response") ||
944
938
  REXML::XPath.first(xml, '//ErrorResponse')
945
- if root
946
- response = parse_element(root)
947
- end
939
+ response = parse_element(root) if root
948
940
 
949
941
  response
950
942
  end
@@ -93,9 +93,7 @@ module ActiveMerchant #:nodoc:
93
93
  end
94
94
 
95
95
  def parse_element(response, node)
96
- if node.has_attributes?
97
- node.attributes.each { |name, value| response["#{node.name}_#{name}".underscore.to_sym] = value }
98
- end
96
+ node.attributes.each { |name, value| response["#{node.name}_#{name}".underscore.to_sym] = value } if node.has_attributes?
99
97
 
100
98
  if node.has_elements?
101
99
  node.elements.each { |element| parse_element(response, element) }
@@ -155,17 +155,18 @@ module ActiveMerchant #:nodoc:
155
155
  end
156
156
 
157
157
  def commit(entity_name, path, post, method=:post)
158
- raw_response = begin
159
- parse(ssl_request(
160
- method,
161
- live_url + "/#{path}",
162
- post_data(post),
163
- headers
164
- ))
165
- rescue ResponseError => e
166
- raise unless(e.response.code.to_s =~ /4\d\d/)
167
- parse(e.response.body)
168
- end
158
+ raw_response =
159
+ begin
160
+ parse(ssl_request(
161
+ method,
162
+ live_url + "/#{path}",
163
+ post_data(post),
164
+ headers
165
+ ))
166
+ rescue ResponseError => e
167
+ raise unless(e.response.code.to_s =~ /4\d\d/)
168
+ parse(e.response.body)
169
+ end
169
170
 
170
171
  Response.new(
171
172
  success_from(entity_name, raw_response),
@@ -351,9 +351,7 @@ module ActiveMerchant #:nodoc:
351
351
  # The bp20api has max one value per form field.
352
352
  response_fields = Hash[CGI::parse(body).map { |k, v| [k.upcase, v.first] }]
353
353
 
354
- if response_fields.include? 'REBILL_ID'
355
- return parse_recurring(response_fields)
356
- end
354
+ return parse_recurring(response_fields) if response_fields.include? 'REBILL_ID'
357
355
 
358
356
  parsed = {}
359
357
  response_fields.each do |k, v|
@@ -514,9 +512,7 @@ module ActiveMerchant #:nodoc:
514
512
  end
515
513
 
516
514
  def handle_response(response)
517
- if ignore_http_status || (200...300).cover?(response.code.to_i)
518
- return response.body
519
- end
515
+ return response.body if ignore_http_status || (200...300).cover?(response.code.to_i)
520
516
  raise ResponseError.new(response)
521
517
  end
522
518
  end
@@ -307,9 +307,7 @@ module ActiveMerchant
307
307
  vaulted_shopper_id = payment_method_details.vaulted_shopper_id
308
308
  doc.send('vaulted-shopper-id', vaulted_shopper_id) if vaulted_shopper_id
309
309
 
310
- if payment_method_details.check?
311
- add_echeck_transaction(doc, payment_method_details.payment_method, options, vaulted_shopper_id.present?)
312
- end
310
+ add_echeck_transaction(doc, payment_method_details.payment_method, options, vaulted_shopper_id.present?) if payment_method_details.check?
313
311
 
314
312
  add_fraud_info(doc, options)
315
313
  add_description(doc, options)
@@ -6,9 +6,7 @@ rescue LoadError
6
6
  raise 'Could not load the braintree gem. Use `gem install braintree` to install it.'
7
7
  end
8
8
 
9
- unless Braintree::Version::Major == 2 && Braintree::Version::Minor >= 78
10
- raise "Need braintree gem >= 2.78.0. Run `gem install braintree --version '~>2.78'` to get the correct version."
11
- end
9
+ raise "Need braintree gem >= 2.78.0. Run `gem install braintree --version '~>2.78'` to get the correct version." unless Braintree::Version::Major == 2 && Braintree::Version::Minor >= 78
12
10
 
13
11
  module ActiveMerchant #:nodoc:
14
12
  module Billing #:nodoc:
@@ -302,9 +300,7 @@ module ActiveMerchant #:nodoc:
302
300
  valid_options[key] = value if [:update_existing_token, :verify_card, :verification_merchant_account_id].include?(key)
303
301
  end
304
302
 
305
- if valid_options.include?(:verify_card) && @merchant_account_id
306
- valid_options[:verification_merchant_account_id] ||= @merchant_account_id
307
- end
303
+ valid_options[:verification_merchant_account_id] ||= @merchant_account_id if valid_options.include?(:verify_card) && @merchant_account_id
308
304
 
309
305
  parameters[:credit_card] ||= {}
310
306
  parameters[:credit_card][:options] = valid_options
@@ -328,9 +324,7 @@ module ActiveMerchant #:nodoc:
328
324
  mapped[:country_code_alpha2] = (address[:country] || address[:country_code_alpha2]) if address[:country] || address[:country_code_alpha2]
329
325
  mapped[:country_name] = address[:country_name] if address[:country_name]
330
326
  mapped[:country_code_alpha3] = address[:country_code_alpha3] if address[:country_code_alpha3]
331
- unless address[:country].blank?
332
- mapped[:country_code_alpha3] ||= Country.find(address[:country]).code(:alpha3).value
333
- end
327
+ mapped[:country_code_alpha3] ||= Country.find(address[:country]).code(:alpha3).value unless address[:country].blank?
334
328
  mapped[:country_code_numeric] = address[:country_code_numeric] if address[:country_code_numeric]
335
329
 
336
330
  mapped
@@ -494,9 +488,7 @@ module ActiveMerchant #:nodoc:
494
488
  end
495
489
 
496
490
  def transaction_hash(result)
497
- unless result.success?
498
- return { 'processor_response_code' => response_code_from_result(result) }
499
- end
491
+ return { 'processor_response_code' => response_code_from_result(result) } unless result.success?
500
492
 
501
493
  transaction = result.transaction
502
494
  if transaction.vault_customer
@@ -588,17 +580,11 @@ module ActiveMerchant #:nodoc:
588
580
  }
589
581
  }
590
582
 
591
- if options[:skip_advanced_fraud_checking]
592
- parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking]
593
- end
583
+ parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
594
584
 
595
- if options[:skip_avs]
596
- parameters[:options][:skip_avs] = options[:skip_avs]
597
- end
585
+ parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
598
586
 
599
- if options[:skip_cvv]
600
- parameters[:options][:skip_cvv] = options[:skip_cvv]
601
- end
587
+ parameters[:options][:skip_cvv] = options[:skip_cvv] if options[:skip_cvv]
602
588
 
603
589
  parameters[:custom_fields] = options[:custom_fields]
604
590
  parameters[:device_data] = options[:device_data] if options[:device_data]
@@ -143,9 +143,7 @@ module ActiveMerchant #:nodoc:
143
143
  response[:error_message] = root.elements['ERROR/descripcion'].text
144
144
  else
145
145
  if root.elements['OPERACION'].attributes['numeroOperacion'] == '000'
146
- if(root.elements['OPERACION/numeroAutorizacion'])
147
- response[:authorization] = root.elements['OPERACION/numeroAutorizacion'].text
148
- end
146
+ response[:authorization] = root.elements['OPERACION/numeroAutorizacion'].text if root.elements['OPERACION/numeroAutorizacion']
149
147
  else
150
148
  response[:authorization] = root.attributes['numeroOperacion']
151
149
  end
@@ -107,9 +107,7 @@ module ActiveMerchant #:nodoc:
107
107
  xml.bill_cc_ payment_method.number
108
108
  xml.bill_expmonth_ format(payment_method.month, :two_digits)
109
109
  xml.bill_expyear_ format(payment_method.year, :four_digits)
110
- if payment_method.verification_value?
111
- xml.bill_cvv2_ payment_method.verification_value
112
- end
110
+ xml.bill_cvv2_ payment_method.verification_value if payment_method.verification_value?
113
111
  end
114
112
 
115
113
  def add_billing_info(xml, options)
@@ -152,9 +152,7 @@ module ActiveMerchant #:nodoc:
152
152
  begin
153
153
  raw_response = (action == :verify_payment ? ssl_get("#{base_url}/payments/#{post}", headers) : ssl_post(url(post, action, authorization), post.to_json, headers))
154
154
  response = parse(raw_response)
155
- if action == :capture && response.key?('_links')
156
- response['id'] = response['_links']['payment']['href'].split('/')[-1]
157
- end
155
+ response['id'] = response['_links']['payment']['href'].split('/')[-1] if action == :capture && response.key?('_links')
158
156
  rescue ResponseError => e
159
157
  raise unless e.response.code.to_s =~ /4\d\d/
160
158
  response = parse(e.response.body)
@@ -130,9 +130,7 @@ module ActiveMerchant #:nodoc:
130
130
  card[:expire_month] = '%02d'% payment.month
131
131
  card[:expire_year] = payment.year
132
132
 
133
- if payment.verification_value?
134
- card[:csc] = payment.verification_value
135
- end
133
+ card[:csc] = payment.verification_value if payment.verification_value?
136
134
 
137
135
  post[:card] = card if card.any?
138
136
  end
@@ -161,12 +159,13 @@ module ActiveMerchant #:nodoc:
161
159
  end
162
160
  end
163
161
 
164
- response = begin
165
- parse(ssl_post(url, body, headers))
166
- rescue ResponseError => e
167
- raise unless(e.response.code.to_s =~ /400/)
168
- parse(e.response.body)
169
- end
162
+ response =
163
+ begin
164
+ parse(ssl_post(url, body, headers))
165
+ rescue ResponseError => e
166
+ raise unless(e.response.code.to_s =~ /400/)
167
+ parse(e.response.body)
168
+ end
170
169
 
171
170
  Response.new(
172
171
  success_from(response),
@@ -211,9 +210,7 @@ module ActiveMerchant #:nodoc:
211
210
  end
212
211
 
213
212
  def error_code_from(response)
214
- unless success_from(response)
215
- response['status']['code']
216
- end
213
+ response['status']['code'] unless success_from(response)
217
214
  end
218
215
  end
219
216
  end
@@ -358,7 +358,7 @@ module ActiveMerchant #:nodoc:
358
358
  end
359
359
 
360
360
  def add_processor(post, options)
361
- post[:r1] = options[:processor] || 'CREDORAX'
361
+ post[:r1] = options[:processor] if options[:processor]
362
362
  post[:r2] = options[:processor_merchant_id] if options[:processor_merchant_id]
363
363
  end
364
364
 
@@ -208,11 +208,12 @@ module ActiveMerchant #:nodoc:
208
208
  }
209
209
 
210
210
  def commit(action, params)
211
- response = begin
212
- parse(ssl_post(url + ACTIONS[action], post_data(action, params), headers))
213
- rescue ResponseError => e
214
- parse(e.response.body)
215
- end
211
+ response =
212
+ begin
213
+ parse(ssl_post(url + ACTIONS[action], post_data(action, params), headers))
214
+ rescue ResponseError => e
215
+ parse(e.response.body)
216
+ end
216
217
 
217
218
  success = success_from(response)
218
219
 
@@ -290,6 +290,7 @@ module ActiveMerchant #:nodoc:
290
290
  add_purchase_data(xml, money, true, options)
291
291
  add_capture_service(xml, request_id, request_token)
292
292
  add_business_rules_data(xml, authorization, options)
293
+ add_issuer_additional_data(xml, options)
293
294
  xml.target!
294
295
  end
295
296
 
@@ -123,9 +123,7 @@ module ActiveMerchant
123
123
  add_authentication(xml)
124
124
 
125
125
  xml.tag! :Transaction do
126
- if options[:set_up_continuous_authority]
127
- xml.tag! :ContAuthTxn, :type => 'setup'
128
- end
126
+ xml.tag! :ContAuthTxn, :type => 'setup' if options[:set_up_continuous_authority]
129
127
  xml.tag! :CardTxn do
130
128
  xml.tag! :method, type
131
129
  add_credit_card(xml, credit_card, options[:billing_address])
@@ -211,9 +211,7 @@ module ActiveMerchant #:nodoc:
211
211
  if error = response.dig('status_details', 'error')
212
212
  message = error.dig('reason', 'description')
213
213
  elsif response['error_type']
214
- if response['validation_errors']
215
- message = response['validation_errors'].map { |errors| "#{errors['code']}: #{errors['param']}" }.join(', ')
216
- end
214
+ message = response['validation_errors'].map { |errors| "#{errors['code']}: #{errors['param']}" }.join(', ') if response['validation_errors']
217
215
  message ||= response['error_type']
218
216
  end
219
217