activemerchant 1.100.0 → 1.133.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +1057 -0
  3. data/README.md +11 -9
  4. data/lib/active_merchant/billing/avs_result.rb +9 -9
  5. data/lib/active_merchant/billing/base.rb +0 -13
  6. data/lib/active_merchant/billing/check.rb +49 -17
  7. data/lib/active_merchant/billing/compatibility.rb +5 -4
  8. data/lib/active_merchant/billing/credit_card.rb +55 -8
  9. data/lib/active_merchant/billing/credit_card_formatting.rb +1 -0
  10. data/lib/active_merchant/billing/credit_card_methods.rb +209 -36
  11. data/lib/active_merchant/billing/cvv_result.rb +0 -1
  12. data/lib/active_merchant/billing/gateway.rb +38 -36
  13. data/lib/active_merchant/billing/gateways/adyen.rb +399 -78
  14. data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
  15. data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
  16. data/lib/active_merchant/billing/gateways/allied_wallet.rb +14 -14
  17. data/lib/active_merchant/billing/gateways/authorize_net.rb +200 -130
  18. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +27 -20
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +48 -51
  20. data/lib/active_merchant/billing/gateways/axcessms.rb +13 -15
  21. data/lib/active_merchant/billing/gateways/balanced.rb +43 -36
  22. data/lib/active_merchant/billing/gateways/bambora_apac.rb +16 -20
  23. data/lib/active_merchant/billing/gateways/bank_frick.rb +13 -13
  24. data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
  25. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -30
  26. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/be2bill.rb +5 -5
  28. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +37 -36
  29. data/lib/active_merchant/billing/gateways/beanstream.rb +21 -3
  30. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/blue_pay.rb +53 -28
  32. data/lib/active_merchant/billing/gateways/blue_snap.rb +176 -54
  33. data/lib/active_merchant/billing/gateways/bogus.rb +24 -20
  34. data/lib/active_merchant/billing/gateways/borgun.rb +92 -38
  35. data/lib/active_merchant/billing/gateways/bpoint.rb +15 -15
  36. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +8 -2
  37. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  38. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/braintree_blue.rb +387 -175
  40. data/lib/active_merchant/billing/gateways/bridge_pay.rb +13 -13
  41. data/lib/active_merchant/billing/gateways/cams.rb +10 -10
  42. data/lib/active_merchant/billing/gateways/card_connect.rb +33 -14
  43. data/lib/active_merchant/billing/gateways/card_save.rb +3 -4
  44. data/lib/active_merchant/billing/gateways/card_stream.rb +67 -40
  45. data/lib/active_merchant/billing/gateways/cardknox.rb +13 -13
  46. data/lib/active_merchant/billing/gateways/cardprocess.rb +4 -2
  47. data/lib/active_merchant/billing/gateways/cashnet.rb +28 -12
  48. data/lib/active_merchant/billing/gateways/cc5.rb +9 -9
  49. data/lib/active_merchant/billing/gateways/cecabank.rb +38 -38
  50. data/lib/active_merchant/billing/gateways/cenpos.rb +29 -28
  51. data/lib/active_merchant/billing/gateways/checkout.rb +7 -9
  52. data/lib/active_merchant/billing/gateways/checkout_v2.rb +316 -68
  53. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -2
  54. data/lib/active_merchant/billing/gateways/clearhaus.rb +32 -33
  55. data/lib/active_merchant/billing/gateways/commerce_hub.rb +370 -0
  56. data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
  57. data/lib/active_merchant/billing/gateways/conekta.rb +8 -6
  58. data/lib/active_merchant/billing/gateways/creditcall.rb +18 -17
  59. data/lib/active_merchant/billing/gateways/credorax.rb +152 -63
  60. data/lib/active_merchant/billing/gateways/ct_payment.rb +15 -14
  61. data/lib/active_merchant/billing/gateways/culqi.rb +30 -28
  62. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
  63. data/lib/active_merchant/billing/gateways/cyber_source.rb +496 -187
  64. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
  65. data/lib/active_merchant/billing/gateways/d_local.rb +148 -31
  66. data/lib/active_merchant/billing/gateways/data_cash.rb +34 -37
  67. data/lib/active_merchant/billing/gateways/decidir.rb +134 -21
  68. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  69. data/lib/active_merchant/billing/gateways/dibs.rb +10 -10
  70. data/lib/active_merchant/billing/gateways/digitzs.rb +11 -8
  71. data/lib/active_merchant/billing/gateways/ebanx.rb +90 -40
  72. data/lib/active_merchant/billing/gateways/efsnet.rb +36 -36
  73. data/lib/active_merchant/billing/gateways/elavon.rb +349 -194
  74. data/lib/active_merchant/billing/gateways/element.rb +71 -21
  75. data/lib/active_merchant/billing/gateways/epay.rb +43 -43
  76. data/lib/active_merchant/billing/gateways/evo_ca.rb +12 -13
  77. data/lib/active_merchant/billing/gateways/eway.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/eway_managed.rb +55 -56
  79. data/lib/active_merchant/billing/gateways/eway_rapid.rb +37 -22
  80. data/lib/active_merchant/billing/gateways/exact.rb +19 -20
  81. data/lib/active_merchant/billing/gateways/ezic.rb +9 -9
  82. data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -19
  83. data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -7
  84. data/lib/active_merchant/billing/gateways/finansbank.rb +3 -3
  85. data/lib/active_merchant/billing/gateways/first_giving.rb +5 -4
  86. data/lib/active_merchant/billing/gateways/first_pay.rb +7 -7
  87. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +39 -38
  88. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +51 -31
  89. data/lib/active_merchant/billing/gateways/flo2cash.rb +24 -24
  90. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  91. data/lib/active_merchant/billing/gateways/forte.rb +38 -22
  92. data/lib/active_merchant/billing/gateways/garanti.rb +12 -15
  93. data/lib/active_merchant/billing/gateways/global_collect.rb +333 -89
  94. data/lib/active_merchant/billing/gateways/global_transport.rb +8 -9
  95. data/lib/active_merchant/billing/gateways/hdfc.rb +22 -23
  96. data/lib/active_merchant/billing/gateways/hps.rb +171 -50
  97. data/lib/active_merchant/billing/gateways/iats_payments.rb +47 -25
  98. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/inspire.rb +22 -27
  100. data/lib/active_merchant/billing/gateways/instapay.rb +5 -8
  101. data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
  102. data/lib/active_merchant/billing/gateways/ipp.rb +9 -9
  103. data/lib/active_merchant/billing/gateways/iridium.rb +30 -31
  104. data/lib/active_merchant/billing/gateways/itransact.rb +11 -10
  105. data/lib/active_merchant/billing/gateways/iveri.rb +62 -23
  106. data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
  107. data/lib/active_merchant/billing/gateways/jetpay.rb +10 -17
  108. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +13 -18
  109. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  110. data/lib/active_merchant/billing/gateways/kushki.rb +100 -22
  111. data/lib/active_merchant/billing/gateways/latitude19.rb +20 -19
  112. data/lib/active_merchant/billing/gateways/linkpoint.rb +71 -72
  113. data/lib/active_merchant/billing/gateways/litle.rb +181 -45
  114. data/lib/active_merchant/billing/gateways/mastercard.rb +16 -22
  115. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/mercado_pago.rb +89 -18
  117. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +58 -24
  118. data/lib/active_merchant/billing/gateways/merchant_one.rb +7 -10
  119. data/lib/active_merchant/billing/gateways/merchant_partners.rb +19 -19
  120. data/lib/active_merchant/billing/gateways/merchant_ware.rb +18 -22
  121. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +15 -17
  122. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +46 -8
  123. data/lib/active_merchant/billing/gateways/mercury.rb +19 -23
  124. data/lib/active_merchant/billing/gateways/metrics_global.rb +24 -33
  125. data/lib/active_merchant/billing/gateways/micropayment.rb +11 -12
  126. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
  127. data/lib/active_merchant/billing/gateways/migs.rb +18 -21
  128. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  129. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +10 -12
  130. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  131. data/lib/active_merchant/billing/gateways/monei.rb +236 -150
  132. data/lib/active_merchant/billing/gateways/moneris.rb +122 -53
  133. data/lib/active_merchant/billing/gateways/money_movers.rb +6 -7
  134. data/lib/active_merchant/billing/gateways/mundipagg.rb +69 -23
  135. data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -20
  136. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +10 -12
  137. data/lib/active_merchant/billing/gateways/net_registry.rb +8 -9
  138. data/lib/active_merchant/billing/gateways/netaxept.rb +12 -12
  139. data/lib/active_merchant/billing/gateways/netbanx.rb +128 -46
  140. data/lib/active_merchant/billing/gateways/netbilling.rb +18 -21
  141. data/lib/active_merchant/billing/gateways/netpay.rb +5 -4
  142. data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -10
  143. data/lib/active_merchant/billing/gateways/nmi.rb +69 -27
  144. data/lib/active_merchant/billing/gateways/ogone.rb +62 -31
  145. data/lib/active_merchant/billing/gateways/omise.rb +15 -16
  146. data/lib/active_merchant/billing/gateways/openpay.rb +33 -15
  147. data/lib/active_merchant/billing/gateways/opp.rb +39 -33
  148. data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -42
  149. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
  150. data/lib/active_merchant/billing/gateways/orbital.rb +623 -362
  151. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +20 -20
  152. data/lib/active_merchant/billing/gateways/pagarme.rb +16 -23
  153. data/lib/active_merchant/billing/gateways/pago_facil.rb +4 -6
  154. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  155. data/lib/active_merchant/billing/gateways/pay_conex.rb +17 -17
  156. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +30 -33
  157. data/lib/active_merchant/billing/gateways/pay_hub.rb +10 -10
  158. data/lib/active_merchant/billing/gateways/pay_junction.rb +31 -31
  159. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +36 -18
  160. data/lib/active_merchant/billing/gateways/pay_secure.rb +10 -11
  161. data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
  162. data/lib/active_merchant/billing/gateways/paybox_direct.rb +64 -40
  163. data/lib/active_merchant/billing/gateways/payeezy.rb +130 -27
  164. data/lib/active_merchant/billing/gateways/payex.rb +24 -25
  165. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +17 -17
  166. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  167. data/lib/active_merchant/billing/gateways/payflow.rb +103 -25
  168. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -4
  169. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/payment_express.rb +22 -18
  171. data/lib/active_merchant/billing/gateways/paymentez.rb +89 -24
  172. data/lib/active_merchant/billing/gateways/paymill.rb +14 -16
  173. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
  174. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  175. data/lib/active_merchant/billing/gateways/paypal.rb +13 -5
  176. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  177. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
  178. data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -1
  179. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  180. data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
  181. data/lib/active_merchant/billing/gateways/payscout.rb +8 -9
  182. data/lib/active_merchant/billing/gateways/paystation.rb +6 -9
  183. data/lib/active_merchant/billing/gateways/payu_in.rb +20 -19
  184. data/lib/active_merchant/billing/gateways/payu_latam.rb +70 -37
  185. data/lib/active_merchant/billing/gateways/payway.rb +22 -22
  186. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  187. data/lib/active_merchant/billing/gateways/pin.rb +60 -21
  188. data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
  189. data/lib/active_merchant/billing/gateways/plugnpay.rb +20 -21
  190. data/lib/active_merchant/billing/gateways/priority.rb +392 -0
  191. data/lib/active_merchant/billing/gateways/pro_pay.rb +13 -14
  192. data/lib/active_merchant/billing/gateways/psigate.rb +29 -29
  193. data/lib/active_merchant/billing/gateways/psl_card.rb +7 -8
  194. data/lib/active_merchant/billing/gateways/qbms.rb +25 -26
  195. data/lib/active_merchant/billing/gateways/quantum.rb +9 -11
  196. data/lib/active_merchant/billing/gateways/quickbooks.rb +126 -39
  197. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +98 -98
  198. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +19 -23
  199. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
  200. data/lib/active_merchant/billing/gateways/quickpay.rb +0 -1
  201. data/lib/active_merchant/billing/gateways/qvalent.rb +36 -20
  202. data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
  203. data/lib/active_merchant/billing/gateways/reach.rb +277 -0
  204. data/lib/active_merchant/billing/gateways/realex.rb +42 -16
  205. data/lib/active_merchant/billing/gateways/redsys.rb +191 -86
  206. data/lib/active_merchant/billing/gateways/s5.rb +10 -9
  207. data/lib/active_merchant/billing/gateways/safe_charge.rb +70 -33
  208. data/lib/active_merchant/billing/gateways/sage.rb +19 -21
  209. data/lib/active_merchant/billing/gateways/sage_pay.rb +57 -57
  210. data/lib/active_merchant/billing/gateways/sallie_mae.rb +3 -4
  211. data/lib/active_merchant/billing/gateways/secure_net.rb +19 -26
  212. data/lib/active_merchant/billing/gateways/secure_pay.rb +24 -33
  213. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +18 -20
  214. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +4 -5
  215. data/lib/active_merchant/billing/gateways/securion_pay.rb +48 -7
  216. data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
  217. data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
  218. data/lib/active_merchant/billing/gateways/skip_jack.rb +19 -19
  219. data/lib/active_merchant/billing/gateways/smart_ps.rb +26 -32
  220. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +24 -25
  221. data/lib/active_merchant/billing/gateways/spreedly_core.rb +27 -21
  222. data/lib/active_merchant/billing/gateways/stripe.rb +126 -53
  223. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +441 -113
  224. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +7 -8
  225. data/lib/active_merchant/billing/gateways/telr.rb +17 -18
  226. data/lib/active_merchant/billing/gateways/tns.rb +3 -7
  227. data/lib/active_merchant/billing/gateways/trans_first.rb +10 -9
  228. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +28 -24
  229. data/lib/active_merchant/billing/gateways/transact_pro.rb +13 -15
  230. data/lib/active_merchant/billing/gateways/transax.rb +1 -2
  231. data/lib/active_merchant/billing/gateways/trexle.rb +5 -2
  232. data/lib/active_merchant/billing/gateways/trust_commerce.rb +57 -47
  233. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -2
  234. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +176 -184
  235. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +60 -48
  236. data/lib/active_merchant/billing/gateways/vanco.rb +17 -8
  237. data/lib/active_merchant/billing/gateways/verifi.rb +13 -14
  238. data/lib/active_merchant/billing/gateways/viaklix.rb +9 -14
  239. data/lib/active_merchant/billing/gateways/visanet_peru.rb +26 -21
  240. data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
  241. data/lib/active_merchant/billing/gateways/webpay.rb +4 -4
  242. data/lib/active_merchant/billing/gateways/wepay.rb +14 -16
  243. data/lib/active_merchant/billing/gateways/wirecard.rb +14 -16
  244. data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
  245. data/lib/active_merchant/billing/gateways/world_net.rb +36 -35
  246. data/lib/active_merchant/billing/gateways/worldpay.rb +556 -190
  247. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +47 -54
  248. data/lib/active_merchant/billing/gateways/worldpay_us.rb +16 -16
  249. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +2 -2
  250. data/lib/active_merchant/billing/response.rb +25 -6
  251. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  252. data/lib/active_merchant/billing.rb +1 -0
  253. data/lib/active_merchant/connection.rb +14 -15
  254. data/lib/active_merchant/country.rb +3 -1
  255. data/lib/active_merchant/errors.rb +4 -1
  256. data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
  257. data/lib/active_merchant/network_connection_retries.rb +15 -17
  258. data/lib/active_merchant/post_data.rb +3 -2
  259. data/lib/active_merchant/posts_data.rb +2 -2
  260. data/lib/active_merchant/version.rb +1 -1
  261. data/lib/active_merchant.rb +2 -2
  262. data/lib/certs/cacert.pem +1587 -2361
  263. data/lib/support/gateway_support.rb +1 -1
  264. data/lib/support/ssl_verify.rb +3 -7
  265. data/lib/support/ssl_version.rb +2 -3
  266. metadata +86 -34
  267. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -352
@@ -9,16 +9,16 @@ module ActiveMerchant #:nodoc:
9
9
  self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
10
10
  self.live_url = 'https://gateway.itstgate.com/SmartPayments/transact3.asmx'
11
11
 
12
- self.supported_countries = ['CA', 'US']
12
+ self.supported_countries = %w[CA US]
13
13
  self.default_currency = 'USD'
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
14
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :user_name, :password)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(amount, payment_method, options={})
21
+ def purchase(amount, payment_method, options = {})
22
22
  post = initialize_required_fields('Sale')
23
23
 
24
24
  # Allow the same amount in multiple transactions.
@@ -30,7 +30,7 @@ module ActiveMerchant #:nodoc:
30
30
  commit(post)
31
31
  end
32
32
 
33
- def authorize(amount, payment_method, options={})
33
+ def authorize(amount, payment_method, options = {})
34
34
  post = initialize_required_fields('Auth')
35
35
 
36
36
  add_invoice(post, amount, options)
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit(post)
41
41
  end
42
42
 
43
- def capture(amount, authorization, options={})
43
+ def capture(amount, authorization, options = {})
44
44
  post = initialize_required_fields('Force')
45
45
 
46
46
  add_invoice(post, amount, options)
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
50
50
  commit(post)
51
51
  end
52
52
 
53
- def refund(amount, authorization, options={})
53
+ def refund(amount, authorization, options = {})
54
54
  post = initialize_required_fields('Return')
55
55
 
56
56
  add_invoice(post, amount, options)
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  commit(post)
60
60
  end
61
61
 
62
- def void(authorization, options={})
62
+ def void(authorization, options = {})
63
63
  post = initialize_required_fields('Void')
64
64
 
65
65
  add_reference(post, authorization)
@@ -74,10 +74,10 @@ module ActiveMerchant #:nodoc:
74
74
  end
75
75
  end
76
76
 
77
- def store(creditcard, options={})
77
+ def store(creditcard, options = {})
78
78
  post = initialize_required_fields('')
79
79
  post[:transaction] = 'Create'
80
- post[:CardNumber] = creditcard.number
80
+ post[:CardNumber] = creditcard.number
81
81
  post[:CustomerPaymentInfoKey] = ''
82
82
  post[:token] = ''
83
83
  add_payment_method(post, creditcard)
@@ -147,7 +147,7 @@ module ActiveMerchant #:nodoc:
147
147
  end
148
148
 
149
149
  def add_customer_data(post, options)
150
- if(billing_address = (options[:billing_address] || options[:address]))
150
+ if (billing_address = (options[:billing_address] || options[:address]))
151
151
  post[:Street] = billing_address[:address1]
152
152
  post[:Zip] = billing_address[:zip]
153
153
  end
@@ -235,8 +235,8 @@ module ActiveMerchant #:nodoc:
235
235
 
236
236
  def post_data(post)
237
237
  {
238
- :UserName => @options[:user_name],
239
- :Password => @options[:password]
238
+ UserName: @options[:user_name],
239
+ Password: @options[:password]
240
240
  }.merge(post).collect { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
241
241
  end
242
242
  end
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  self.supported_countries = ['US']
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
8
+ self.supported_cardtypes = %i[visa master american_express discover]
9
9
 
10
10
  self.homepage_url = 'https://www.centralams.com/'
11
11
  self.display_name = 'CAMS: Central Account Management System'
@@ -67,12 +67,12 @@ module ActiveMerchant #:nodoc:
67
67
  '894' => STANDARD_ERROR_CODE[:processing_error]
68
68
  }
69
69
 
70
- def initialize(options={})
70
+ def initialize(options = {})
71
71
  requires!(options, :username, :password)
72
72
  super
73
73
  end
74
74
 
75
- def purchase(money, payment, options={})
75
+ def purchase(money, payment, options = {})
76
76
  post = {}
77
77
  add_invoice(post, money, options)
78
78
 
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
  commit('sale', post)
87
87
  end
88
88
 
89
- def authorize(money, payment, options={})
89
+ def authorize(money, payment, options = {})
90
90
  post = {}
91
91
  add_invoice(post, money, options)
92
92
  add_payment(post, payment)
@@ -95,7 +95,7 @@ module ActiveMerchant #:nodoc:
95
95
  commit('auth', post)
96
96
  end
97
97
 
98
- def capture(money, authorization, options={})
98
+ def capture(money, authorization, options = {})
99
99
  post = {}
100
100
  add_reference(post, authorization)
101
101
  add_invoice(post, money, options)
@@ -103,20 +103,20 @@ module ActiveMerchant #:nodoc:
103
103
  commit('capture', post)
104
104
  end
105
105
 
106
- def refund(money, authorization, options={})
106
+ def refund(money, authorization, options = {})
107
107
  post = {}
108
108
  add_reference(post, authorization)
109
109
  add_invoice(post, money, options)
110
110
  commit('refund', post)
111
111
  end
112
112
 
113
- def void(authorization, options={})
113
+ def void(authorization, options = {})
114
114
  post = {}
115
115
  add_reference(post, authorization)
116
116
  commit('void', post)
117
117
  end
118
118
 
119
- def verify(credit_card, options={})
119
+ def verify(credit_card, options = {})
120
120
  post = {}
121
121
  add_invoice(post, 0, options)
122
122
  add_payment(post, credit_card)
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
138
138
 
139
139
  private
140
140
 
141
- def add_address(post, creditcard, options={})
141
+ def add_address(post, creditcard, options = {})
142
142
  post[:firstname] = creditcard.first_name
143
143
  post[:lastname] = creditcard.last_name
144
144
 
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
167
167
 
168
168
  def add_payment(post, payment)
169
169
  post[:ccnumber] = payment.number
170
- post[:ccexp] = "#{payment.month.to_s.rjust(2, "0")}#{payment.year.to_s[-2..-1]}"
170
+ post[:ccexp] = "#{payment.month.to_s.rjust(2, '0')}#{payment.year.to_s[-2..-1]}"
171
171
  post[:cvv] = payment.verification_value
172
172
  end
173
173
 
@@ -1,12 +1,12 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class CardConnectGateway < Gateway
4
- self.test_url = 'https://fts.cardconnect.com:6443/cardconnect/rest/'
5
- self.live_url = 'https://fts.cardconnect.com:8443/cardconnect/rest/'
4
+ self.test_url = 'https://fts-uat.cardconnect.com/cardconnect/rest/'
5
+ self.live_url = 'https://fts.cardconnect.com/cardconnect/rest/'
6
6
 
7
7
  self.supported_countries = ['US']
8
8
  self.default_currency = 'USD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
9
+ self.supported_cardtypes = %i[visa master american_express discover]
10
10
 
11
11
  self.homepage_url = 'https://cardconnect.com/'
12
12
  self.display_name = 'Card Connect'
@@ -61,6 +61,8 @@ module ActiveMerchant #:nodoc:
61
61
  '60' => STANDARD_ERROR_CODE[:pickup_card]
62
62
  }
63
63
 
64
+ SCHEDULED_PAYMENT_TYPES = %w(recurring installment)
65
+
64
66
  def initialize(options = {})
65
67
  requires!(options, :merchant_id, :username, :password)
66
68
  require_valid_domain!(options, :domain)
@@ -69,7 +71,7 @@ module ActiveMerchant #:nodoc:
69
71
 
70
72
  def require_valid_domain!(options, param)
71
73
  if options[param]
72
- raise ArgumentError.new('not a valid cardconnect domain') unless /\Dcardconnect.com:\d{1,}\D/ =~ options[param]
74
+ raise ArgumentError.new('not a valid cardconnect domain') unless /https:\/\/\D*cardconnect.com/ =~ options[param]
73
75
  end
74
76
  end
75
77
 
@@ -87,8 +89,9 @@ module ActiveMerchant #:nodoc:
87
89
  add_currency(post, money, options)
88
90
  add_address(post, options)
89
91
  add_customer_data(post, options)
90
- add_3DS(post, options)
92
+ add_three_ds_mpi_data(post, options)
91
93
  add_additional_data(post, options)
94
+ add_stored_credential(post, options)
92
95
  post[:capture] = 'Y'
93
96
  commit('auth', post)
94
97
  end
@@ -102,8 +105,9 @@ module ActiveMerchant #:nodoc:
102
105
  add_payment(post, payment)
103
106
  add_address(post, options)
104
107
  add_customer_data(post, options)
105
- add_3DS(post, options)
108
+ add_three_ds_mpi_data(post, options)
106
109
  add_additional_data(post, options)
110
+ add_stored_credential(post, options)
107
111
  commit('auth', post)
108
112
  end
109
113
 
@@ -169,7 +173,7 @@ module ActiveMerchant #:nodoc:
169
173
  def add_address(post, options)
170
174
  if address = options[:billing_address] || options[:address]
171
175
  post[:address] = address[:address1] if address[:address1]
172
- post[:address].concat(" #{address[:address2]}") if address[:address2]
176
+ post[:address2] = address[:address2] if address[:address2]
173
177
  post[:city] = address[:city] if address[:city]
174
178
  post[:region] = address[:state] if address[:state]
175
179
  post[:country] = address[:country] if address[:country]
@@ -188,7 +192,11 @@ module ActiveMerchant #:nodoc:
188
192
 
189
193
  def add_invoice(post, options)
190
194
  post[:orderid] = options[:order_id]
191
- post[:ecomind] = (options[:recurring] ? 'R' : 'E')
195
+ post[:ecomind] = if options[:ecomind]
196
+ options[:ecomind].capitalize
197
+ else
198
+ (options[:recurring] ? 'R' : 'E')
199
+ end
192
200
  end
193
201
 
194
202
  def add_payment(post, payment)
@@ -233,7 +241,7 @@ module ActiveMerchant #:nodoc:
233
241
  post[:items] = options[:items].map do |item|
234
242
  updated = {}
235
243
  item.each_pair do |k, v|
236
- updated.merge!(k.to_s.gsub(/_/, '') => v)
244
+ updated.merge!(k.to_s.delete('_') => v)
237
245
  end
238
246
  updated
239
247
  end
@@ -241,10 +249,20 @@ module ActiveMerchant #:nodoc:
241
249
  post[:userfields] = options[:user_fields] if options[:user_fields]
242
250
  end
243
251
 
244
- def add_3DS(post, options)
245
- post[:secureflag] = options[:secure_flag] if options[:secure_flag]
246
- post[:securevalue] = options[:secure_value] if options[:secure_value]
247
- post[:securexid] = options[:secure_xid] if options[:secure_xid]
252
+ def add_three_ds_mpi_data(post, options)
253
+ return unless three_d_secure = options[:three_d_secure]
254
+
255
+ post[:secureflag] = three_d_secure[:eci]
256
+ post[:securevalue] = three_d_secure[:cavv]
257
+ post[:securedstid] = three_d_secure[:ds_transaction_id]
258
+ end
259
+
260
+ def add_stored_credential(post, options)
261
+ return unless stored_credential = options[:stored_credential]
262
+
263
+ post[:cof] = stored_credential[:initiator] == 'merchant' ? 'M' : 'C'
264
+ post[:cofscheduled] = SCHEDULED_PAYMENT_TYPES.include?(stored_credential[:reason_type]) ? 'Y' : 'N'
265
+ post[:cofpermission] = stored_credential[:initial_transaction] ? 'Y' : 'N'
248
266
  end
249
267
 
250
268
  def headers
@@ -287,7 +305,8 @@ module ActiveMerchant #:nodoc:
287
305
  error_code: error_code_from(response)
288
306
  )
289
307
  rescue ResponseError => e
290
- return Response.new(false, 'Unable to authenticate. Please check your credentials.', {}, :test => test?) if e.response.code == '401'
308
+ return Response.new(false, 'Unable to authenticate. Please check your credentials.', {}, test: test?) if e.response.code == '401'
309
+
291
310
  raise
292
311
  end
293
312
 
@@ -6,17 +6,16 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.money_format = :cents
8
8
  self.default_currency = 'GBP'
9
- self.supported_cardtypes = [ :visa, :maestro, :master, :american_express, :jcb ]
10
- self.supported_countries = [ 'GB' ]
9
+ self.supported_cardtypes = %i[visa maestro master american_express jcb]
10
+ self.supported_countries = ['GB']
11
11
  self.homepage_url = 'http://www.cardsave.net/'
12
12
  self.display_name = 'CardSave'
13
13
 
14
- def initialize(options={})
14
+ def initialize(options = {})
15
15
  super
16
16
  @test_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
17
17
  @live_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
18
18
  end
19
-
20
19
  end
21
20
  end
22
21
  end
@@ -1,14 +1,14 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class CardStreamGateway < Gateway
4
-
5
4
  THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = 'Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead.'
6
5
 
7
6
  self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/'
8
7
  self.money_format = :cents
9
8
  self.default_currency = 'GBP'
10
- self.supported_countries = ['GB', 'US', 'CH', 'SE', 'SG', 'NO', 'JP', 'IS', 'HK', 'NL', 'CZ', 'CA', 'AU']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro]
9
+ self.currencies_without_fractions = %w(CVE ISK JPY UGX)
10
+ self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
12
12
  self.homepage_url = 'http://www.cardstream.com/'
13
13
  self.display_name = 'CardStream'
14
14
 
@@ -150,30 +150,20 @@ module ActiveMerchant #:nodoc:
150
150
 
151
151
  def authorize(money, credit_card_or_reference, options = {})
152
152
  post = {}
153
- add_pair(post, :captureDelay, -1)
154
- add_amount(post, money, options)
155
- add_invoice(post, credit_card_or_reference, money, options)
156
- add_credit_card_or_reference(post, credit_card_or_reference)
157
- add_customer_data(post, options)
158
- add_remote_address(post, options)
153
+ add_auth_purchase(post, -1, money, credit_card_or_reference, options)
159
154
  commit('SALE', post)
160
155
  end
161
156
 
162
157
  def purchase(money, credit_card_or_reference, options = {})
163
158
  post = {}
164
- add_pair(post, :captureDelay, 0)
165
- add_amount(post, money, options)
166
- add_invoice(post, credit_card_or_reference, money, options)
167
- add_credit_card_or_reference(post, credit_card_or_reference)
168
- add_customer_data(post, options)
169
- add_remote_address(post, options)
159
+ add_auth_purchase(post, 0, money, credit_card_or_reference, options)
170
160
  commit('SALE', post)
171
161
  end
172
162
 
173
163
  def capture(money, authorization, options = {})
174
164
  post = {}
175
165
  add_pair(post, :xref, authorization)
176
- add_pair(post, :amount, amount(money), :required => true)
166
+ add_pair(post, :amount, localized_amount(money, options[:currency] || currency(money)), required: true)
177
167
  add_remote_address(post, options)
178
168
 
179
169
  commit('CAPTURE', post)
@@ -184,6 +174,7 @@ module ActiveMerchant #:nodoc:
184
174
  add_pair(post, :xref, authorization)
185
175
  add_amount(post, money, options)
186
176
  add_remote_address(post, options)
177
+ add_country_code(post, options)
187
178
  response = commit('REFUND_SALE', post)
188
179
 
189
180
  return response if response.success?
@@ -203,7 +194,7 @@ module ActiveMerchant #:nodoc:
203
194
  commit('CANCEL', post)
204
195
  end
205
196
 
206
- def verify(creditcard, options={})
197
+ def verify(creditcard, options = {})
207
198
  MultiResponse.run(:use_first_response) do |r|
208
199
  r.process { authorize(100, creditcard, options) }
209
200
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -223,9 +214,21 @@ module ActiveMerchant #:nodoc:
223
214
 
224
215
  private
225
216
 
217
+ def add_auth_purchase(post, pair_value, money, credit_card_or_reference, options)
218
+ add_pair(post, :captureDelay, pair_value)
219
+ add_amount(post, money, options)
220
+ add_invoice(post, credit_card_or_reference, money, options)
221
+ add_credit_card_or_reference(post, credit_card_or_reference)
222
+ add_customer_data(post, options)
223
+ add_remote_address(post, options)
224
+ add_country_code(post, options)
225
+ add_threeds_fields(post, options)
226
+ end
227
+
226
228
  def add_amount(post, money, options)
227
- add_pair(post, :amount, amount(money), :required => true)
228
- add_pair(post, :currencyCode, currency_code(options[:currency] || currency(money)))
229
+ currency = options[:currency] || currency(money)
230
+ add_pair(post, :amount, localized_amount(money, currency), required: true)
231
+ add_pair(post, :currencyCode, currency_code(currency))
229
232
  end
230
233
 
231
234
  def add_customer_data(post, options)
@@ -241,15 +244,15 @@ module ActiveMerchant #:nodoc:
241
244
  end
242
245
 
243
246
  def add_invoice(post, credit_card_or_reference, money, options)
244
- add_pair(post, :transactionUnique, options[:order_id], :required => true)
245
- add_pair(post, :orderRef, options[:description] || options[:order_id], :required => true)
247
+ add_pair(post, :transactionUnique, options[:order_id], required: true)
248
+ add_pair(post, :orderRef, options[:description] || options[:order_id], required: true)
246
249
  add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name]
247
250
  add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor]
248
251
  if credit_card_or_reference.respond_to?(:number)
249
- if ['american_express', 'diners_club'].include?(card_brand(credit_card_or_reference).to_s)
252
+ if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s)
250
253
  add_pair(post, :item1Quantity, 1)
251
254
  add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
252
- add_pair(post, :item1GrossValue, amount(money))
255
+ add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money)))
253
256
  end
254
257
  end
255
258
 
@@ -266,14 +269,14 @@ module ActiveMerchant #:nodoc:
266
269
  end
267
270
 
268
271
  def add_reference(post, reference)
269
- add_pair(post, :xref, reference, :required => true)
272
+ add_pair(post, :xref, reference, required: true)
270
273
  end
271
274
 
272
275
  def add_credit_card(post, credit_card)
273
- add_pair(post, :customerName, credit_card.name, :required => true)
274
- add_pair(post, :cardNumber, credit_card.number, :required => true)
275
- add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), :required => true)
276
- add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), :required => true)
276
+ add_pair(post, :customerName, credit_card.name, required: true)
277
+ add_pair(post, :cardNumber, credit_card.number, required: true)
278
+ add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), required: true)
279
+ add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), required: true)
277
280
  add_pair(post, :cardCVV, credit_card.verification_value)
278
281
  end
279
282
 
@@ -281,10 +284,28 @@ module ActiveMerchant #:nodoc:
281
284
  add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N')
282
285
  end
283
286
 
284
- def add_remote_address(post, options={})
287
+ def add_threeds_fields(post, options)
288
+ return unless three_d_secure = options[:three_d_secure]
289
+
290
+ add_pair(post, :threeDSEnrolled, formatted_enrollment(three_d_secure[:enrolled]))
291
+ if three_d_secure[:enrolled] == 'true'
292
+ add_pair(post, :threeDSAuthenticated, three_d_secure[:authentication_response_status])
293
+ if three_d_secure[:authentication_response_status] == 'Y'
294
+ post[:threeDSECI] = three_d_secure[:eci]
295
+ post[:threeDSCAVV] = three_d_secure[:cavv]
296
+ post[:threeDSXID] = three_d_secure[:xid] || three_d_secure[:ds_transaction_id]
297
+ end
298
+ end
299
+ end
300
+
301
+ def add_remote_address(post, options = {})
285
302
  add_pair(post, :remoteAddress, options[:ip] || '1.1.1.1')
286
303
  end
287
304
 
305
+ def add_country_code(post, options)
306
+ post[:countryCode] = options[:country_code] || self.supported_countries[0]
307
+ end
308
+
288
309
  def normalize_line_endings(str)
289
310
  str.gsub(/%0D%0A|%0A%0D|%0D/, '%0A')
290
311
  end
@@ -308,10 +329,9 @@ module ActiveMerchant #:nodoc:
308
329
  end
309
330
 
310
331
  def commit(action, parameters)
311
- parameters.update(:countryCode => self.supported_countries[0]) unless ['CAPTURE', 'CANCEL'].include?(action)
312
332
  parameters.update(
313
- :merchantID => @options[:login],
314
- :action => action
333
+ merchantID: @options[:login],
334
+ action: action
315
335
  )
316
336
  # adds a signature to the post hash/array
317
337
  add_hmac(parameters)
@@ -322,10 +342,10 @@ module ActiveMerchant #:nodoc:
322
342
  response[:responseCode] == '0',
323
343
  response[:responseCode] == '0' ? 'APPROVED' : response[:responseMessage],
324
344
  response,
325
- :test => test?,
326
- :authorization => response[:xref],
327
- :cvv_result => CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]],
328
- :avs_result => avs_from(response)
345
+ test: test?,
346
+ authorization: response[:xref],
347
+ cvv_result: CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]],
348
+ avs_result: avs_from(response)
329
349
  )
330
350
  end
331
351
 
@@ -341,12 +361,12 @@ module ActiveMerchant #:nodoc:
341
361
  'A'
342
362
  else
343
363
  'I'
344
- end
364
+ end
345
365
 
346
366
  AVSResult.new({
347
- :code => code,
348
- :postal_match => postal_match,
349
- :street_match => street_match
367
+ code: code,
368
+ postal_match: postal_match,
369
+ street_match: street_match
350
370
  })
351
371
  end
352
372
 
@@ -362,6 +382,13 @@ module ActiveMerchant #:nodoc:
362
382
  post[key] = value if !value.blank? || options[:required]
363
383
  end
364
384
 
385
+ def formatted_enrollment(val)
386
+ case val
387
+ when 'Y', 'N', 'U' then val
388
+ when true, 'true' then 'Y'
389
+ when false, 'false' then 'N'
390
+ end
391
+ end
365
392
  end
366
393
  end
367
394
  end
@@ -3,9 +3,9 @@ module ActiveMerchant #:nodoc:
3
3
  class CardknoxGateway < Gateway
4
4
  self.live_url = 'https://x1.cardknox.com/gateway'
5
5
 
6
- self.supported_countries = ['US', 'CA', 'GB']
6
+ self.supported_countries = %w[US CA GB]
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
8
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
9
9
 
10
10
  self.homepage_url = 'https://www.cardknox.com/'
11
11
  self.display_name = 'Cardknox'
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  }
28
28
  }
29
29
 
30
- def initialize(options={})
30
+ def initialize(options = {})
31
31
  requires!(options, :api_key)
32
32
  super
33
33
  end
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  # - check
38
38
  # - cardknox token, which is returned in the the authorization string "ref_num;token;command"
39
39
 
40
- def purchase(amount, source, options={})
40
+ def purchase(amount, source, options = {})
41
41
  post = {}
42
42
  add_amount(post, amount, options)
43
43
  add_invoice(post, options)
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  commit(:purchase, source_type(source), post)
49
49
  end
50
50
 
51
- def authorize(amount, source, options={})
51
+ def authorize(amount, source, options = {})
52
52
  post = {}
53
53
  add_amount(post, amount)
54
54
  add_invoice(post, options)
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
66
66
  commit(:capture, source_type(authorization), post)
67
67
  end
68
68
 
69
- def refund(amount, authorization, options={})
69
+ def refund(amount, authorization, options = {})
70
70
  post = {}
71
71
  add_reference(post, authorization)
72
72
  add_amount(post, amount)
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  commit(:void, source_type(authorization), post)
80
80
  end
81
81
 
82
- def verify(credit_card, options={})
82
+ def verify(credit_card, options = {})
83
83
  MultiResponse.run(:use_first_response) do |r|
84
84
  r.process { authorize(100, credit_card, options) }
85
85
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
116
116
  end
117
117
 
118
118
  def add_reference(post, reference)
119
- reference, _, _ = split_authorization(reference)
119
+ reference, = split_authorization(reference)
120
120
  post[:Refnum] = reference
121
121
  end
122
122
 
@@ -186,7 +186,7 @@ module ActiveMerchant #:nodoc:
186
186
  post[address_key(prefix, 'FirstName')] = address[:first_name]
187
187
  post[address_key(prefix, 'LastName')] = address[:last_name]
188
188
  end
189
- post[address_key(prefix, 'MiddleName')] = address[:middle_name]
189
+ post[address_key(prefix, 'MiddleName')] = address[:middle_name]
190
190
 
191
191
  post[address_key(prefix, 'Company')] = address[:company]
192
192
  post[address_key(prefix, 'Street')] = address[:address1]
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
247
247
  end
248
248
 
249
249
  def add_cardknox_token(post, authorization)
250
- _, token, _ = split_authorization(authorization)
250
+ _, token, = split_authorization(authorization)
251
251
 
252
252
  post[:Token] = token
253
253
  end
@@ -276,7 +276,7 @@ module ActiveMerchant #:nodoc:
276
276
  amount: fields['xAuthAmount'],
277
277
  masked_card_num: fields['xMaskedCardNumber'],
278
278
  masked_account_number: fields['MaskedAccountNumber']
279
- }.delete_if { |k, v| v.nil? }
279
+ }.delete_if { |_k, v| v.nil? }
280
280
  end
281
281
 
282
282
  def commit(action, source_type, parameters)
@@ -312,7 +312,7 @@ module ActiveMerchant #:nodoc:
312
312
  Version: '4.5.4',
313
313
  SoftwareName: 'Active Merchant',
314
314
  SoftwareVersion: ActiveMerchant::VERSION.to_s,
315
- Command: command,
315
+ Command: command
316
316
  }
317
317
 
318
318
  seed = SecureRandom.hex(32).upcase
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
320
320
  initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank?
321
321
  parameters = initial_parameters.merge(parameters)
322
322
 
323
- parameters.reject { |k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
323
+ parameters.reject { |_k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
324
324
  end
325
325
  end
326
326
  end
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  MT HU NL AT PL PT RO SI SK FI SE GB IS LI NO
9
9
  CH ME MK AL RS TR BA ]
10
10
  self.default_currency = 'EUR'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
12
12
 
13
13
  self.homepage_url = 'https://vr-pay-ecommerce.docs.oppwa.com/'
14
14
  self.display_name = 'CardProcess VR-Pay'
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
26
26
  # * <tt>:user_id</tt> -- The CardProcess user ID
27
27
  # * <tt>:password</tt> -- The CardProcess password
28
28
  # * <tt>:entity_id</tt> -- The CardProcess channel or entity ID for any transactions
29
- def initialize(options={})
29
+ def initialize(options = {})
30
30
  requires!(options, :user_id, :password, :entity_id)
31
31
  super
32
32
  # This variable exists purely to allow remote tests to force error codes;
@@ -123,6 +123,7 @@ module ActiveMerchant #:nodoc:
123
123
 
124
124
  def add_invoice(post, money, options)
125
125
  return if money.nil?
126
+
126
127
  post[:amount] = amount(money)
127
128
  post[:currency] = (options[:currency] || currency(money))
128
129
  post[:merchantInvoiceId] = options[:merchant_invoice_id] if options[:merchant_invoice_id]
@@ -132,6 +133,7 @@ module ActiveMerchant #:nodoc:
132
133
 
133
134
  def add_payment(post, payment)
134
135
  return if payment.is_a?(String)
136
+
135
137
  post[:paymentBrand] = payment.brand.upcase if payment.brand
136
138
  post[:card] ||= {}
137
139
  post[:card][:number] = payment.number