activemerchant 1.112.0 → 1.113.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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +17 -0
  3. data/lib/active_merchant/billing/credit_card.rb +1 -1
  4. data/lib/active_merchant/billing/credit_card_methods.rb +1 -1
  5. data/lib/active_merchant/billing/gateway.rb +1 -1
  6. data/lib/active_merchant/billing/gateways/adyen.rb +2 -2
  7. data/lib/active_merchant/billing/gateways/authorize_net.rb +6 -6
  8. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
  9. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/bambora_apac.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/bank_frick.rb +1 -1
  12. data/lib/active_merchant/billing/gateways/blue_snap.rb +49 -12
  13. data/lib/active_merchant/billing/gateways/borgun.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -7
  15. data/lib/active_merchant/billing/gateways/cardknox.rb +1 -1
  16. data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/checkout_v2.rb +1 -1
  18. data/lib/active_merchant/billing/gateways/credorax.rb +6 -0
  19. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/cyber_source.rb +4 -2
  21. data/lib/active_merchant/billing/gateways/decidir.rb +1 -1
  22. data/lib/active_merchant/billing/gateways/digitzs.rb +1 -1
  23. data/lib/active_merchant/billing/gateways/efsnet.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  25. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/flo2cash.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/hdfc.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/hps.rb +9 -6
  29. data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
  30. data/lib/active_merchant/billing/gateways/iridium.rb +2 -2
  31. data/lib/active_merchant/billing/gateways/linkpoint.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/mastercard.rb +2 -2
  33. data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/netbanx.rb +4 -2
  35. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/opp.rb +3 -3
  37. data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -1
  38. data/lib/active_merchant/billing/gateways/orbital.rb +8 -1
  39. data/lib/active_merchant/billing/gateways/pagarme.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/payeezy.rb +3 -3
  42. data/lib/active_merchant/billing/gateways/payex.rb +5 -5
  43. data/lib/active_merchant/billing/gateways/payflow.rb +3 -0
  44. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  45. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  46. data/lib/active_merchant/billing/gateways/paymill.rb +3 -3
  47. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -1
  48. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  49. data/lib/active_merchant/billing/gateways/qbms.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/quickbooks.rb +3 -2
  51. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  52. data/lib/active_merchant/billing/gateways/redsys.rb +3 -3
  53. data/lib/active_merchant/billing/gateways/sage_pay.rb +4 -4
  54. data/lib/active_merchant/billing/gateways/skip_jack.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/stripe.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/telr.rb +1 -1
  57. data/lib/active_merchant/billing/gateways/trans_first.rb +1 -1
  58. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -2
  59. data/lib/active_merchant/billing/gateways/trust_commerce.rb +7 -7
  60. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +4 -4
  61. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  62. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  63. data/lib/active_merchant/version.rb +1 -1
  64. metadata +2 -2
@@ -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)
@@ -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
 
@@ -248,7 +248,7 @@ module ActiveMerchant #:nodoc:
248
248
  add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
249
249
  add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
250
250
  add_pair(post, :BillingCity, truncate(billing_address[:city], 40))
251
- add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if is_usa(billing_address[:country])
251
+ add_pair(post, :BillingState, truncate(billing_address[:state], 2)) if usa?(billing_address[:country])
252
252
  add_pair(post, :BillingCountry, truncate(billing_address[:country], 2))
253
253
  add_pair(post, :BillingPhone, sanitize_phone(billing_address[:phone]))
254
254
  add_pair(post, :BillingPostCode, truncate(billing_address[:zip], 10))
@@ -261,7 +261,7 @@ module ActiveMerchant #:nodoc:
261
261
  add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
262
262
  add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
263
263
  add_pair(post, :DeliveryCity, truncate(shipping_address[:city], 40))
264
- add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if is_usa(shipping_address[:country])
264
+ add_pair(post, :DeliveryState, truncate(shipping_address[:state], 2)) if usa?(shipping_address[:country])
265
265
  add_pair(post, :DeliveryCountry, truncate(shipping_address[:country], 2))
266
266
  add_pair(post, :DeliveryPhone, sanitize_phone(shipping_address[:phone]))
267
267
  add_pair(post, :DeliveryPostCode, truncate(shipping_address[:zip], 10))
@@ -317,7 +317,7 @@ module ActiveMerchant #:nodoc:
317
317
  truncate(cleansed, 20)
318
318
  end
319
319
 
320
- def is_usa(country)
320
+ def usa?(country)
321
321
  truncate(country, 2) == 'US'
322
322
  end
323
323
 
@@ -351,7 +351,7 @@ module ActiveMerchant #:nodoc:
351
351
  authorization: authorization_from(response, parameters, action),
352
352
  avs_result: {
353
353
  street_match: AVS_CODE[response['AddressResult']],
354
- postal_match: AVS_CODE[response['PostCodeResult']],
354
+ postal_match: AVS_CODE[response['PostCodeResult']]
355
355
  },
356
356
  cvv_result: CVV_CODE[response['CV2Result']]
357
357
  )
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
51
51
  'W' => '9-digit zip/postal code matches billing information, street address does not',
52
52
  'X' => 'Street address and 9-digit zip/postal code matches billing information',
53
53
  'Y' => 'Street address and 5-digit zip/postal code matches billing information',
54
- 'Z' => '5-digit zip/postal code matches billing information, street address does not',
54
+ 'Z' => '5-digit zip/postal code matches billing information, street address does not'
55
55
  }
56
56
 
57
57
  CHANGE_STATUS_ERROR_MESSAGES = {
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
 
54
54
  BANK_ACCOUNT_HOLDER_TYPE_MAPPING = {
55
55
  'personal' => 'individual',
56
- 'business' => 'company',
56
+ 'business' => 'company'
57
57
  }
58
58
 
59
59
  MINIMUM_AUTHORIZE_AMOUNTS = {
@@ -755,7 +755,7 @@ module ActiveMerchant #:nodoc:
755
755
  currency: 'usd',
756
756
  routing_number: bank_account.routing_number,
757
757
  name: bank_account.name,
758
- account_holder_type: account_holder_type,
758
+ account_holder_type: account_holder_type
759
759
  }
760
760
  }
761
761
 
@@ -17,7 +17,7 @@ module ActiveMerchant #:nodoc:
17
17
  'Y' => 'M',
18
18
  'N' => 'N',
19
19
  'X' => 'P',
20
- 'E' => 'U',
20
+ 'E' => 'U'
21
21
  }
22
22
 
23
23
  AVS_CODE_TRANSLATOR = {
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  purchase_echeck: 'ACHDebit',
19
19
  refund: 'CreditCardCredit',
20
20
  refund_echeck: 'ACHVoidTransaction',
21
- void: 'CreditCardAutoRefundorVoid',
21
+ void: 'CreditCardAutoRefundorVoid'
22
22
  }
23
23
 
24
24
  ENDPOINTS = {
@@ -152,7 +152,7 @@ module ActiveMerchant #:nodoc:
152
152
  'R1' => 'The transaction was declined or returned, because the cardholder requested that payment of all recurring or installment payment transactions for a specific merchant account be stopped/ Reserved for client-specific use (declined)',
153
153
  'Q1' => 'Card Authentication failed/ Reserved for client-specific use (declined)',
154
154
  'XA' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
155
- 'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)',
155
+ 'XD' => 'Forward to Issuer/ Reserved for client-specific use (declined)'
156
156
  }
157
157
 
158
158
  EXTENDED_RESPONSE_MESSAGES = {
@@ -179,7 +179,7 @@ module ActiveMerchant #:nodoc:
179
179
  refund_echeck: 16,
180
180
  void_echeck: 16,
181
181
 
182
- wallet_sale: 14,
182
+ wallet_sale: 14
183
183
  }
184
184
 
185
185
  def initialize(options={})
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
151
151
 
152
152
  def authorize(money, creditcard_or_billing_id, options = {})
153
153
  parameters = {
154
- amount: amount(money),
154
+ amount: amount(money)
155
155
  }
156
156
 
157
157
  add_order_id(parameters, options)
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
168
168
  # to process a purchase are an amount in cents or a money object and a creditcard object or billingid string.
169
169
  def purchase(money, creditcard_or_billing_id, options = {})
170
170
  parameters = {
171
- amount: amount(money),
171
+ amount: amount(money)
172
172
  }
173
173
 
174
174
  add_order_id(parameters, options)
@@ -188,7 +188,7 @@ module ActiveMerchant #:nodoc:
188
188
  transaction_id, = split_authorization(authorization)
189
189
  parameters = {
190
190
  amount: amount(money),
191
- transid: transaction_id,
191
+ transid: transaction_id
192
192
  }
193
193
  add_aggregator(parameters, options)
194
194
  add_custom_fields(parameters, options)
@@ -239,7 +239,7 @@ module ActiveMerchant #:nodoc:
239
239
  action = (VOIDABLE_ACTIONS - ['preauth']).include?(original_action) ? 'void' : 'reversal'
240
240
 
241
241
  parameters = {
242
- transid: transaction_id,
242
+ transid: transaction_id
243
243
  }
244
244
 
245
245
  add_aggregator(parameters, options)
@@ -285,7 +285,7 @@ module ActiveMerchant #:nodoc:
285
285
  cycle: cycle,
286
286
  verify: options[:verify] || 'y',
287
287
  billingid: options[:billingid] || nil,
288
- payments: options[:payments] || nil,
288
+ payments: options[:payments] || nil
289
289
  }
290
290
 
291
291
  add_creditcard(parameters, creditcard)
@@ -300,7 +300,7 @@ module ActiveMerchant #:nodoc:
300
300
  def store(creditcard, options = {})
301
301
  parameters = {
302
302
  verify: options[:verify] || 'y',
303
- billingid: options[:billingid] || options[:billing_id] || nil,
303
+ billingid: options[:billingid] || options[:billing_id] || nil
304
304
  }
305
305
 
306
306
  add_creditcard(parameters, creditcard)
@@ -314,7 +314,7 @@ module ActiveMerchant #:nodoc:
314
314
  # unstore() the information will be removed and a Response object will be returned indicating the success of the action.
315
315
  def unstore(identification, options = {})
316
316
  parameters = {
317
- billingid: identification,
317
+ billingid: identification
318
318
  }
319
319
 
320
320
  add_custom_fields(parameters, options)
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
126
126
  COMMON_ADDRESS_OPTIONS,
127
127
  {
128
128
  address1: [:string, 'Street'],
129
- address2: [:string, 'Street2'],
129
+ address2: [:string, 'Street2']
130
130
  }
131
131
  ].inject(:merge) #:nodoc
132
132
 
@@ -136,7 +136,7 @@ module ActiveMerchant #:nodoc:
136
136
  COMMON_ADDRESS_OPTIONS,
137
137
  {
138
138
  address1: [:string, 'Address'],
139
- address2: [:string, 'Address2'],
139
+ address2: [:string, 'Address2']
140
140
  },
141
141
  {
142
142
  card_number: [:string, 'CardNumber'],
@@ -144,7 +144,7 @@ module ActiveMerchant #:nodoc:
144
144
  account: [:string, 'Account'],
145
145
  routing: [:string, 'Routing'],
146
146
  check_format: [:string, 'CheckFormat'],
147
- record_type: [:string, 'RecordType'],
147
+ record_type: [:string, 'RecordType']
148
148
  }
149
149
  ].inject(:merge) #:nodoc
150
150
 
@@ -187,7 +187,7 @@ module ActiveMerchant #:nodoc:
187
187
  comments: [:string, 'Comments'],
188
188
  allow_partial_auth: [:boolean, 'AllowPartialAuth'],
189
189
  currency: [:string, 'Currency'],
190
- non_tax: [:boolean, 'NonTax'],
190
+ non_tax: [:boolean, 'NonTax']
191
191
  } #:nodoc:
192
192
 
193
193
  TRANSACTION_DETAIL_MONEY_OPTIONS = {
@@ -279,7 +279,7 @@ module ActiveMerchant #:nodoc:
279
279
 
280
280
  {
281
281
  quantity: 'qty',
282
- unit: 'um',
282
+ unit: 'um'
283
283
  }.each do |key, umkey|
284
284
  post["line#{index}#{umkey}"] = line_item[key.to_sym] if line_item.has_key?(key.to_sym)
285
285
  end
@@ -139,7 +139,7 @@ module ActiveMerchant #:nodoc:
139
139
 
140
140
  ACCOUNT_TYPES = {
141
141
  'checking' => '1',
142
- 'savings' => '2',
142
+ 'savings' => '2'
143
143
  }
144
144
 
145
145
  def add_check(post, payment_method)
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  'refund' => 'ns_credit',
179
179
  'authorize' => 'ns_quicksale_cc',
180
180
  'capture' => 'ns_quicksale_cc',
181
- 'void' => 'ns_void',
181
+ 'void' => 'ns_void'
182
182
  }
183
183
 
184
184
  def commit(action, options, post)
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.112.0'
2
+ VERSION = '1.113.0'
3
3
  end
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.112.0
4
+ version: 1.113.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-08-17 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport