activemerchant 1.113.0 → 1.119.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +114 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/compatibility.rb +3 -3
  7. data/lib/active_merchant/billing/credit_card.rb +3 -0
  8. data/lib/active_merchant/billing/credit_card_methods.rb +72 -13
  9. data/lib/active_merchant/billing/gateways/adyen.rb +24 -14
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +44 -12
  12. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  13. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  15. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  18. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  20. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +37 -12
  24. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  25. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  26. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  27. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/braintree_blue.rb +13 -10
  29. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  31. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  35. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  38. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/credorax.rb +26 -15
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -36
  48. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  50. data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
  51. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  52. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  53. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  54. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  55. data/lib/active_merchant/billing/gateways/elavon.rb +286 -225
  56. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  58. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
  61. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  62. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  65. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  67. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  68. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  69. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  70. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  72. data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
  73. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  75. data/lib/active_merchant/billing/gateways/hps.rb +17 -8
  76. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  77. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  78. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  80. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  81. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  82. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  83. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  85. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  86. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  87. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  88. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  89. data/lib/active_merchant/billing/gateways/litle.rb +31 -15
  90. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  91. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  92. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  93. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  94. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  95. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  96. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  97. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  98. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  99. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  100. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  101. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  102. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  104. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  105. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  106. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  107. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  108. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  109. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  110. data/lib/active_merchant/billing/gateways/netbanx.rb +19 -8
  111. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  112. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  113. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  114. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  116. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  117. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  118. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  119. data/lib/active_merchant/billing/gateways/orbital.rb +196 -85
  120. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  121. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  125. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  126. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  128. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  130. data/lib/active_merchant/billing/gateways/payeezy.rb +32 -14
  131. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  132. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
  134. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  135. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  136. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  137. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  138. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  141. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  142. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  143. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  144. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  145. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  146. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  148. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  149. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  151. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  152. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  153. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  154. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  156. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  157. data/lib/active_merchant/billing/gateways/redsys.rb +86 -5
  158. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  159. data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
  160. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  161. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  162. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  163. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  164. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  165. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  166. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  168. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  169. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  170. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  171. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  172. data/lib/active_merchant/billing/gateways/stripe.rb +10 -10
  173. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
  174. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  175. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  176. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  177. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  178. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  179. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  182. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  183. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  184. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  186. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  187. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  188. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  189. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  190. data/lib/active_merchant/billing/gateways/worldpay.rb +19 -11
  191. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  192. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  193. data/lib/active_merchant/billing/response.rb +3 -2
  194. data/lib/active_merchant/country.rb +1 -1
  195. data/lib/active_merchant/network_connection_retries.rb +2 -2
  196. data/lib/active_merchant/post_data.rb +1 -1
  197. data/lib/active_merchant/posts_data.rb +1 -1
  198. data/lib/active_merchant/version.rb +1 -1
  199. data/lib/support/ssl_verify.rb +2 -2
  200. data/lib/support/ssl_version.rb +2 -2
  201. metadata +2 -2
@@ -10,12 +10,12 @@ module ActiveMerchant #:nodoc:
10
10
  self.display_name = 'Mercado Pago'
11
11
  self.money_format = :dollars
12
12
 
13
- def initialize(options={})
13
+ def initialize(options = {})
14
14
  requires!(options, :access_token)
15
15
  super
16
16
  end
17
17
 
18
- def purchase(money, payment, options={})
18
+ def purchase(money, payment, options = {})
19
19
  MultiResponse.run do |r|
20
20
  r.process { commit('tokenize', 'card_tokens', card_token_request(money, payment, options)) }
21
21
  options[:card_token] = r.authorization.split('|').first
@@ -23,7 +23,7 @@ module ActiveMerchant #:nodoc:
23
23
  end
24
24
  end
25
25
 
26
- def authorize(money, payment, options={})
26
+ def authorize(money, payment, options = {})
27
27
  MultiResponse.run do |r|
28
28
  r.process { commit('tokenize', 'card_tokens', card_token_request(money, payment, options)) }
29
29
  options[:card_token] = r.authorization.split('|').first
@@ -31,7 +31,7 @@ module ActiveMerchant #:nodoc:
31
31
  end
32
32
  end
33
33
 
34
- def capture(money, authorization, options={})
34
+ def capture(money, authorization, options = {})
35
35
  post = {}
36
36
  authorization, = authorization.split('|')
37
37
  post[:capture] = true
@@ -39,20 +39,20 @@ module ActiveMerchant #:nodoc:
39
39
  commit('capture', "payments/#{authorization}", post)
40
40
  end
41
41
 
42
- def refund(money, authorization, options={})
42
+ def refund(money, authorization, options = {})
43
43
  post = {}
44
44
  authorization, original_amount = authorization.split('|')
45
45
  post[:amount] = amount(money).to_f if original_amount && original_amount.to_f > amount(money).to_f
46
46
  commit('refund', "payments/#{authorization}/refunds", post)
47
47
  end
48
48
 
49
- def void(authorization, options={})
49
+ def void(authorization, options = {})
50
50
  authorization, = authorization.split('|')
51
51
  post = { status: 'cancelled' }
52
52
  commit('void', "payments/#{authorization}", post)
53
53
  end
54
54
 
55
- def verify(credit_card, options={})
55
+ def verify(credit_card, options = {})
56
56
  MultiResponse.run(:use_first_response) do |r|
57
57
  r.process { authorize(100, credit_card, options) }
58
58
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -169,8 +169,7 @@ module ActiveMerchant #:nodoc:
169
169
  authorization: response['transaction_id'],
170
170
  test: test?,
171
171
  cvv_result: response['cvv2_result'],
172
- avs_result: { code: response['avs_result'] }
173
- )
172
+ avs_result: { code: response['avs_result'] })
174
173
  end
175
174
 
176
175
  def message_from(response)
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  post['ccexp'] = "#{sprintf('%02d', creditcard.month)}#{creditcard.year.to_s[-2, 2]}"
80
80
  end
81
81
 
82
- def commit(action, money, parameters={})
82
+ def commit(action, money, parameters = {})
83
83
  parameters['username'] = @options[:username]
84
84
  parameters['password'] = @options[:password]
85
85
  parse(ssl_post(BASE_URL, post_data(action, parameters)))
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
13
13
  self.money_format = :dollars
14
14
  self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :account_id, :merchant_pin)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(amount, payment_method, options={})
21
+ def purchase(amount, payment_method, options = {})
22
22
  post = {}
23
23
  add_invoice(post, amount, options)
24
24
  add_payment_method(post, payment_method)
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  commit(payment_method.is_a?(String) ? :stored_purchase : :purchase, post)
28
28
  end
29
29
 
30
- def authorize(amount, payment_method, options={})
30
+ def authorize(amount, payment_method, options = {})
31
31
  post = {}
32
32
  add_invoice(post, amount, options)
33
33
  add_payment_method(post, payment_method)
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
36
36
  commit(:authorize, post)
37
37
  end
38
38
 
39
- def capture(amount, authorization, options={})
39
+ def capture(amount, authorization, options = {})
40
40
  post = {}
41
41
  add_invoice(post, amount, options)
42
42
  add_reference(post, authorization)
@@ -45,14 +45,14 @@ module ActiveMerchant #:nodoc:
45
45
  commit(:capture, post)
46
46
  end
47
47
 
48
- def void(authorization, options={})
48
+ def void(authorization, options = {})
49
49
  post = {}
50
50
  add_reference(post, authorization)
51
51
 
52
52
  commit(:void, post)
53
53
  end
54
54
 
55
- def refund(amount, authorization, options={})
55
+ def refund(amount, authorization, options = {})
56
56
  post = {}
57
57
  add_invoice(post, amount, options)
58
58
  add_reference(post, authorization)
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  commit(:refund, post)
62
62
  end
63
63
 
64
- def credit(amount, payment_method, options={})
64
+ def credit(amount, payment_method, options = {})
65
65
  post = {}
66
66
  add_invoice(post, amount, options)
67
67
  add_payment_method(post, payment_method)
@@ -69,7 +69,7 @@ module ActiveMerchant #:nodoc:
69
69
  commit(payment_method.is_a?(String) ? :stored_credit : :credit, post)
70
70
  end
71
71
 
72
- def verify(credit_card, options={})
72
+ def verify(credit_card, options = {})
73
73
  MultiResponse.run(:use_first_response) do |r|
74
74
  r.process { authorize(100, credit_card, options) }
75
75
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -111,9 +111,9 @@ module ActiveMerchant #:nodoc:
111
111
 
112
112
  def add_payment_method(post, payment_method)
113
113
  if payment_method.is_a?(String)
114
- user_profile_id, last_4 = split_authorization(payment_method)
114
+ user_profile_id, last4 = split_authorization(payment_method)
115
115
  post[:userprofileid] = user_profile_id
116
- post[:last4digits] = last_4
116
+ post[:last4digits] = last4
117
117
  else
118
118
  post[:ccname] = payment_method.name
119
119
  post[:ccnum] = payment_method.number
@@ -13,10 +13,10 @@ module ActiveMerchant #:nodoc:
13
13
 
14
14
  ENV_NAMESPACES = { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
15
15
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
16
- 'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/'}
16
+ 'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/' }
17
17
  ENV_NAMESPACES_V4 = { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
18
18
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
19
- 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'}
19
+ 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' }
20
20
 
21
21
  TX_NAMESPACE = 'http://merchantwarehouse.com/MerchantWARE/Client/TransactionRetail'
22
22
  TX_NAMESPACE_V4 = 'http://schemas.merchantwarehouse.com/merchantware/40/Credit/'
@@ -272,7 +272,7 @@ module ActiveMerchant #:nodoc:
272
272
  response[element.name] = element.text
273
273
  end
274
274
 
275
- response[:message] = response['faultstring'].to_s.gsub("\n", ' ')
275
+ response[:message] = response['faultstring'].to_s.tr("\n", ' ')
276
276
  response
277
277
  rescue REXML::ParseException
278
278
  response[:http_body] = http_response.body
@@ -292,8 +292,7 @@ module ActiveMerchant #:nodoc:
292
292
  begin
293
293
  data = ssl_post(url(v4), request,
294
294
  'Content-Type' => 'text/xml; charset=utf-8',
295
- 'SOAPAction' => soap_action(action, v4)
296
- )
295
+ 'SOAPAction' => soap_action(action, v4))
297
296
  response = parse(action, data)
298
297
  rescue ActiveMerchant::ResponseError => e
299
298
  response = parse_error(e.response)
@@ -303,8 +302,7 @@ module ActiveMerchant #:nodoc:
303
302
  test: test?,
304
303
  authorization: authorization_from(response),
305
304
  avs_result: { code: response['AVSResponse'] },
306
- cvv_result: response['CVResponse']
307
- )
305
+ cvv_result: response['CVResponse'])
308
306
  end
309
307
 
310
308
  def authorization_from(response)
@@ -108,7 +108,7 @@ module ActiveMerchant #:nodoc:
108
108
  commit(:refund, request)
109
109
  end
110
110
 
111
- def verify(credit_card, options={})
111
+ def verify(credit_card, options = {})
112
112
  MultiResponse.run(:use_first_response) do |r|
113
113
  r.process { authorize(100, credit_card, options) }
114
114
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -243,7 +243,7 @@ module ActiveMerchant #:nodoc:
243
243
  response[element.name] = element.text
244
244
  end
245
245
 
246
- response[:message] = response['ErrorMessage'].to_s.gsub("\n", ' ')
246
+ response[:message] = response['ErrorMessage'].to_s.tr("\n", ' ')
247
247
  response
248
248
  rescue REXML::ParseException
249
249
  response[:http_body] = http_response.body
@@ -263,8 +263,7 @@ module ActiveMerchant #:nodoc:
263
263
  begin
264
264
  data = ssl_post(url, request,
265
265
  'Content-Type' => 'text/xml; charset=utf-8',
266
- 'SOAPAction' => soap_action(action)
267
- )
266
+ 'SOAPAction' => soap_action(action))
268
267
  response = parse(action, data)
269
268
  rescue ActiveMerchant::ResponseError => e
270
269
  response = parse_error(e.response, action)
@@ -274,8 +273,7 @@ module ActiveMerchant #:nodoc:
274
273
  test: test?,
275
274
  authorization: authorization_from(response),
276
275
  avs_result: { code: response['AvsResponse'] },
277
- cvv_result: response['CvResponse']
278
- )
276
+ cvv_result: response['CvResponse'])
279
277
  end
280
278
 
281
279
  def authorization_from(response)
@@ -69,14 +69,14 @@ module ActiveMerchant #:nodoc:
69
69
  commit('Return', request)
70
70
  end
71
71
 
72
- def void(authorization, options={})
72
+ def void(authorization, options = {})
73
73
  requires!(options, :credit_card) unless @use_tokenization
74
74
 
75
75
  request = build_authorized_request('VoidSale', nil, authorization, options[:credit_card], options)
76
76
  commit('VoidSale', request)
77
77
  end
78
78
 
79
- def store(credit_card, options={})
79
+ def store(credit_card, options = {})
80
80
  request = build_card_lookup_request(credit_card, options)
81
81
  commit('CardLookup', request)
82
82
  end
@@ -211,11 +211,11 @@ module ActiveMerchant #:nodoc:
211
211
  # handle with the validation error as it sees fit.
212
212
  # Track 2 requires having the STX and ETX stripped. Track 1 does not.
213
213
  # Max-length track 1s require having the STX and ETX stripped. Max is 79 bytes including LRC.
214
- is_track_2 = credit_card.track_data[0] == ';'
214
+ is_track2 = credit_card.track_data[0] == ';'
215
215
  etx_index = credit_card.track_data.rindex('?') || credit_card.track_data.length
216
216
  is_max_track1 = etx_index >= 77
217
217
 
218
- if is_track_2
218
+ if is_track2
219
219
  xml.tag! 'Track2', credit_card.track_data[1...etx_index]
220
220
  elsif is_max_track1
221
221
  xml.tag! 'Track1', credit_card.track_data[1...etx_index]
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
99
99
  # * <tt>money</tt> -- The amount to be captured as an Integer value in cents.
100
100
  # * <tt>authorization</tt> -- The authorization returned from the previous authorize request.
101
101
  def capture(money, authorization, options = {})
102
- post = {trans_id: authorization}
102
+ post = { trans_id: authorization }
103
103
  add_customer_data(post, options)
104
104
  commit('PRIOR_AUTH_CAPTURE', money, post)
105
105
  end
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  #
111
111
  # * <tt>authorization</tt> - The authorization returned from the previous authorize request.
112
112
  def void(authorization, options = {})
113
- post = {trans_id: authorization}
113
+ post = { trans_id: authorization }
114
114
  add_duplicate_window(post)
115
115
  commit('VOID', nil, post)
116
116
  end
@@ -136,7 +136,7 @@ module ActiveMerchant #:nodoc:
136
136
  requires!(options, :card_number)
137
137
 
138
138
  post = { trans_id: identification,
139
- card_num: options[:card_number]}
139
+ card_num: options[:card_number] }
140
140
 
141
141
  post[:first_name] = options[:first_name] if options[:first_name]
142
142
  post[:last_name] = options[:last_name] if options[:last_name]
@@ -180,8 +180,7 @@ module ActiveMerchant #:nodoc:
180
180
  authorization: response[:transaction_id],
181
181
  fraud_review: fraud_review?(response),
182
182
  avs_result: { code: response[:avs_result_code] },
183
- cvv_result: response[:card_code]
184
- )
183
+ cvv_result: response[:card_code])
185
184
  end
186
185
 
187
186
  def success?(response)
@@ -11,12 +11,12 @@ module ActiveMerchant #:nodoc:
11
11
  self.money_format = :cents
12
12
  self.supported_cardtypes = %i[visa master american_express]
13
13
 
14
- def initialize(options={})
14
+ def initialize(options = {})
15
15
  requires!(options, :access_key)
16
16
  super
17
17
  end
18
18
 
19
- def purchase(amount, payment_method, options={})
19
+ def purchase(amount, payment_method, options = {})
20
20
  post = {}
21
21
  add_invoice(post, amount, options)
22
22
  add_payment_method(post, payment_method, options)
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  commit('purchase', post)
26
26
  end
27
27
 
28
- def authorize(amount, payment_method, options={})
28
+ def authorize(amount, payment_method, options = {})
29
29
  post = {}
30
30
  add_invoice(post, amount, options)
31
31
  add_payment_method(post, payment_method, options)
@@ -34,27 +34,27 @@ module ActiveMerchant #:nodoc:
34
34
  commit('authorize', post)
35
35
  end
36
36
 
37
- def capture(amount, authorization, options={})
37
+ def capture(amount, authorization, options = {})
38
38
  post = {}
39
39
  add_reference(post, authorization)
40
40
  add_invoice(post, amount, options)
41
41
  commit('capture', post)
42
42
  end
43
43
 
44
- def void(authorization, options={})
44
+ def void(authorization, options = {})
45
45
  post = {}
46
46
  add_reference(post, authorization)
47
47
  commit('void', post)
48
48
  end
49
49
 
50
- def refund(amount, authorization, options={})
50
+ def refund(amount, authorization, options = {})
51
51
  post = {}
52
52
  add_reference(post, authorization)
53
53
  add_invoice(post, amount, options)
54
54
  commit('refund', post)
55
55
  end
56
56
 
57
- def verify(credit_card, options={})
57
+ def verify(credit_card, options = {})
58
58
  MultiResponse.run(:use_first_response) do |r|
59
59
  r.process { authorize(250, credit_card, options) }
60
60
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -83,7 +83,7 @@ module ActiveMerchant #:nodoc:
83
83
  post['params[title]'] = options[:description] if options[:description]
84
84
  end
85
85
 
86
- def add_payment_method(post, payment_method, options={})
86
+ def add_payment_method(post, payment_method, options = {})
87
87
  post[:number] = payment_method.number
88
88
  post[:recurring] = 1 if options[:recurring] == true
89
89
  post[:cvc2] = payment_method.verification_value
@@ -70,7 +70,7 @@ module ActiveMerchant #:nodoc:
70
70
 
71
71
  # MiGS works by merchants being either purchase only or authorize/capture
72
72
  # So authorize is the same as purchase when in authorize mode
73
- alias_method :authorize, :purchase
73
+ alias authorize purchase
74
74
 
75
75
  # ==== Options
76
76
  #
@@ -123,7 +123,7 @@ module ActiveMerchant #:nodoc:
123
123
  refund(money, authorization, options)
124
124
  end
125
125
 
126
- def verify(credit_card, options={})
126
+ def verify(credit_card, options = {})
127
127
  MultiResponse.run do |r|
128
128
  r.process { authorize(100, credit_card, options) }
129
129
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -286,8 +286,7 @@ module ActiveMerchant #:nodoc:
286
286
  authorization: response[:TransactionNo],
287
287
  fraud_review: fraud_review?(response),
288
288
  avs_result: { code: avs_response_code },
289
- cvv_result: cvv_result_code
290
- )
289
+ cvv_result: cvv_result_code)
291
290
  end
292
291
 
293
292
  def success?(response)
@@ -148,15 +148,13 @@ module ActiveMerchant #:nodoc:
148
148
  def commit(action, params)
149
149
  data = ssl_post(url(action), build_request(action, params),
150
150
  { 'Content-Type' => 'text/xml; charset=utf-8',
151
- 'SOAPAction' => "#{xmlns(action)}#{action}" }
152
- )
151
+ 'SOAPAction' => "#{xmlns(action)}#{action}" })
153
152
 
154
153
  response = parse(action, data)
155
154
  Response.new(successful?(action, response), message_from(action, response), response,
156
155
  test: test?,
157
156
  authorization: authorization_from(action, response),
158
- avs_result: { code: response[:avs_code] }
159
- )
157
+ avs_result: { code: response[:avs_code] })
160
158
  end
161
159
 
162
160
  def authorization_from(action, response)
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
29
29
  # :login User login
30
30
  # :pwd User password
31
31
  #
32
- def initialize(options={})
32
+ def initialize(options = {})
33
33
  requires!(options, :sender_id, :channel_id, :login, :pwd)
34
34
  super
35
35
  end
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  # :currency Sale currency to override money object or default (optional)
46
46
  #
47
47
  # Returns Active Merchant response object
48
- def purchase(money, credit_card, options={})
48
+ def purchase(money, credit_card, options = {})
49
49
  execute_new_order(:purchase, money, credit_card, options)
50
50
  end
51
51
 
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
60
60
  # :currency Sale currency to override money object or default (optional)
61
61
  #
62
62
  # Returns Active Merchant response object
63
- def authorize(money, credit_card, options={})
63
+ def authorize(money, credit_card, options = {})
64
64
  execute_new_order(:authorize, money, credit_card, options)
65
65
  end
66
66
 
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
76
76
  # Note: you should pass either order_id or description
77
77
  #
78
78
  # Returns Active Merchant response object
79
- def capture(money, authorization, options={})
79
+ def capture(money, authorization, options = {})
80
80
  execute_dependant(:capture, money, authorization, options)
81
81
  end
82
82
 
@@ -92,7 +92,7 @@ module ActiveMerchant #:nodoc:
92
92
  # Note: you should pass either order_id or description
93
93
  #
94
94
  # Returns Active Merchant response object
95
- def refund(money, authorization, options={})
95
+ def refund(money, authorization, options = {})
96
96
  execute_dependant(:refund, money, authorization, options)
97
97
  end
98
98
 
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
103
103
  # :order_id Merchant created id for the authorization (optional)
104
104
  #
105
105
  # Returns Active Merchant response object
106
- def void(authorization, options={})
106
+ def void(authorization, options = {})
107
107
  execute_dependant(:void, nil, authorization, options)
108
108
  end
109
109
 
@@ -117,7 +117,7 @@ module ActiveMerchant #:nodoc:
117
117
  # :currency Sale currency to override money object or default (optional)
118
118
  #
119
119
  # Returns Active Merchant response object of Authorization operation
120
- def verify(credit_card, options={})
120
+ def verify(credit_card, options = {})
121
121
  MultiResponse.run(:use_first_response) do |r|
122
122
  r.process { authorize(100, credit_card, options) }
123
123
  r.process(:ignore_result) { void(r.authorization, options) }