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
@@ -175,7 +175,7 @@ module ActiveMerchant #:nodoc:
175
175
  post[:data][:attributes] = {
176
176
  tokenType: 'card',
177
177
  customerId: options[:customer_id],
178
- label: 'Credit Card',
178
+ label: 'Credit Card'
179
179
  }
180
180
  add_payment(post, payment, options)
181
181
  add_address(post, options)
@@ -209,7 +209,7 @@ module ActiveMerchant #:nodoc:
209
209
  credit_card_refund: %w(ReferenceNumber TransactionAmount OriginalTransactionAmount OriginalTransactionID ClientIpAddress),
210
210
  void_transaction: %w(ReferenceNumber TransactionID),
211
211
  credit_card_settle: %w(ReferenceNumber TransactionAmount OriginalTransactionAmount OriginalTransactionID ClientIpAddress),
212
- system_check: %w(SystemCheck),
212
+ system_check: %w(SystemCheck)
213
213
  }
214
214
  end
215
215
  end
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
204
204
  'InvoiceReference' => truncate(options[:order_id], 50),
205
205
  'InvoiceNumber' => truncate(options[:invoice] || options[:order_id], 12),
206
206
  'InvoiceDescription' => truncate(options[:description], 64),
207
- 'CurrencyCode' => currency_code,
207
+ 'CurrencyCode' => currency_code
208
208
  }
209
209
  end
210
210
 
@@ -558,7 +558,7 @@ module ActiveMerchant #:nodoc:
558
558
  'V6150' => 'Invalid Refund Amount',
559
559
  'V6151' => 'Refund amount greater than original transaction',
560
560
  'V6152' => 'Original transaction already refunded for total amount',
561
- 'V6153' => 'Card type not support by merchant',
561
+ 'V6153' => 'Card type not support by merchant'
562
562
  }
563
563
  end
564
564
  end
@@ -187,7 +187,7 @@ module ActiveMerchant
187
187
 
188
188
  def headers
189
189
  {
190
- 'User-Agent' => "ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
190
+ 'User-Agent' => "ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
191
191
  }
192
192
  end
193
193
  end
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
204
204
  'Bank Declined Transaction' => STANDARD_ERROR_CODE[:card_declined],
205
205
  'Insufficient Funds' => STANDARD_ERROR_CODE[:card_declined],
206
206
  'Transaction Declined - Bank Error' => STANDARD_ERROR_CODE[:processing_error],
207
- 'No Reply from Bank' => STANDARD_ERROR_CODE[:processing_error],
207
+ 'No Reply from Bank' => STANDARD_ERROR_CODE[:processing_error]
208
208
  }
209
209
 
210
210
  def error_code_from(succeeded, response)
@@ -134,7 +134,7 @@ module ActiveMerchant #:nodoc:
134
134
  'purchase' => '1',
135
135
  'refund' => '2',
136
136
  'authorize' => '4',
137
- 'capture' => '5',
137
+ 'capture' => '5'
138
138
  }
139
139
 
140
140
  def commit(action, post)
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  end
44
44
 
45
45
  def capture(money, transaction_id, options={})
46
- commit('CreditAddToBatch') do |xml|
46
+ commit('CreditAddToBatch', transaction_id) do |xml|
47
47
  add_amount(xml, money)
48
48
  add_reference(xml, transaction_id)
49
49
  end
@@ -126,7 +126,8 @@ module ActiveMerchant #:nodoc:
126
126
  end
127
127
 
128
128
  def add_reference(xml, transaction_id)
129
- xml.hps :GatewayTxnId, transaction_id
129
+ reference = transaction_id.to_s.include?('|') ? transaction_id.split('|').first : transaction_id
130
+ xml.hps :GatewayTxnId, reference
130
131
  end
131
132
 
132
133
  def add_amount(xml, money)
@@ -232,7 +233,7 @@ module ActiveMerchant #:nodoc:
232
233
  source: card_or_token.source,
233
234
  cavv: card_or_token.payment_cryptogram,
234
235
  eci: card_or_token.eci,
235
- xid: card_or_token.transaction_id,
236
+ xid: card_or_token.transaction_id
236
237
  })
237
238
  elsif options[:three_d_secure]
238
239
  options[:three_d_secure][:source] ||= card_brand(card_or_token)
@@ -323,7 +324,7 @@ module ActiveMerchant #:nodoc:
323
324
  response
324
325
  end
325
326
 
326
- def commit(action, &request)
327
+ def commit(action, reference = nil, &request)
327
328
  data = build_request(action, &request)
328
329
 
329
330
  response =
@@ -338,7 +339,7 @@ module ActiveMerchant #:nodoc:
338
339
  message_from(response),
339
340
  response,
340
341
  test: test?,
341
- authorization: authorization_from(response),
342
+ authorization: authorization_from(response, reference),
342
343
  avs_result: {
343
344
  code: response['AVSRsltCode'],
344
345
  message: response['AVSRsltText']
@@ -369,7 +370,9 @@ module ActiveMerchant #:nodoc:
369
370
  end
370
371
  end
371
372
 
372
- def authorization_from(response)
373
+ def authorization_from(response, reference)
374
+ return [reference, response['GatewayTxnId']].join('|') if reference
375
+
373
376
  response['GatewayTxnId']
374
377
  end
375
378
 
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  '05' => STANDARD_ERROR_CODE[:card_declined],
19
19
  '06' => STANDARD_ERROR_CODE[:processing_error],
20
20
  '14' => STANDARD_ERROR_CODE[:invalid_number],
21
- '54' => STANDARD_ERROR_CODE[:expired_card],
21
+ '54' => STANDARD_ERROR_CODE[:expired_card]
22
22
  }
23
23
 
24
24
  def initialize(options={})
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
121
121
  def commit(action, &block)
122
122
  headers = {
123
123
  'Content-Type' => 'text/xml; charset=utf-8',
124
- 'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}",
124
+ 'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}"
125
125
  }
126
126
  response = parse(ssl_post(commit_url, new_submit_xml(action, &block), headers))
127
127
 
@@ -203,7 +203,7 @@ module ActiveMerchant #:nodoc:
203
203
  'YER' => '886',
204
204
  'ZAR' => '710',
205
205
  'ZMK' => '894',
206
- 'ZWD' => '716',
206
+ 'ZWD' => '716'
207
207
  }
208
208
 
209
209
  AVS_CODE = {
@@ -389,7 +389,7 @@ module ActiveMerchant #:nodoc:
389
389
  authorization: authorization,
390
390
  avs_result: {
391
391
  street_match: AVS_CODE[ response[:transaction_output_data][:address_numeric_check_result] ],
392
- postal_match: AVS_CODE[ response[:transaction_output_data][:post_code_check_result] ],
392
+ postal_match: AVS_CODE[ response[:transaction_output_data][:post_code_check_result] ]
393
393
  },
394
394
  cvv_result: CVV_CODE[ response[:transaction_output_data][:cv2_check_result] ]
395
395
  )
@@ -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
 
@@ -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
 
@@ -65,9 +65,11 @@ module ActiveMerchant #:nodoc:
65
65
  return settlement_data if settlement_data.message != 'OK'
66
66
 
67
67
  post = {}
68
- if settlement_data.params['status'] == 'PENDING'
68
+ if settlement_data.params['status'] == 'PENDING' && money == settlement_data.params['amount']
69
69
  post[:status] = 'CANCELLED'
70
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.')
71
73
  else
72
74
  add_invoice(post, money, options)
73
75
 
@@ -196,7 +198,7 @@ module ActiveMerchant #:nodoc:
196
198
  street: address[:address1],
197
199
  city: address[:city],
198
200
  zip: address[:zip],
199
- state: address[:state],
201
+ state: address[:state]
200
202
  }
201
203
  mapped[:country] = country.code(:alpha2).value unless country.blank?
202
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