activemerchant 1.114.0 → 1.116.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +45 -0
  3. data/lib/active_merchant.rb +1 -1
  4. data/lib/active_merchant/billing/avs_result.rb +1 -1
  5. data/lib/active_merchant/billing/compatibility.rb +3 -3
  6. data/lib/active_merchant/billing/credit_card_methods.rb +5 -5
  7. data/lib/active_merchant/billing/gateways/adyen.rb +23 -13
  8. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -11
  10. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  11. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
  12. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  13. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  14. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  15. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  16. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  18. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  20. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  21. data/lib/active_merchant/billing/gateways/blue_snap.rb +19 -17
  22. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  23. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  25. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -10
  27. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  29. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  32. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  33. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  35. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  36. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  37. data/lib/active_merchant/billing/gateways/checkout_v2.rb +16 -19
  38. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  39. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  42. data/lib/active_merchant/billing/gateways/credorax.rb +9 -9
  43. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  45. data/lib/active_merchant/billing/gateways/cyber_source.rb +30 -31
  46. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  47. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  48. data/lib/active_merchant/billing/gateways/decidir.rb +9 -8
  49. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  50. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  51. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  52. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  53. data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
  54. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  55. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  56. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  57. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  58. data/lib/active_merchant/billing/gateways/eway_rapid.rb +6 -6
  59. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  60. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  61. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  62. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  63. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  65. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  66. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +4 -4
  67. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  68. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  70. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -10
  71. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  72. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  73. data/lib/active_merchant/billing/gateways/hps.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  75. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  76. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  77. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  78. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  79. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  80. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  81. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  82. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  83. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  84. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  85. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  86. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  87. data/lib/active_merchant/billing/gateways/litle.rb +11 -11
  88. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  89. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  90. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  91. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  92. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  93. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  94. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  95. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  96. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  97. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  98. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  99. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  100. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  101. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  102. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  103. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  104. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  105. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  106. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  107. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  108. data/lib/active_merchant/billing/gateways/netbanx.rb +8 -8
  109. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  110. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  111. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  112. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  113. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  114. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  115. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  116. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  117. data/lib/active_merchant/billing/gateways/orbital.rb +61 -66
  118. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  120. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  123. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  124. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  125. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  126. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  128. data/lib/active_merchant/billing/gateways/payeezy.rb +9 -9
  129. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  130. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  132. data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
  133. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  134. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  137. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  138. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  139. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  140. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  141. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  142. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  143. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  144. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  145. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  146. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  149. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
  153. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  154. data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
  155. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  156. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  157. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  159. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  160. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  161. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  162. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  163. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  164. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  165. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  166. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  167. data/lib/active_merchant/billing/gateways/stripe.rb +9 -9
  168. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
  169. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  170. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  171. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  172. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  173. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  174. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  175. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  177. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  179. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  181. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  182. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  183. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  184. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
  186. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  187. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  188. data/lib/active_merchant/billing/response.rb +1 -1
  189. data/lib/active_merchant/country.rb +1 -1
  190. data/lib/active_merchant/network_connection_retries.rb +2 -2
  191. data/lib/active_merchant/post_data.rb +1 -1
  192. data/lib/active_merchant/posts_data.rb +1 -1
  193. data/lib/active_merchant/version.rb +1 -1
  194. data/lib/support/ssl_verify.rb +2 -2
  195. data/lib/support/ssl_version.rb +2 -2
  196. metadata +2 -2
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
51
51
  MultiResponse.run(:first) do |r|
52
52
  r.process { commit(:post, "customers/#{CGI.escape(options[:customer])}/", post, options) }
53
53
 
54
- return r unless options[:set_default] and r.success? and !r.params['id'].blank?
54
+ return r unless options[:set_default] && r.success? && !r.params['id'].blank?
55
55
 
56
56
  r.process { update_customer(options[:customer], default_card: r.params['id']) }
57
57
  end
@@ -89,7 +89,7 @@ module ActiveMerchant #:nodoc:
89
89
  'Authorization' => 'Basic ' + Base64.encode64(@api_key.to_s + ':').strip,
90
90
  'User-Agent' => "Webpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
91
91
  'X-Webpay-Client-User-Agent' => user_agent,
92
- 'X-Webpay-Client-User-Metadata' => {ip: options[:ip]}.to_json
92
+ 'X-Webpay-Client-User-Metadata' => { ip: options[:ip] }.to_json
93
93
  }
94
94
  end
95
95
  end
@@ -168,14 +168,15 @@ module ActiveMerchant #:nodoc:
168
168
  JSON.parse(response)
169
169
  end
170
170
 
171
- def commit(action, params, options={})
171
+ def commit(action, params, options = {})
172
172
  begin
173
173
  response = parse(
174
174
  ssl_post(
175
175
  ((test? ? test_url : live_url) + action),
176
176
  params.to_json,
177
177
  headers(options)
178
- ))
178
+ )
179
+ )
179
180
  rescue ResponseError => e
180
181
  response = parse(e.response.body)
181
182
  end
@@ -183,8 +183,7 @@ module ActiveMerchant #:nodoc:
183
183
  test: test?,
184
184
  authorization: authorization,
185
185
  avs_result: { code: avs_code(response, options) },
186
- cvv_result: response[:CVCResponseCode]
187
- )
186
+ cvv_result: response[:CVCResponseCode])
188
187
  rescue ResponseError => e
189
188
  if e.response.code == '401'
190
189
  return Response.new(false, 'Invalid Login')
@@ -111,14 +111,14 @@ module ActiveMerchant #:nodoc:
111
111
  credit_request(money, payment_method, payment_details.merge(credit: true, **options))
112
112
  end
113
113
 
114
- def verify(payment_method, options={})
114
+ def verify(payment_method, options = {})
115
115
  MultiResponse.run(:use_first_response) do |r|
116
116
  r.process { authorize(100, payment_method, options) }
117
117
  r.process(:ignore_result) { void(r.authorization, options.merge(authorization_validated: true)) }
118
118
  end
119
119
  end
120
120
 
121
- def store(credit_card, options={})
121
+ def store(credit_card, options = {})
122
122
  requires!(options, :customer)
123
123
  store_request(credit_card, options)
124
124
  end
@@ -432,7 +432,7 @@ module ActiveMerchant #:nodoc:
432
432
  add_address(xml, (options[:billing_address] || options[:address]), options)
433
433
  end
434
434
 
435
- def add_stored_credential_options(xml, options={})
435
+ def add_stored_credential_options(xml, options = {})
436
436
  if options[:stored_credential]
437
437
  add_stored_credential_using_normalized_fields(xml, options)
438
438
  else
@@ -510,7 +510,7 @@ module ActiveMerchant #:nodoc:
510
510
  def add_hcg_additional_data(xml, options)
511
511
  xml.hcgAdditionalData do
512
512
  options[:hcg_additional_data].each do |k, v|
513
- xml.param({name: k.to_s}, v)
513
+ xml.param({ name: k.to_s }, v)
514
514
  end
515
515
  end
516
516
  end
@@ -546,7 +546,7 @@ module ActiveMerchant #:nodoc:
546
546
  xml = xml.strip.gsub(/\&/, '&')
547
547
  doc = Nokogiri::XML(xml, &:strict)
548
548
  doc.remove_namespaces!
549
- resp_params = {action: action}
549
+ resp_params = { action: action }
550
550
 
551
551
  parse_elements(doc.root, resp_params)
552
552
  resp_params
@@ -568,6 +568,8 @@ module ActiveMerchant #:nodoc:
568
568
  end
569
569
 
570
570
  def headers(options)
571
+ idempotency_key = options[:idempotency_key]
572
+
571
573
  headers = {
572
574
  'Content-Type' => 'text/xml',
573
575
  'Authorization' => encoded_credentials
@@ -575,6 +577,8 @@ module ActiveMerchant #:nodoc:
575
577
  if options[:cookie]
576
578
  headers['Cookie'] = options[:cookie] if options[:cookie]
577
579
  end
580
+
581
+ headers['Idempotency-Key'] = idempotency_key if idempotency_key
578
582
  headers
579
583
  end
580
584
 
@@ -683,11 +687,11 @@ module ActiveMerchant #:nodoc:
683
687
  end
684
688
 
685
689
  def order_id_from(raw)
686
- pair = raw.detect { |k, v| k.to_s =~ /_order_code$/ }
690
+ pair = raw.detect { |k, _v| k.to_s =~ /_order_code$/ }
687
691
  (pair ? pair.last : nil)
688
692
  end
689
693
 
690
- def authorization_from_token_details(options={})
694
+ def authorization_from_token_details(options = {})
691
695
  [options[:order_id], options[:token_id], options[:token_scope], options[:customer]].join('|')
692
696
  end
693
697
 
@@ -727,7 +731,7 @@ module ActiveMerchant #:nodoc:
727
731
  def credit_fund_transfer_attribute(options)
728
732
  return unless options[:credit]
729
733
 
730
- {'action' => 'REFUND'}
734
+ { 'action' => 'REFUND' }
731
735
  end
732
736
 
733
737
  def encoded_credentials
@@ -13,14 +13,14 @@ module ActiveMerchant #:nodoc:
13
13
  self.homepage_url = 'http://online.worldpay.com'
14
14
  self.display_name = 'Worldpay Online Payments'
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :client_key, :service_key)
18
18
  @client_key = options[:client_key]
19
19
  @service_key = options[:service_key]
20
20
  super
21
21
  end
22
22
 
23
- def authorize(money, credit_card, options={})
23
+ def authorize(money, credit_card, options = {})
24
24
  response = create_token(true, credit_card.first_name + ' ' + credit_card.last_name, credit_card.month, credit_card.year, credit_card.number, credit_card.verification_value)
25
25
  if response.success?
26
26
  options[:authorizeOnly] = true
@@ -30,9 +30,9 @@ module ActiveMerchant #:nodoc:
30
30
  response
31
31
  end
32
32
 
33
- def capture(money, authorization, options={})
33
+ def capture(money, authorization, options = {})
34
34
  if authorization
35
- commit(:post, "orders/#{CGI.escape(authorization)}/capture", {'captureAmount' => money}, options, 'capture')
35
+ commit(:post, "orders/#{CGI.escape(authorization)}/capture", { 'captureAmount' => money }, options, 'capture')
36
36
  else
37
37
  Response.new(false,
38
38
  'FAILED',
@@ -41,12 +41,11 @@ module ActiveMerchant #:nodoc:
41
41
  authorization: false,
42
42
  avs_result: {},
43
43
  cvv_result: {},
44
- error_code: false
45
- )
44
+ error_code: false)
46
45
  end
47
46
  end
48
47
 
49
- def purchase(money, credit_card, options={})
48
+ def purchase(money, credit_card, options = {})
50
49
  response = create_token(true, credit_card.first_name + ' ' + credit_card.last_name, credit_card.month, credit_card.year, credit_card.number, credit_card.verification_value)
51
50
  if response.success?
52
51
  post = create_post_for_auth_or_purchase(response.authorization, money, options)
@@ -55,18 +54,18 @@ module ActiveMerchant #:nodoc:
55
54
  response
56
55
  end
57
56
 
58
- def refund(money, orderCode, options={})
59
- obj = money ? {'refundAmount' => money} : {}
57
+ def refund(money, orderCode, options = {})
58
+ obj = money ? { 'refundAmount' => money } : {}
60
59
  commit(:post, "orders/#{CGI.escape(orderCode)}/refund", obj, options, 'refund')
61
60
  end
62
61
 
63
- def void(orderCode, options={})
62
+ def void(orderCode, options = {})
64
63
  response = commit(:delete, "orders/#{CGI.escape(orderCode)}", nil, options, 'void')
65
64
  response = refund(nil, orderCode) if !response.success? && (response.params && response.params['customCode'] != 'ORDER_NOT_FOUND')
66
65
  response
67
66
  end
68
67
 
69
- def verify(credit_card, options={})
68
+ def verify(credit_card, options = {})
70
69
  authorize(0, credit_card, options)
71
70
  end
72
71
 
@@ -85,7 +84,7 @@ module ActiveMerchant #:nodoc:
85
84
  },
86
85
  'clientKey' => @client_key
87
86
  }
88
- token_response = commit(:post, 'tokens', obj, {'Authorization' => @service_key}, 'token')
87
+ token_response = commit(:post, 'tokens', obj, { 'Authorization' => @service_key }, 'token')
89
88
  token_response
90
89
  end
91
90
 
@@ -121,13 +120,13 @@ module ActiveMerchant #:nodoc:
121
120
  'Content-Type' => 'application/json',
122
121
  'User-Agent' => "Worldpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
123
122
  'X-Worldpay-Client-User-Agent' => user_agent,
124
- 'X-Worldpay-Client-User-Metadata' => {ip: options[:ip]}.to_json
123
+ 'X-Worldpay-Client-User-Metadata' => { ip: options[:ip] }.to_json
125
124
  }
126
125
  headers['Authorization'] = options['Authorization'] if options['Authorization']
127
126
  headers
128
127
  end
129
128
 
130
- def commit(method, url, parameters=nil, options = {}, type = false)
129
+ def commit(method, url, parameters = nil, options = {}, type = false)
131
130
  raw_response = response = nil
132
131
  success = false
133
132
  begin
@@ -178,8 +177,7 @@ module ActiveMerchant #:nodoc:
178
177
  authorization: authorization,
179
178
  avs_result: {},
180
179
  cvv_result: {},
181
- error_code: success ? nil : response['customCode']
182
- )
180
+ error_code: success ? nil : response['customCode'])
183
181
  end
184
182
 
185
183
  def test?
@@ -17,12 +17,12 @@ module ActiveMerchant #:nodoc:
17
17
  self.money_format = :dollars
18
18
  self.supported_cardtypes = %i[visa master american_express discover jcb]
19
19
 
20
- def initialize(options={})
20
+ def initialize(options = {})
21
21
  requires!(options, :acctid, :subid, :merchantpin)
22
22
  super
23
23
  end
24
24
 
25
- def purchase(money, payment_method, options={})
25
+ def purchase(money, payment_method, options = {})
26
26
  post = {}
27
27
  add_invoice(post, money, options)
28
28
  add_payment_method(post, payment_method)
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
31
31
  commit('purchase', options, post)
32
32
  end
33
33
 
34
- def authorize(money, payment, options={})
34
+ def authorize(money, payment, options = {})
35
35
  post = {}
36
36
  add_invoice(post, money, options)
37
37
  add_credit_card(post, payment)
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit('authorize', options, post)
41
41
  end
42
42
 
43
- def capture(amount, authorization, options={})
43
+ def capture(amount, authorization, options = {})
44
44
  post = {}
45
45
  add_invoice(post, amount, options)
46
46
  add_reference(post, authorization)
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
49
49
  commit('capture', options, post)
50
50
  end
51
51
 
52
- def refund(amount, authorization, options={})
52
+ def refund(amount, authorization, options = {})
53
53
  post = {}
54
54
  add_invoice(post, amount, options)
55
55
  add_reference(post, authorization)
@@ -58,14 +58,14 @@ module ActiveMerchant #:nodoc:
58
58
  commit('refund', options, post)
59
59
  end
60
60
 
61
- def void(authorization, options={})
61
+ def void(authorization, options = {})
62
62
  post = {}
63
63
  add_reference(post, authorization)
64
64
 
65
65
  commit('void', options, post)
66
66
  end
67
67
 
68
- def verify(credit_card, options={})
68
+ def verify(credit_card, options = {})
69
69
  MultiResponse.run(:use_first_response) do |r|
70
70
  r.process { authorize(100, credit_card, options) }
71
71
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  @primary_response = nil
54
54
  end
55
55
 
56
- def process(ignore_result=false)
56
+ def process(ignore_result = false)
57
57
  return unless success?
58
58
 
59
59
  response = yield
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
39
39
 
40
40
  def initialize(options = {})
41
41
  @name = options.delete(:name)
42
- @codes = options.collect { |k, v| CountryCode.new(v) }
42
+ @codes = options.collect { |_k, v| CountryCode.new(v) }
43
43
  end
44
44
 
45
45
  def code(format)
@@ -17,7 +17,7 @@ module ActiveMerchant
17
17
  base.send(:attr_accessor, :retry_safe)
18
18
  end
19
19
 
20
- def retry_exceptions(options={})
20
+ def retry_exceptions(options = {})
21
21
  connection_errors = DEFAULT_CONNECTION_ERRORS.merge(options[:connection_exceptions] || {})
22
22
 
23
23
  retry_network_exceptions(options) do
@@ -34,7 +34,7 @@ module ActiveMerchant
34
34
  end
35
35
  end
36
36
 
37
- def self.log(logger, level, message, tag=nil)
37
+ def self.log(logger, level, message, tag = nil)
38
38
  tag ||= self.class.to_s
39
39
  message = "[#{tag}] #{message}"
40
40
  logger&.send(level, message)
@@ -15,7 +15,7 @@ module ActiveMerchant
15
15
  collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
16
16
  end
17
17
 
18
- alias_method :to_s, :to_post_data
18
+ alias to_s to_post_data
19
19
 
20
20
  private
21
21
 
@@ -32,7 +32,7 @@ module ActiveMerchant #:nodoc:
32
32
  base.class_attribute :proxy_port
33
33
  end
34
34
 
35
- def ssl_get(endpoint, headers={})
35
+ def ssl_get(endpoint, headers = {})
36
36
  ssl_request(:get, endpoint, nil, headers)
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = '1.114.0'
2
+ VERSION = '1.116.0'
3
3
  end
@@ -27,10 +27,10 @@ class SSLVerify
27
27
  success << g
28
28
  when :fail
29
29
  print 'F'
30
- failed << {gateway: g, message: message}
30
+ failed << { gateway: g, message: message }
31
31
  when :error
32
32
  print 'E'
33
- errored << {gateway: g, message: message}
33
+ errored << { gateway: g, message: message }
34
34
  end
35
35
  end
36
36
 
@@ -29,10 +29,10 @@ class SSLVersion
29
29
  success << g
30
30
  when :fail
31
31
  print 'F'
32
- failed << {gateway: g, message: message}
32
+ failed << { gateway: g, message: message }
33
33
  when :error
34
34
  print 'E'
35
- errored << {gateway: g, message: message}
35
+ errored << { gateway: g, message: message }
36
36
  end
37
37
  end
38
38
 
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.114.0
4
+ version: 1.116.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-09-04 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport