activemerchant 1.112.0 → 1.118.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +115 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/compatibility.rb +3 -3
  7. data/lib/active_merchant/billing/credit_card.rb +3 -1
  8. data/lib/active_merchant/billing/credit_card_methods.rb +58 -11
  9. data/lib/active_merchant/billing/gateway.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/adyen.rb +26 -16
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -18
  13. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  14. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -2
  15. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  16. data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
  17. data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
  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 +85 -23
  25. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
  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 +20 -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 +8 -8
  36. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  38. data/lib/active_merchant/billing/gateways/cenpos.rb +11 -11
  39. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  40. data/lib/active_merchant/billing/gateways/checkout_v2.rb +18 -21
  41. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  42. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  44. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  45. data/lib/active_merchant/billing/gateways/credorax.rb +32 -15
  46. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  47. data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
  48. data/lib/active_merchant/billing/gateways/cyber_source.rb +61 -37
  49. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  50. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  51. data/lib/active_merchant/billing/gateways/decidir.rb +24 -9
  52. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  53. data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
  54. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  55. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
  56. data/lib/active_merchant/billing/gateways/elavon.rb +279 -227
  57. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  58. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  59. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  60. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  61. data/lib/active_merchant/billing/gateways/eway_rapid.rb +8 -8
  62. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  63. data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
  64. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  65. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  66. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  68. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  69. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  70. data/lib/active_merchant/billing/gateways/flo2cash.rb +9 -9
  71. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  72. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  73. data/lib/active_merchant/billing/gateways/global_collect.rb +29 -10
  74. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  75. data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
  76. data/lib/active_merchant/billing/gateways/hps.rb +17 -14
  77. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  78. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  79. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  80. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  81. data/lib/active_merchant/billing/gateways/ipp.rb +7 -7
  82. data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
  83. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  87. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  88. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  89. data/lib/active_merchant/billing/gateways/linkpoint.rb +5 -6
  90. data/lib/active_merchant/billing/gateways/litle.rb +28 -12
  91. data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
  92. data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
  93. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  94. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  96. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  97. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  98. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  99. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  100. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  101. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  102. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  103. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  104. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  105. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  106. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  107. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  108. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  109. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  110. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  111. data/lib/active_merchant/billing/gateways/netbanx.rb +12 -10
  112. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  113. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  114. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  115. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  116. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  117. data/lib/active_merchant/billing/gateways/openpay.rb +4 -5
  118. data/lib/active_merchant/billing/gateways/opp.rb +12 -12
  119. data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
  120. data/lib/active_merchant/billing/gateways/orbital.rb +175 -81
  121. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  122. data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
  123. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  125. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  126. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  127. data/lib/active_merchant/billing/gateways/pay_junction.rb +4 -5
  128. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  129. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  130. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  131. data/lib/active_merchant/billing/gateways/payeezy.rb +35 -17
  132. data/lib/active_merchant/billing/gateways/payex.rb +11 -12
  133. data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
  134. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  137. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  138. data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
  139. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  140. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  141. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  144. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  145. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  146. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  147. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  148. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  149. data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -3
  150. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
  152. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  153. data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
  154. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
  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 +9 -9
  159. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/redsys.rb +87 -7
  161. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  162. data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
  163. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  164. data/lib/active_merchant/billing/gateways/sage_pay.rb +6 -7
  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 +3 -4
  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 +12 -12
  176. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
  177. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/telr.rb +9 -9
  179. data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
  180. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
  181. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  182. data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
  183. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
  185. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
  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/webpay.rb +2 -2
  191. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  192. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  193. data/lib/active_merchant/billing/gateways/worldpay.rb +18 -10
  194. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  195. data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
  196. data/lib/active_merchant/billing/response.rb +3 -2
  197. data/lib/active_merchant/country.rb +1 -1
  198. data/lib/active_merchant/network_connection_retries.rb +2 -2
  199. data/lib/active_merchant/post_data.rb +1 -1
  200. data/lib/active_merchant/posts_data.rb +1 -1
  201. data/lib/active_merchant/version.rb +1 -1
  202. data/lib/support/ssl_verify.rb +2 -2
  203. data/lib/support/ssl_version.rb +2 -2
  204. metadata +2 -2
@@ -25,12 +25,12 @@ module ActiveMerchant #:nodoc:
25
25
  google_pay: 'GooglePayApp'
26
26
  }
27
27
 
28
- def initialize(options={})
28
+ def initialize(options = {})
29
29
  requires!(options, :secret_api_key)
30
30
  super
31
31
  end
32
32
 
33
- def authorize(money, card_or_token, options={})
33
+ def authorize(money, card_or_token, options = {})
34
34
  commit('CreditAuth') do |xml|
35
35
  add_amount(xml, money)
36
36
  add_allow_dup(xml)
@@ -42,14 +42,14 @@ module ActiveMerchant #:nodoc:
42
42
  end
43
43
  end
44
44
 
45
- def capture(money, transaction_id, options={})
46
- commit('CreditAddToBatch') do |xml|
45
+ def capture(money, transaction_id, options = {})
46
+ commit('CreditAddToBatch', transaction_id) do |xml|
47
47
  add_amount(xml, money)
48
48
  add_reference(xml, transaction_id)
49
49
  end
50
50
  end
51
51
 
52
- def purchase(money, payment_method, options={})
52
+ def purchase(money, payment_method, options = {})
53
53
  if payment_method.is_a?(Check)
54
54
  commit_check_sale(money, payment_method, options)
55
55
  else
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  end
58
58
  end
59
59
 
60
- def refund(money, transaction_id, options={})
60
+ def refund(money, transaction_id, options = {})
61
61
  commit('CreditReturn') do |xml|
62
62
  add_amount(xml, money)
63
63
  add_allow_dup(xml)
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
  end
68
68
  end
69
69
 
70
- def verify(card_or_token, options={})
70
+ def verify(card_or_token, options = {})
71
71
  commit('CreditAccountVerify') do |xml|
72
72
  add_card_or_token_customer_data(xml, card_or_token, options)
73
73
  add_descriptor_name(xml, options)
@@ -75,7 +75,7 @@ module ActiveMerchant #:nodoc:
75
75
  end
76
76
  end
77
77
 
78
- def void(transaction_id, options={})
78
+ def void(transaction_id, options = {})
79
79
  if options[:check_void]
80
80
  commit('CheckVoid') do |xml|
81
81
  add_reference(xml, transaction_id)
@@ -126,7 +126,8 @@ module ActiveMerchant #:nodoc:
126
126
  end
127
127
 
128
128
  def add_reference(xml, transaction_id)
129
- xml.hps :GatewayTxnId, transaction_id
129
+ reference = transaction_id.to_s.include?('|') ? transaction_id.split('|').first : transaction_id
130
+ xml.hps :GatewayTxnId, reference
130
131
  end
131
132
 
132
133
  def add_amount(xml, money)
@@ -209,7 +210,7 @@ module ActiveMerchant #:nodoc:
209
210
  def add_details(xml, options)
210
211
  xml.hps :AdditionalTxnFields do
211
212
  xml.hps :Description, options[:description] if options[:description]
212
- xml.hps :InvoiceNbr, options[:order_id] if options[:order_id]
213
+ xml.hps :InvoiceNbr, options[:order_id][0..59] if options[:order_id]
213
214
  xml.hps :CustomerID, options[:customer_id] if options[:customer_id]
214
215
  end
215
216
  end
@@ -232,7 +233,7 @@ module ActiveMerchant #:nodoc:
232
233
  source: card_or_token.source,
233
234
  cavv: card_or_token.payment_cryptogram,
234
235
  eci: card_or_token.eci,
235
- xid: card_or_token.transaction_id,
236
+ xid: card_or_token.transaction_id
236
237
  })
237
238
  elsif options[:three_d_secure]
238
239
  options[:three_d_secure][:source] ||= card_brand(card_or_token)
@@ -323,7 +324,7 @@ module ActiveMerchant #:nodoc:
323
324
  response
324
325
  end
325
326
 
326
- def commit(action, &request)
327
+ def commit(action, reference = nil, &request)
327
328
  data = build_request(action, &request)
328
329
 
329
330
  response =
@@ -338,7 +339,7 @@ module ActiveMerchant #:nodoc:
338
339
  message_from(response),
339
340
  response,
340
341
  test: test?,
341
- authorization: authorization_from(response),
342
+ authorization: authorization_from(response, reference),
342
343
  avs_result: {
343
344
  code: response['AVSRsltCode'],
344
345
  message: response['AVSRsltText']
@@ -369,7 +370,9 @@ module ActiveMerchant #:nodoc:
369
370
  end
370
371
  end
371
372
 
372
- def authorization_from(response)
373
+ def authorization_from(response, reference)
374
+ return [reference, response['GatewayTxnId']].join('|') if reference
375
+
373
376
  response['GatewayTxnId']
374
377
  end
375
378
 
@@ -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 = {})
@@ -18,16 +18,16 @@ module ActiveMerchant #:nodoc:
18
18
  '05' => STANDARD_ERROR_CODE[:card_declined],
19
19
  '06' => STANDARD_ERROR_CODE[:processing_error],
20
20
  '14' => STANDARD_ERROR_CODE[:invalid_number],
21
- '54' => STANDARD_ERROR_CODE[:expired_card],
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
@@ -121,7 +121,7 @@ module ActiveMerchant #:nodoc:
121
121
  def commit(action, &block)
122
122
  headers = {
123
123
  'Content-Type' => 'text/xml; charset=utf-8',
124
- 'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}",
124
+ 'SOAPAction' => "http://www.ippayments.com.au/interface/api/dts/#{action}"
125
125
  }
126
126
  response = parse(ssl_post(commit_url, new_submit_xml(action, &block), headers))
127
127
 
@@ -203,7 +203,7 @@ module ActiveMerchant #:nodoc:
203
203
  'YER' => '886',
204
204
  'ZAR' => '710',
205
205
  'ZMK' => '894',
206
- 'ZWD' => '716',
206
+ 'ZWD' => '716'
207
207
  }
208
208
 
209
209
  AVS_CODE = {
@@ -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'
@@ -389,16 +389,15 @@ module ActiveMerchant #:nodoc:
389
389
  authorization: authorization,
390
390
  avs_result: {
391
391
  street_match: AVS_CODE[ response[:transaction_output_data][:address_numeric_check_result] ],
392
- postal_match: AVS_CODE[ response[:transaction_output_data][:post_code_check_result] ],
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) }