activemerchant 1.114.0 → 1.120.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +183 -0
  3. data/README.md +4 -2
  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/check.rb +10 -0
  7. data/lib/active_merchant/billing/compatibility.rb +3 -3
  8. data/lib/active_merchant/billing/credit_card.rb +3 -0
  9. data/lib/active_merchant/billing/credit_card_methods.rb +80 -15
  10. data/lib/active_merchant/billing/gateways/adyen.rb +44 -20
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -12
  13. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  14. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +5 -1
  15. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  16. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  17. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  19. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  21. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  23. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  24. data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -18
  25. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  27. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  28. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +60 -17
  30. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  31. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  32. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  36. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cashnet.rb +7 -2
  38. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  39. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  40. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/checkout_v2.rb +38 -20
  42. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  43. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  45. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/credorax.rb +39 -23
  47. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  48. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  49. data/lib/active_merchant/billing/gateways/cyber_source.rb +81 -39
  50. data/lib/active_merchant/billing/gateways/d_local.rb +12 -12
  51. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  52. data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
  53. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  54. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  55. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  56. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  57. data/lib/active_merchant/billing/gateways/elavon.rb +296 -225
  58. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  59. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  60. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  61. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  62. data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
  63. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  64. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  65. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  66. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  67. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  69. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  70. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  71. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  72. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  73. data/lib/active_merchant/billing/gateways/forte.rb +26 -8
  74. data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
  75. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  76. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  77. data/lib/active_merchant/billing/gateways/hps.rb +72 -9
  78. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  79. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  80. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  81. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  82. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  83. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  84. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  85. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  86. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  87. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  88. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  91. data/lib/active_merchant/billing/gateways/litle.rb +32 -16
  92. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  93. data/lib/active_merchant/billing/gateways/mercado_pago.rb +9 -9
  94. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  95. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  96. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  97. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  98. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  99. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  100. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  101. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  102. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  103. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  104. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  105. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  106. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  107. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  108. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  109. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  110. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  111. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  112. data/lib/active_merchant/billing/gateways/netbanx.rb +45 -10
  113. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  114. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  115. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  116. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  117. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  118. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  120. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  121. data/lib/active_merchant/billing/gateways/orbital.rb +225 -105
  122. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  123. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  125. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  126. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  127. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  128. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  130. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  131. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  132. data/lib/active_merchant/billing/gateways/payeezy.rb +62 -20
  133. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  134. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payment_express.rb +11 -7
  136. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  137. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  138. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  139. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  140. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  141. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  143. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  144. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  145. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  146. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  147. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  148. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  149. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  152. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  153. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  154. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  157. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/qvalent.rb +31 -17
  159. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/redsys.rb +105 -9
  161. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  162. data/lib/active_merchant/billing/gateways/safe_charge.rb +51 -18
  163. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  164. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  165. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  166. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  168. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  169. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  170. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  171. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  172. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  173. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  174. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  175. data/lib/active_merchant/billing/gateways/stripe.rb +18 -18
  176. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +91 -25
  177. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  179. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  180. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  181. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  182. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  183. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  185. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  186. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  187. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  188. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  189. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  190. data/lib/active_merchant/billing/gateways/vpos.rb +172 -0
  191. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  192. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  193. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  194. data/lib/active_merchant/billing/gateways/worldpay.rb +43 -22
  195. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  196. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  197. data/lib/active_merchant/billing/response.rb +3 -2
  198. data/lib/active_merchant/country.rb +1 -1
  199. data/lib/active_merchant/network_connection_retries.rb +2 -2
  200. data/lib/active_merchant/post_data.rb +1 -1
  201. data/lib/active_merchant/posts_data.rb +1 -1
  202. data/lib/active_merchant/version.rb +1 -1
  203. data/lib/certs/cacert.pem +1582 -2431
  204. data/lib/support/ssl_verify.rb +2 -2
  205. data/lib/support/ssl_version.rb +2 -2
  206. metadata +5 -3
@@ -1,12 +1,12 @@
1
1
  module ActiveMerchant
2
2
  module Billing
3
3
  module MastercardGateway
4
- def initialize(options={})
4
+ def initialize(options = {})
5
5
  requires!(options, :userid, :password)
6
6
  super
7
7
  end
8
8
 
9
- def purchase(amount, payment_method, options={})
9
+ def purchase(amount, payment_method, options = {})
10
10
  if options[:pay_mode]
11
11
  post = new_post
12
12
  add_invoice(post, amount, options)
@@ -24,7 +24,7 @@ module ActiveMerchant
24
24
  end
25
25
  end
26
26
 
27
- def authorize(amount, payment_method, options={})
27
+ def authorize(amount, payment_method, options = {})
28
28
  post = new_post
29
29
  add_invoice(post, amount, options)
30
30
  add_reference(post, *new_authorization)
@@ -35,7 +35,7 @@ module ActiveMerchant
35
35
  commit('authorize', post)
36
36
  end
37
37
 
38
- def capture(amount, authorization, options={})
38
+ def capture(amount, authorization, options = {})
39
39
  post = new_post
40
40
  add_invoice(post, amount, options, :transaction)
41
41
  add_reference(post, *next_authorization(authorization))
@@ -45,7 +45,7 @@ module ActiveMerchant
45
45
  commit('capture', post)
46
46
  end
47
47
 
48
- def refund(amount, authorization, options={})
48
+ def refund(amount, authorization, options = {})
49
49
  post = new_post
50
50
  add_invoice(post, amount, options, :transaction)
51
51
  add_reference(post, *next_authorization(authorization))
@@ -54,14 +54,14 @@ module ActiveMerchant
54
54
  commit('refund', post)
55
55
  end
56
56
 
57
- def void(authorization, options={})
57
+ def void(authorization, options = {})
58
58
  post = new_post
59
59
  add_reference(post, *next_authorization(authorization), :targetTransactionId)
60
60
 
61
61
  commit('void', post)
62
62
  end
63
63
 
64
- def verify(credit_card, options={})
64
+ def verify(credit_card, options = {})
65
65
  MultiResponse.run(:use_first_response) do |r|
66
66
  r.process { authorize(100, credit_card, options) }
67
67
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -109,12 +109,12 @@ module ActiveMerchant
109
109
  }
110
110
  end
111
111
 
112
- def add_invoice(post, amount, options, node=:order)
112
+ def add_invoice(post, amount, options, node = :order)
113
113
  post[node][:amount] = amount(amount)
114
114
  post[node][:currency] = (options[:currency] || currency(amount))
115
115
  end
116
116
 
117
- def add_reference(post, orderid, transactionid, transaction_reference, reference_key=:reference)
117
+ def add_reference(post, orderid, transactionid, transaction_reference, reference_key = :reference)
118
118
  post[:orderid] = orderid
119
119
  post[:transactionid] = transactionid
120
120
  post[:transaction][reference_key] = transaction_reference if transaction_reference
@@ -176,7 +176,7 @@ module ActiveMerchant
176
176
  def add_3dsecure_id(post, options)
177
177
  return unless options[:threed_secure_id]
178
178
 
179
- post.merge!({'3DSecureId' => options[:threed_secure_id]})
179
+ post.merge!({ '3DSecureId' => options[:threed_secure_id] })
180
180
  end
181
181
 
182
182
  def country_code(country)
@@ -4,18 +4,18 @@ module ActiveMerchant #:nodoc:
4
4
  self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
5
5
 
6
6
  self.supported_countries = %w[AR BR CL CO MX PE UY]
7
- self.supported_cardtypes = %i[visa master american_express elo cabal naranja]
7
+ self.supported_cardtypes = %i[visa master american_express elo cabal naranja creditel]
8
8
 
9
9
  self.homepage_url = 'https://www.mercadopago.com/'
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) }
@@ -105,7 +105,7 @@ module ActiveMerchant #:nodoc:
105
105
 
106
106
  def authorize_request(money, payment, options = {})
107
107
  post = purchase_request(money, payment, options)
108
- post[:capture] = false
108
+ post[:capture] = options[:capture] || false
109
109
  post
110
110
  end
111
111
 
@@ -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