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
@@ -23,7 +23,7 @@ module ActiveMerchant #:nodoc:
23
23
  unstore: 'DeleteCustomerCode'
24
24
  }
25
25
 
26
- def initialize(options={})
26
+ def initialize(options = {})
27
27
  if options[:login]
28
28
  ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'agent_code' and will be removed in a future version.")
29
29
  options[:agent_code] = options[:login]
@@ -35,18 +35,19 @@ module ActiveMerchant #:nodoc:
35
35
  super
36
36
  end
37
37
 
38
- def purchase(money, payment, options={})
38
+ def purchase(money, payment, options = {})
39
39
  post = {}
40
40
  add_invoice(post, money, options)
41
41
  add_payment(post, payment)
42
42
  add_address(post, options)
43
43
  add_ip(post, options)
44
44
  add_description(post, options)
45
+ add_customer_details(post, options)
45
46
 
46
47
  commit(determine_purchase_type(payment), post)
47
48
  end
48
49
 
49
- def refund(money, authorization, options={})
50
+ def refund(money, authorization, options = {})
50
51
  post = {}
51
52
  transaction_id, payment_type = split_authorization(authorization)
52
53
  post[:transaction_id] = transaction_id
@@ -160,6 +161,10 @@ module ActiveMerchant #:nodoc:
160
161
  post[:amount] = 0
161
162
  end
162
163
 
164
+ def add_customer_details(post, options)
165
+ post[:email] = options[:email] if options[:email]
166
+ end
167
+
163
168
  def expdate(creditcard)
164
169
  year = sprintf('%.4i', creditcard.year)
165
170
  month = sprintf('%.2i', creditcard.month)
@@ -181,7 +186,7 @@ module ActiveMerchant #:nodoc:
181
186
 
182
187
  def commit(action, parameters)
183
188
  response = parse(ssl_post(url(action), post_data(action, parameters),
184
- { 'Content-Type' => 'application/soap+xml; charset=utf-8'}))
189
+ { 'Content-Type' => 'application/soap+xml; charset=utf-8' }))
185
190
 
186
191
  Response.new(
187
192
  success_from(response),
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  self.live_redirect_url = 'https://www.paypal.com/checkoutnow'
6
6
 
7
7
  def redirect_url_for(token, options = {})
8
- options = {review: true}.update(options)
8
+ options = { review: true }.update(options)
9
9
  url = "#{redirect_url}?token=#{token}"
10
10
  url += '&useraction=commit' unless options[:review]
11
11
  url
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
96
96
  authorize(100, creditcard, options.merge(store: billing_id))
97
97
  end
98
98
 
99
- alias_method :unstore, :delete
99
+ alias unstore delete
100
100
 
101
101
  private
102
102
 
@@ -124,7 +124,7 @@ module ActiveMerchant #:nodoc:
124
124
  post[:orderdescription] = options[:description]
125
125
  end
126
126
 
127
- def add_payment_source(params, source, options={})
127
+ def add_payment_source(params, source, options = {})
128
128
  case determine_funding_source(source)
129
129
  when :vault then add_customer_vault_id(params, source)
130
130
  when :credit_card then add_creditcard(params, source, options)
@@ -176,8 +176,7 @@ module ActiveMerchant #:nodoc:
176
176
  authorization: response['transactionid'],
177
177
  test: test?,
178
178
  cvv_result: response['cvvresponse'],
179
- avs_result: { code: response['avsresponse'] }
180
- )
179
+ avs_result: { code: response['avsresponse'] })
181
180
  end
182
181
 
183
182
  def message_from(response)
@@ -143,8 +143,7 @@ module ActiveMerchant #:nodoc:
143
143
  Response.new(response[:success], response[:message], response,
144
144
  authorization: response[:transaction_id],
145
145
  avs_result: { code: response[:avs_result] },
146
- cvv_result: response[:cvv_result]
147
- )
146
+ cvv_result: response[:cvv_result])
148
147
  end
149
148
 
150
149
  def post_data(action, parameters = {})
@@ -21,13 +21,13 @@ module ActiveMerchant #:nodoc:
21
21
  '54' => STANDARD_ERROR_CODE[:expired_card]
22
22
  }
23
23
 
24
- def initialize(options={})
24
+ def initialize(options = {})
25
25
  ActiveMerchant.deprecated('IPP gateway is now named Bambora Asia-Pacific')
26
26
  requires!(options, :username, :password)
27
27
  super
28
28
  end
29
29
 
30
- def purchase(money, payment, options={})
30
+ def purchase(money, payment, options = {})
31
31
  commit('SubmitSinglePayment') do |xml|
32
32
  xml.Transaction do
33
33
  xml.CustRef options[:order_id]
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  end
41
41
  end
42
42
 
43
- def authorize(money, payment, options={})
43
+ def authorize(money, payment, options = {})
44
44
  commit('SubmitSinglePayment') do |xml|
45
45
  xml.Transaction do
46
46
  xml.CustRef options[:order_id]
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  end
54
54
  end
55
55
 
56
- def capture(money, authorization, options={})
56
+ def capture(money, authorization, options = {})
57
57
  commit('SubmitSingleCapture') do |xml|
58
58
  xml.Capture do
59
59
  xml.Receipt authorization
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  end
64
64
  end
65
65
 
66
- def refund(money, authorization, options={})
66
+ def refund(money, authorization, options = {})
67
67
  commit('SubmitSingleRefund') do |xml|
68
68
  xml.Refund do
69
69
  xml.Receipt authorization
@@ -251,16 +251,16 @@ module ActiveMerchant #:nodoc:
251
251
  commit(build_reference_request('COLLECTION', money, authorization, options), options)
252
252
  end
253
253
 
254
- def credit(money, authorization, options={})
254
+ def credit(money, authorization, options = {})
255
255
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
256
256
  refund(money, authorization, options)
257
257
  end
258
258
 
259
- def refund(money, authorization, options={})
259
+ def refund(money, authorization, options = {})
260
260
  commit(build_reference_request('REFUND', money, authorization, options), options)
261
261
  end
262
262
 
263
- def void(authorization, options={})
263
+ def void(authorization, options = {})
264
264
  commit(build_reference_request('VOID', nil, authorization, options), options)
265
265
  end
266
266
 
@@ -292,12 +292,12 @@ module ActiveMerchant #:nodoc:
292
292
  build_request(options) do |xml|
293
293
  if money
294
294
  currency = options[:currency] || currency(money)
295
- details = {'CurrencyCode' => currency_code(currency), 'Amount' => localized_amount(money, currency)}
295
+ details = { 'CurrencyCode' => currency_code(currency), 'Amount' => localized_amount(money, currency) }
296
296
  else
297
- details = {'CurrencyCode' => currency_code(default_currency), 'Amount' => '0'}
297
+ details = { 'CurrencyCode' => currency_code(default_currency), 'Amount' => '0' }
298
298
  end
299
299
  xml.tag! 'TransactionDetails', details do
300
- xml.tag! 'MessageDetails', {'TransactionType' => type, 'CrossReference' => cross_reference}
300
+ xml.tag! 'MessageDetails', { 'TransactionType' => type, 'CrossReference' => cross_reference }
301
301
  xml.tag! 'OrderID', (options[:order_id] || order_id)
302
302
  end
303
303
  end
@@ -309,9 +309,9 @@ module ActiveMerchant #:nodoc:
309
309
  xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
310
310
  xml.tag! 'soap:Envelope', { 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/',
311
311
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
312
- 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema'} do
312
+ 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema' } do
313
313
  xml.tag! 'soap:Body' do
314
- xml.tag! options[:action], {'xmlns' => 'https://www.thepaymentgateway.net/'} do
314
+ xml.tag! options[:action], { 'xmlns' => 'https://www.thepaymentgateway.net/' } do
315
315
  xml.tag! 'PaymentMessage' do
316
316
  add_merchant_data(xml, options)
317
317
  yield(xml)
@@ -330,8 +330,8 @@ module ActiveMerchant #:nodoc:
330
330
  def add_purchase_data(xml, type, money, options)
331
331
  currency = options[:currency] || currency(money)
332
332
  requires!(options, :order_id)
333
- xml.tag! 'TransactionDetails', {'Amount' => localized_amount(money, currency), 'CurrencyCode' => currency_code(currency)} do
334
- xml.tag! 'MessageDetails', {'TransactionType' => type}
333
+ xml.tag! 'TransactionDetails', { 'Amount' => localized_amount(money, currency), 'CurrencyCode' => currency_code(currency) } do
334
+ xml.tag! 'MessageDetails', { 'TransactionType' => type }
335
335
  xml.tag! 'OrderID', options[:order_id]
336
336
  xml.tag! 'TransactionControl' do
337
337
  xml.tag! 'ThreeDSecureOverridePolicy', 'FALSE'
@@ -371,13 +371,13 @@ module ActiveMerchant #:nodoc:
371
371
  end
372
372
 
373
373
  def add_merchant_data(xml, options)
374
- xml.tag! 'MerchantAuthentication', {'MerchantID' => @options[:login], 'Password' => @options[:password]}
374
+ xml.tag! 'MerchantAuthentication', { 'MerchantID' => @options[:login], 'Password' => @options[:password] }
375
375
  end
376
376
 
377
377
  def commit(request, options)
378
378
  requires!(options, :action)
379
379
  response = parse(ssl_post(test? ? self.test_url : self.live_url, request,
380
- {'SOAPAction' => 'https://www.thepaymentgateway.net/' + options[:action],
380
+ { 'SOAPAction' => 'https://www.thepaymentgateway.net/' + options[:action],
381
381
  'Content-Type' => 'text/xml; charset=utf-8' }))
382
382
 
383
383
  success = response[:transaction_result][:status_code] == '0'
@@ -391,14 +391,13 @@ module ActiveMerchant #:nodoc:
391
391
  street_match: AVS_CODE[ response[:transaction_output_data][:address_numeric_check_result] ],
392
392
  postal_match: AVS_CODE[ response[:transaction_output_data][:post_code_check_result] ]
393
393
  },
394
- cvv_result: CVV_CODE[ response[:transaction_output_data][:cv2_check_result] ]
395
- )
394
+ cvv_result: CVV_CODE[ response[:transaction_output_data][:cv2_check_result] ])
396
395
  end
397
396
 
398
397
  def parse(xml)
399
398
  reply = {}
400
399
  xml = REXML::Document.new(xml)
401
- if (root = REXML::XPath.first(xml, '//CardDetailsTransactionResponse')) or
400
+ if (root = REXML::XPath.first(xml, '//CardDetailsTransactionResponse')) ||
402
401
  (root = REXML::XPath.first(xml, '//CrossReferenceTransactionResponse'))
403
402
  root.elements.to_a.each do |node|
404
403
  case node.name
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
13
13
  self.homepage_url = 'http://www.iveri.com'
14
14
  self.display_name = 'iVeri'
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :app_id, :cert_id)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(money, payment_method, options={})
21
+ def purchase(money, payment_method, options = {})
22
22
  post = build_vxml_request('Debit', options) do |xml|
23
23
  add_auth_purchase_params(xml, money, payment_method, options)
24
24
  end
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
26
26
  commit(post)
27
27
  end
28
28
 
29
- def authorize(money, payment_method, options={})
29
+ def authorize(money, payment_method, options = {})
30
30
  post = build_vxml_request('Authorisation', options) do |xml|
31
31
  add_auth_purchase_params(xml, money, payment_method, options)
32
32
  end
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  commit(post)
35
35
  end
36
36
 
37
- def capture(money, authorization, options={})
37
+ def capture(money, authorization, options = {})
38
38
  post = build_vxml_request('Debit', options) do |xml|
39
39
  add_authorization(xml, authorization, options)
40
40
  end
@@ -42,7 +42,7 @@ module ActiveMerchant #:nodoc:
42
42
  commit(post)
43
43
  end
44
44
 
45
- def refund(money, authorization, options={})
45
+ def refund(money, authorization, options = {})
46
46
  post = build_vxml_request('Credit', options) do |xml|
47
47
  add_amount(xml, money, options)
48
48
  add_authorization(xml, authorization, options)
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
51
51
  commit(post)
52
52
  end
53
53
 
54
- def void(authorization, options={})
54
+ def void(authorization, options = {})
55
55
  post = build_vxml_request('Void', options) do |xml|
56
56
  add_authorization(xml, authorization, options)
57
57
  end
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  commit(post)
60
60
  end
61
61
 
62
- def verify(credit_card, options={})
62
+ def verify(credit_card, options = {})
63
63
  MultiResponse.run(:use_first_response) do |r|
64
64
  r.process { authorize(100, credit_card, options) }
65
65
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -14,13 +14,13 @@ module ActiveMerchant #:nodoc:
14
14
  self.homepage_url = 'https://www.ixopay.com'
15
15
  self.display_name = 'Ixopay'
16
16
 
17
- def initialize(options={})
17
+ def initialize(options = {})
18
18
  requires!(options, :username, :password, :secret, :api_key)
19
19
  @secret = options[:secret]
20
20
  super
21
21
  end
22
22
 
23
- def purchase(money, payment_method, options={})
23
+ def purchase(money, payment_method, options = {})
24
24
  request = build_xml_request do |xml|
25
25
  add_card_data(xml, payment_method)
26
26
  add_debit(xml, money, options)
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
29
29
  commit(request)
30
30
  end
31
31
 
32
- def authorize(money, payment_method, options={})
32
+ def authorize(money, payment_method, options = {})
33
33
  request = build_xml_request do |xml|
34
34
  add_card_data(xml, payment_method)
35
35
  add_preauth(xml, money, options)
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  commit(request)
39
39
  end
40
40
 
41
- def capture(money, authorization, options={})
41
+ def capture(money, authorization, options = {})
42
42
  request = build_xml_request do |xml|
43
43
  add_capture(xml, money, authorization, options)
44
44
  end
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  commit(request)
47
47
  end
48
48
 
49
- def refund(money, authorization, options={})
49
+ def refund(money, authorization, options = {})
50
50
  request = build_xml_request do |xml|
51
51
  add_refund(xml, money, authorization, options)
52
52
  end
@@ -54,7 +54,7 @@ module ActiveMerchant #:nodoc:
54
54
  commit(request)
55
55
  end
56
56
 
57
- def void(authorization, options={})
57
+ def void(authorization, options = {})
58
58
  request = build_xml_request do |xml|
59
59
  add_void(xml, authorization)
60
60
  end
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
62
62
  commit(request)
63
63
  end
64
64
 
65
- def verify(credit_card, options={})
65
+ def verify(credit_card, options = {})
66
66
  MultiResponse.run(:use_first_response) do |r|
67
67
  r.process { authorize(100, credit_card, options) }
68
68
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -290,8 +290,7 @@ module ActiveMerchant #:nodoc:
290
290
  test: test?,
291
291
  authorization: authorization_from(response, money, token),
292
292
  avs_result: { code: response[:avs] },
293
- cvv_result: response[:cvv2]
294
- )
293
+ cvv_result: response[:cvv2])
295
294
  end
296
295
 
297
296
  def url
@@ -210,8 +210,8 @@ module ActiveMerchant #:nodoc:
210
210
  xml.tag! 'TransactionID', transaction_id.nil? ? generate_unique_id.slice(0, 18) : transaction_id
211
211
  xml.tag! 'Origin', options[:origin] || 'INTERNET'
212
212
  xml.tag! 'IndustryInfo', 'Type' => options[:industry_info] || 'ECOMMERCE'
213
- xml.tag! 'Application', (options[:application] || 'n/a'), {'Version' => options[:application_version] || '1.0'}
214
- xml.tag! 'Device', (options[:device] || 'n/a'), {'Version' => options[:device_version] || '1.0'}
213
+ xml.tag! 'Application', (options[:application] || 'n/a'), { 'Version' => options[:application_version] || '1.0' }
214
+ xml.tag! 'Device', (options[:device] || 'n/a'), { 'Version' => options[:device_version] || '1.0' }
215
215
  xml.tag! 'Library', 'VirtPOS SDK', 'Version' => '1.5'
216
216
  xml.tag! 'Gateway', 'JetPay'
217
217
  xml.tag! 'DeveloperID', options[:developer_id] || 'n/a'
@@ -302,8 +302,7 @@ module ActiveMerchant #:nodoc:
302
302
  authorization: authorization_from(response, money, token),
303
303
  avs_result: AVSResult.new(code: response[:avs]),
304
304
  cvv_result: CVVResult.new(response[:cvv2]),
305
- error_code: success ? nil : error_code_from(response)
306
- )
305
+ error_code: success ? nil : error_code_from(response))
307
306
  end
308
307
 
309
308
  def url
@@ -406,7 +405,7 @@ module ActiveMerchant #:nodoc:
406
405
  def add_invoice_data(xml, options)
407
406
  xml.tag! 'OrderNumber', options[:order_id] if options[:order_id]
408
407
  if tax_amount = options[:tax_amount]
409
- xml.tag! 'TaxAmount', tax_amount, {'ExemptInd' => options[:tax_exempt] || 'false'}
408
+ xml.tag! 'TaxAmount', tax_amount, { 'ExemptInd' => options[:tax_exempt] || 'false' }
410
409
  end
411
410
  end
412
411
 
@@ -12,26 +12,26 @@ module ActiveMerchant #:nodoc:
12
12
  self.money_format = :dollars
13
13
  self.supported_cardtypes = %i[visa master american_express discover diners_club alia]
14
14
 
15
- def initialize(options={})
15
+ def initialize(options = {})
16
16
  requires!(options, :public_merchant_id, :private_merchant_id)
17
17
  super
18
18
  end
19
19
 
20
- def purchase(amount, payment_method, options={})
20
+ def purchase(amount, payment_method, options = {})
21
21
  MultiResponse.run() do |r|
22
22
  r.process { tokenize(amount, payment_method, options) }
23
23
  r.process { charge(amount, r.authorization, options) }
24
24
  end
25
25
  end
26
26
 
27
- def authorize(amount, payment_method, options={})
27
+ def authorize(amount, payment_method, options = {})
28
28
  MultiResponse.run() do |r|
29
29
  r.process { tokenize(amount, payment_method, options) }
30
30
  r.process { preauthorize(amount, r.authorization, options) }
31
31
  end
32
32
  end
33
33
 
34
- def capture(amount, authorization, options={})
34
+ def capture(amount, authorization, options = {})
35
35
  action = 'capture'
36
36
 
37
37
  post = {}
@@ -41,7 +41,7 @@ module ActiveMerchant #:nodoc:
41
41
  commit(action, post)
42
42
  end
43
43
 
44
- def refund(amount, authorization, options={})
44
+ def refund(amount, authorization, options = {})
45
45
  action = 'refund'
46
46
 
47
47
  post = {}
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
50
50
  commit(action, post)
51
51
  end
52
52
 
53
- def void(authorization, options={})
53
+ def void(authorization, options = {})
54
54
  action = 'void'
55
55
 
56
56
  post = {}
@@ -51,12 +51,12 @@ module ActiveMerchant #:nodoc:
51
51
  'jcb' => 'JC'
52
52
  }
53
53
 
54
- def initialize(options={})
54
+ def initialize(options = {})
55
55
  requires!(options, :account_number, :configuration_id, :secret)
56
56
  super
57
57
  end
58
58
 
59
- def purchase(amount, payment_method, options={})
59
+ def purchase(amount, payment_method, options = {})
60
60
  if payment_method.is_a?(String)
61
61
  auth_or_sale('sale', payment_method, amount, nil, options)
62
62
  else
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
68
68
  end
69
69
  end
70
70
 
71
- def authorize(amount, payment_method, options={})
71
+ def authorize(amount, payment_method, options = {})
72
72
  if payment_method.is_a?(String)
73
73
  auth_or_sale('auth', payment_method, amount, nil, options)
74
74
  else
@@ -80,7 +80,7 @@ module ActiveMerchant #:nodoc:
80
80
  end
81
81
  end
82
82
 
83
- def capture(amount, authorization, options={})
83
+ def capture(amount, authorization, options = {})
84
84
  post = {}
85
85
  post[:method] = 'deposit'
86
86
  add_request_id(post)
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
96
96
  commit('v1/', post)
97
97
  end
98
98
 
99
- def void(authorization, options={})
99
+ def void(authorization, options = {})
100
100
  method, pgwTID = split_authorization(authorization)
101
101
  case method
102
102
  when 'auth'
@@ -109,7 +109,7 @@ module ActiveMerchant #:nodoc:
109
109
  end
110
110
  end
111
111
 
112
- def credit(amount, payment_method, options={})
112
+ def credit(amount, payment_method, options = {})
113
113
  if payment_method.is_a?(String)
114
114
  refundWithCard(payment_method, amount, nil, options)
115
115
  else
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
121
121
  end
122
122
  end
123
123
 
124
- def verify(payment_method, options={}, action=nil)
124
+ def verify(payment_method, options = {}, action = nil)
125
125
  if payment_method.is_a?(String)
126
126
  verifyOnly(action, payment_method, nil, options)
127
127
  else
@@ -133,7 +133,7 @@ module ActiveMerchant #:nodoc:
133
133
  end
134
134
  end
135
135
 
136
- def store(payment_method, options={})
136
+ def store(payment_method, options = {})
137
137
  verify(payment_method, options, 'store')
138
138
  end
139
139
 
@@ -201,7 +201,7 @@ module ActiveMerchant #:nodoc:
201
201
  end
202
202
  end
203
203
 
204
- def get_session(options={})
204
+ def get_session(options = {})
205
205
  post = {}
206
206
  post[:method] = 'getSession'
207
207
  add_request_id(post)
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
213
213
  commit('session', post)
214
214
  end
215
215
 
216
- def get_token(authorization, payment_method, options={})
216
+ def get_token(authorization, payment_method, options = {})
217
217
  post = {}
218
218
  post[:method] = 'tokenize'
219
219
  add_request_id(post)
@@ -226,7 +226,7 @@ module ActiveMerchant #:nodoc:
226
226
  commit('token', post)
227
227
  end
228
228
 
229
- def auth_or_sale(method, authorization, amount, credit_card, options={})
229
+ def auth_or_sale(method, authorization, amount, credit_card, options = {})
230
230
  post = {}
231
231
  post[:method] = method
232
232
  add_request_id(post)
@@ -246,7 +246,7 @@ module ActiveMerchant #:nodoc:
246
246
  commit('v1/', post)
247
247
  end
248
248
 
249
- def verifyOnly(action, authorization, credit_card, options={})
249
+ def verifyOnly(action, authorization, credit_card, options = {})
250
250
  post = {}
251
251
  post[:method] = 'verifyOnly'
252
252
  add_request_id(post)
@@ -267,7 +267,7 @@ module ActiveMerchant #:nodoc:
267
267
  commit('v1/', post)
268
268
  end
269
269
 
270
- def refundWithCard(authorization, amount, credit_card, options={})
270
+ def refundWithCard(authorization, amount, credit_card, options = {})
271
271
  post = {}
272
272
  post[:method] = 'refundWithCard'
273
273
  add_request_id(post)
@@ -286,7 +286,7 @@ module ActiveMerchant #:nodoc:
286
286
  commit('v1/', post)
287
287
  end
288
288
 
289
- def reverse_or_void(method, pgwTID, options={})
289
+ def reverse_or_void(method, pgwTID, options = {})
290
290
  post = {}
291
291
  post[:method] = method
292
292
  add_request_id(post)