activemerchant 1.110.0 → 1.116.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +82 -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.rb +1 -1
  7. data/lib/active_merchant/billing/credit_card_methods.rb +6 -6
  8. data/lib/active_merchant/billing/gateway.rb +1 -1
  9. data/lib/active_merchant/billing/gateways/adyen.rb +30 -15
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -17
  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 -2
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  15. data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
  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 +83 -23
  24. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  25. data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
  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 +14 -17
  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 +8 -8
  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 +11 -11
  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 +15 -9
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -37
  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 +10 -9
  51. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  52. data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
  53. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  54. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
  55. data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
  56. data/lib/active_merchant/billing/gateways/element.rb +12 -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 +8 -8
  61. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  62. data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -7
  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 +4 -4
  69. data/lib/active_merchant/billing/gateways/flo2cash.rb +9 -9
  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 +15 -10
  73. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
  75. data/lib/active_merchant/billing/gateways/hps.rb +16 -13
  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 +7 -7
  81. data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
  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 +5 -6
  89. data/lib/active_merchant/billing/gateways/litle.rb +12 -12
  90. data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
  91. data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
  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 +12 -10
  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 +4 -5
  117. data/lib/active_merchant/billing/gateways/opp.rb +12 -12
  118. data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/orbital.rb +66 -64
  120. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  121. data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
  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 +4 -5
  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 +12 -12
  131. data/lib/active_merchant/billing/gateways/payex.rb +11 -12
  132. data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
  133. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  134. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  136. data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
  137. data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
  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 +21 -11
  144. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  145. data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -3
  146. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  147. data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
  148. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  149. data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
  150. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  151. data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
  152. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  153. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  154. data/lib/active_merchant/billing/gateways/qvalent.rb +9 -9
  155. data/lib/active_merchant/billing/gateways/realex.rb +2 -1
  156. data/lib/active_merchant/billing/gateways/redsys.rb +7 -7
  157. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  158. data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
  159. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  160. data/lib/active_merchant/billing/gateways/sage_pay.rb +6 -7
  161. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  162. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  163. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  164. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  165. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  166. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  167. data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -4
  168. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  169. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  170. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  171. data/lib/active_merchant/billing/gateways/stripe.rb +11 -11
  172. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
  173. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  174. data/lib/active_merchant/billing/gateways/telr.rb +9 -9
  175. data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
  176. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
  177. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  178. data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
  179. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  180. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
  181. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
  182. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  183. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  184. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  186. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  187. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  188. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  189. data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
  190. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  191. data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
  192. data/lib/active_merchant/billing/response.rb +1 -1
  193. data/lib/active_merchant/country.rb +1 -1
  194. data/lib/active_merchant/network_connection_retries.rb +2 -2
  195. data/lib/active_merchant/post_data.rb +1 -1
  196. data/lib/active_merchant/posts_data.rb +1 -1
  197. data/lib/active_merchant/version.rb +1 -1
  198. data/lib/support/ssl_verify.rb +2 -2
  199. data/lib/support/ssl_version.rb +2 -2
  200. metadata +16 -2
@@ -17,12 +17,12 @@ module ActiveMerchant #:nodoc:
17
17
  SERVICE_TEST_URL = 'https://certservices.elementexpress.com/express.asmx'
18
18
  SERVICE_LIVE_URL = 'https://services.elementexpress.com/express.asmx'
19
19
 
20
- def initialize(options={})
20
+ def initialize(options = {})
21
21
  requires!(options, :account_id, :account_token, :application_id, :acceptor_id, :application_name, :application_version)
22
22
  super
23
23
  end
24
24
 
25
- def purchase(money, payment, options={})
25
+ def purchase(money, payment, options = {})
26
26
  action = payment.is_a?(Check) ? 'CheckSale' : 'CreditCardSale'
27
27
 
28
28
  request = build_soap_request do |xml|
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  commit(action, request, money)
39
39
  end
40
40
 
41
- def authorize(money, payment, options={})
41
+ def authorize(money, payment, options = {})
42
42
  request = build_soap_request do |xml|
43
43
  xml.CreditCardAuthorization(xmlns: 'https://transaction.elementexpress.com') do
44
44
  add_credentials(xml)
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
52
52
  commit('CreditCardAuthorization', request, money)
53
53
  end
54
54
 
55
- def capture(money, authorization, options={})
55
+ def capture(money, authorization, options = {})
56
56
  trans_id, = split_authorization(authorization)
57
57
  options[:trans_id] = trans_id
58
58
 
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
  commit('CreditCardAuthorizationCompletion', request, money)
68
68
  end
69
69
 
70
- def refund(money, authorization, options={})
70
+ def refund(money, authorization, options = {})
71
71
  trans_id, = split_authorization(authorization)
72
72
  options[:trans_id] = trans_id
73
73
 
@@ -82,9 +82,9 @@ module ActiveMerchant #:nodoc:
82
82
  commit('CreditCardReturn', request, money)
83
83
  end
84
84
 
85
- def void(authorization, options={})
85
+ def void(authorization, options = {})
86
86
  trans_id, trans_amount = split_authorization(authorization)
87
- options.merge!({trans_id: trans_id, trans_amount: trans_amount, reversal_type: 'Full'})
87
+ options.merge!({ trans_id: trans_id, trans_amount: trans_amount, reversal_type: 'Full' })
88
88
 
89
89
  request = build_soap_request do |xml|
90
90
  xml.CreditCardReversal(xmlns: 'https://transaction.elementexpress.com') do
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  commit('PaymentAccountCreate', request, nil)
111
111
  end
112
112
 
113
- def verify(credit_card, options={})
113
+ def verify(credit_card, options = {})
114
114
  request = build_soap_request do |xml|
115
115
  xml.CreditCardAVSOnly(xmlns: 'https://transaction.elementexpress.com') do
116
116
  add_credentials(xml)
@@ -188,6 +188,10 @@ module ActiveMerchant #:nodoc:
188
188
  xml.TransactionAmount amount(money.to_i) if money
189
189
  xml.MarketCode 'Default' if money
190
190
  xml.ReferenceNumber options[:order_id] || SecureRandom.hex(20)
191
+
192
+ xml.PaymentType options[:payment_type] if options[:payment_type]
193
+ xml.SubmissionType options[:submission_type] if options[:submission_type]
194
+ xml.DuplicateCheckDisableFlag options[:duplicate_check_disable_flag].to_s == 'true' ? 'True' : 'False' unless options[:duplicate_check_disable_flag].nil?
191
195
  end
192
196
  end
193
197
 
@@ -153,7 +153,7 @@ module ActiveMerchant #:nodoc:
153
153
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
154
154
  # from {Response#authorization}.
155
155
  def refund(money, identification)
156
- post = {transactionid: identification}
156
+ post = { transactionid: identification }
157
157
  commit('refund', money, post)
158
158
  end
159
159
 
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
181
181
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
182
182
  # from {Response#authorization}.
183
183
  def void(identification)
184
- post = {transactionid: identification}
184
+ post = { transactionid: identification }
185
185
  commit('void', nil, post)
186
186
  end
187
187
 
@@ -192,7 +192,7 @@ module ActiveMerchant #:nodoc:
192
192
  # The <tt>identification</tt> parameter is the transaction ID, retrieved
193
193
  # from {Response#authorization}.
194
194
  def update(identification, options)
195
- post = {transactionid: identification}
195
+ post = { transactionid: identification }
196
196
  add_order(post, options)
197
197
  commit('update', nil, post)
198
198
  end
@@ -283,8 +283,7 @@ module ActiveMerchant #:nodoc:
283
283
  test: test?,
284
284
  authorization: response['transactionid'],
285
285
  avs_result: { code: response['avsresponse'] },
286
- cvv_result: response['cvvresponse']
287
- )
286
+ cvv_result: response['cvvresponse'])
288
287
  end
289
288
 
290
289
  def message_from(response)
@@ -292,7 +291,7 @@ module ActiveMerchant #:nodoc:
292
291
  end
293
292
 
294
293
  def post_data(action, parameters = {})
295
- post = {type: action}
294
+ post = { type: action }
296
295
 
297
296
  if test?
298
297
  post[:username] = 'demo'
@@ -38,7 +38,7 @@ module ActiveMerchant #:nodoc:
38
38
  commit(purchase_url(post[:CVN]), money, post)
39
39
  end
40
40
 
41
- def refund(money, authorization, options={})
41
+ def refund(money, authorization, options = {})
42
42
  post = {}
43
43
 
44
44
  add_customer_id(post)
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
66
66
  private
67
67
 
68
68
  def requires_address!(options)
69
- raise ArgumentError.new('Missing eWay required parameters: address or billing_address') unless options.has_key?(:address) or options.has_key?(:billing_address)
69
+ raise ArgumentError.new('Missing eWay required parameters: address or billing_address') unless options.has_key?(:address) || options.has_key?(:billing_address)
70
70
  end
71
71
 
72
72
  def add_creditcard(post, creditcard)
@@ -115,8 +115,7 @@ module ActiveMerchant #:nodoc:
115
115
  message_from(response[:ewaytrxnerror]),
116
116
  response,
117
117
  authorization: response[:ewaytrxnnumber],
118
- test: test?
119
- )
118
+ test: test?)
120
119
  end
121
120
 
122
121
  def success?(response)
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
49
49
  commit('CreateCustomer', post)
50
50
  end
51
51
 
52
- def update(billing_id, creditcard, options={})
52
+ def update(billing_id, creditcard, options = {})
53
53
  post = {}
54
54
 
55
55
  # Handle our required fields
@@ -80,7 +80,7 @@ module ActiveMerchant #:nodoc:
80
80
  # * <tt>:order_id</tt> -- The order number, passed to eWay as the "Invoice Reference"
81
81
  # * <tt>:invoice</tt> -- The invoice number, passed to eWay as the "Invoice Reference" unless :order_id is also given
82
82
  # * <tt>:description</tt> -- A description of the payment, passed to eWay as the "Invoice Description"
83
- def purchase(money, billing_id, options={})
83
+ def purchase(money, billing_id, options = {})
84
84
  post = {}
85
85
  post[:managedCustomerID] = billing_id.to_s
86
86
  post[:amount] = money
@@ -224,8 +224,7 @@ module ActiveMerchant #:nodoc:
224
224
 
225
225
  EwayResponse.new(response[:success], response[:message], response,
226
226
  test: test?,
227
- authorization: response[:auth_code]
228
- )
227
+ authorization: response[:auth_code])
229
228
  end
230
229
 
231
230
  # Where we build the full SOAP 1.2 request using builder
@@ -244,16 +243,16 @@ module ActiveMerchant #:nodoc:
244
243
 
245
244
  xml = Builder::XmlMarkup.new indent: 2
246
245
  xml.instruct!
247
- xml.tag! 'soap12:Envelope', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope'} do
246
+ xml.tag! 'soap12:Envelope', { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap12' => 'http://www.w3.org/2003/05/soap-envelope' } do
248
247
  xml.tag! 'soap12:Header' do
249
- xml.tag! 'eWAYHeader', {'xmlns' => 'https://www.eway.com.au/gateway/managedpayment'} do
248
+ xml.tag! 'eWAYHeader', { 'xmlns' => 'https://www.eway.com.au/gateway/managedpayment' } do
250
249
  xml.tag! 'eWAYCustomerID', @options[:login]
251
250
  xml.tag! 'Username', @options[:username]
252
251
  xml.tag! 'Password', @options[:password]
253
252
  end
254
253
  end
255
254
  xml.tag! 'soap12:Body' do |x|
256
- x.tag! action, {'xmlns' => 'https://www.eway.com.au/gateway/managedpayment'} do |y|
255
+ x.tag! action, { 'xmlns' => 'https://www.eway.com.au/gateway/managedpayment' } do |y|
257
256
  post.each do |key, value|
258
257
  y.tag! key, value
259
258
  end
@@ -47,7 +47,7 @@ module ActiveMerchant #:nodoc:
47
47
  # (default: "https://github.com/activemerchant/active_merchant")
48
48
  #
49
49
  # Returns an ActiveMerchant::Billing::Response object where authorization is the Transaction ID on success
50
- def purchase(amount, payment_method, options={})
50
+ def purchase(amount, payment_method, options = {})
51
51
  params = {}
52
52
  add_metadata(params, options)
53
53
  add_invoice(params, amount, options)
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  commit(url_for('Transaction'), params)
58
58
  end
59
59
 
60
- def authorize(amount, payment_method, options={})
60
+ def authorize(amount, payment_method, options = {})
61
61
  params = {}
62
62
  add_metadata(params, options)
63
63
  add_invoice(params, amount, options)
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
204
204
  'InvoiceReference' => truncate(options[:order_id], 50),
205
205
  'InvoiceNumber' => truncate(options[:invoice] || options[:order_id], 12),
206
206
  'InvoiceDescription' => truncate(options[:description], 64),
207
- 'CurrencyCode' => currency_code,
207
+ 'CurrencyCode' => currency_code
208
208
  }
209
209
  end
210
210
 
@@ -232,7 +232,7 @@ module ActiveMerchant #:nodoc:
232
232
  params[key] = {}
233
233
 
234
234
  add_name_and_email(params[key], options[:shipping_address], options[:email])
235
- add_address(params[key], options[:shipping_address], {skip_company: true})
235
+ add_address(params[key], options[:shipping_address], { skip_company: true })
236
236
  end
237
237
 
238
238
  def add_name_and_email(params, address, email, payment_method = nil)
@@ -251,7 +251,7 @@ module ActiveMerchant #:nodoc:
251
251
  payment_method.first_name.present? && payment_method.last_name.present?
252
252
  end
253
253
 
254
- def add_address(params, address, options={})
254
+ def add_address(params, address, options = {})
255
255
  return unless address
256
256
 
257
257
  params['Title'] = address[:title]
@@ -310,7 +310,7 @@ module ActiveMerchant #:nodoc:
310
310
  cvv_result: cvv_result_from(raw)
311
311
  )
312
312
  rescue ActiveMerchant::ResponseError => e
313
- return ActiveMerchant::Billing::Response.new(false, e.response.message, {status_code: e.response.code}, test: test?)
313
+ return ActiveMerchant::Billing::Response.new(false, e.response.message, { status_code: e.response.code }, test: test?)
314
314
  end
315
315
 
316
316
  def parse(data)
@@ -365,7 +365,7 @@ module ActiveMerchant #:nodoc:
365
365
  else
366
366
  'I'
367
367
  end
368
- {code: code}
368
+ { code: code }
369
369
  end
370
370
 
371
371
  def cvv_result_from(response)
@@ -558,7 +558,7 @@ module ActiveMerchant #:nodoc:
558
558
  'V6150' => 'Invalid Refund Amount',
559
559
  'V6151' => 'Refund amount greater than original transaction',
560
560
  'V6152' => 'Original transaction already refunded for total amount',
561
- 'V6153' => 'Card type not support by merchant',
561
+ 'V6153' => 'Card type not support by merchant'
562
562
  }
563
563
  end
564
564
  end
@@ -5,8 +5,8 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  API_VERSION = '8.5'
7
7
 
8
- TEST_LOGINS = [{login: 'A00049-01', password: 'test1'},
9
- {login: 'A00427-01', password: 'testus'}]
8
+ TEST_LOGINS = [{ login: 'A00049-01', password: 'test1' },
9
+ { login: 'A00427-01', password: 'testus' }]
10
10
 
11
11
  TRANSACTIONS = { sale: '00',
12
12
  authorization: '01',
@@ -15,16 +15,16 @@ module ActiveMerchant #:nodoc:
15
15
 
16
16
  ENVELOPE_NAMESPACES = { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
17
17
  'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
18
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'}
18
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' }
19
19
 
20
20
  SEND_AND_COMMIT_ATTRIBUTES = { 'xmlns:n1' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/Request',
21
- 'env:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'}
21
+ 'env:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/' }
22
22
 
23
23
  SEND_AND_COMMIT_SOURCE_ATTRIBUTES = { 'xmlns:n2' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/encodedTypes',
24
- 'xsi:type' => 'n2:Transaction'}
24
+ 'xsi:type' => 'n2:Transaction' }
25
25
 
26
26
  POST_HEADERS = { 'soapAction' => 'http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/SendAndCommit',
27
- 'Content-Type' => 'text/xml'}
27
+ 'Content-Type' => 'text/xml' }
28
28
 
29
29
  SUCCESS = 'true'
30
30
 
@@ -162,8 +162,7 @@ module ActiveMerchant #:nodoc:
162
162
  test: test?,
163
163
  authorization: authorization_from(response),
164
164
  avs_result: { code: response[:avs] },
165
- cvv_result: response[:cvv2]
166
- )
165
+ cvv_result: response[:cvv2])
167
166
  rescue ResponseError => e
168
167
  case e.response.code
169
168
  when '401'
@@ -207,7 +206,7 @@ module ActiveMerchant #:nodoc:
207
206
  parse_elements(response, root)
208
207
  end
209
208
 
210
- response.delete_if { |k, v| SENSITIVE_FIELDS.include?(k) }
209
+ response.delete_if { |k, _v| SENSITIVE_FIELDS.include?(k) }
211
210
  end
212
211
 
213
212
  def parse_elements(response, root)
@@ -10,12 +10,12 @@ module ActiveMerchant
10
10
  self.homepage_url = 'http://www.ezic.com/'
11
11
  self.display_name = 'Ezic'
12
12
 
13
- def initialize(options={})
13
+ def initialize(options = {})
14
14
  requires!(options, :account_id)
15
15
  super
16
16
  end
17
17
 
18
- def purchase(money, payment, options={})
18
+ def purchase(money, payment, options = {})
19
19
  post = {}
20
20
 
21
21
  add_account_id(post)
@@ -26,7 +26,7 @@ module ActiveMerchant
26
26
  commit('S', post)
27
27
  end
28
28
 
29
- def authorize(money, payment, options={})
29
+ def authorize(money, payment, options = {})
30
30
  post = {}
31
31
 
32
32
  add_account_id(post)
@@ -37,7 +37,7 @@ module ActiveMerchant
37
37
  commit('A', post)
38
38
  end
39
39
 
40
- def capture(money, authorization, options={})
40
+ def capture(money, authorization, options = {})
41
41
  post = {}
42
42
 
43
43
  add_account_id(post)
@@ -48,7 +48,7 @@ module ActiveMerchant
48
48
  commit('D', post)
49
49
  end
50
50
 
51
- def refund(money, authorization, options={})
51
+ def refund(money, authorization, options = {})
52
52
  post = {}
53
53
 
54
54
  add_account_id(post)
@@ -59,7 +59,7 @@ module ActiveMerchant
59
59
  commit('R', post)
60
60
  end
61
61
 
62
- def void(authorization, options={})
62
+ def void(authorization, options = {})
63
63
  post = {}
64
64
 
65
65
  add_account_id(post)
@@ -69,7 +69,7 @@ module ActiveMerchant
69
69
  commit('U', 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) }
@@ -187,7 +187,7 @@ module ActiveMerchant
187
187
 
188
188
  def headers
189
189
  {
190
- 'User-Agent' => "ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
190
+ 'User-Agent' => "ActiveMerchantBindings/#{ActiveMerchant::VERSION}"
191
191
  }
192
192
  end
193
193
  end
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  commit(:post, "purchases/#{CGI.escape(txn_id)}/capture", post)
58
58
  end
59
59
 
60
- def refund(money, authorization, options={})
60
+ def refund(money, authorization, options = {})
61
61
  txn_id, = authorization.to_s.split('|')
62
62
  post = {}
63
63
 
@@ -69,13 +69,13 @@ module ActiveMerchant #:nodoc:
69
69
  commit(:post, 'refunds', post)
70
70
  end
71
71
 
72
- def void(authorization, options={})
72
+ def void(authorization, options = {})
73
73
  txn_id, endpoint = authorization.to_s.split('|')
74
74
 
75
75
  commit(:post, "#{endpoint}/void?id=#{txn_id}", {})
76
76
  end
77
77
 
78
- def store(creditcard, options={})
78
+ def store(creditcard, options = {})
79
79
  post = {}
80
80
 
81
81
  add_creditcard(post, creditcard)
@@ -125,11 +125,13 @@ module ActiveMerchant #:nodoc:
125
125
  def add_extra_options(post, options)
126
126
  extra = {}
127
127
  extra[:ecm] = '32' if options[:recurring]
128
- extra[:cavv] = options[:cavv] if options[:cavv]
129
- extra[:xid] = options[:xid] if options[:xid]
130
- extra[:sli] = options[:sli] if options[:sli]
128
+ extra[:cavv] = options[:cavv] || options.dig(:three_d_secure, :cavv) if options[:cavv] || options.dig(:three_d_secure, :cavv)
129
+ extra[:xid] = options[:xid] || options.dig(:three_d_secure, :xid) if options[:xid] || options.dig(:three_d_secure, :xid)
130
+ extra[:sli] = options[:sli] || options.dig(:three_d_secure, :eci) if options[:sli] || options.dig(:three_d_secure, :eci)
131
131
  extra[:name] = options[:merchant] if options[:merchant]
132
132
  extra[:location] = options[:merchant_location] if options[:merchant_location]
133
+ extra[:card_on_file] = options.dig(:extra, :card_on_file) if options.dig(:extra, :card_on_file)
134
+ extra[:auth_reason] = options.dig(:extra, :auth_reason) if options.dig(:extra, :auth_reason)
133
135
  post[:extra] = extra if extra.any?
134
136
  end
135
137
 
@@ -145,7 +147,7 @@ module ActiveMerchant #:nodoc:
145
147
  post[:metadata] = options.fetch(:metadata, {})
146
148
  end
147
149
 
148
- def commit(method, uri, parameters=nil)
150
+ def commit(method, uri, parameters = nil)
149
151
  response =
150
152
  begin
151
153
  parse(ssl_request(method, get_url(uri), parameters.to_json, headers))
@@ -124,9 +124,8 @@ module ActiveMerchant #:nodoc:
124
124
  Response.new(success?(response), message, response,
125
125
  test: test?,
126
126
  authorization: response['transactionid'],
127
- avs_result: {code: response['avsresponse']},
128
- cvv_result: response['cvvresponse']
129
- )
127
+ avs_result: { code: response['avsresponse'] },
128
+ cvv_result: response['cvvresponse'])
130
129
  end
131
130
 
132
131
  def success?(response)
@@ -90,7 +90,7 @@ module ActiveMerchant #:nodoc:
90
90
  response
91
91
  end
92
92
 
93
- def commit(action, post=nil)
93
+ def commit(action, post = nil)
94
94
  url = (test? ? self.test_url : self.live_url) + action
95
95
 
96
96
  begin