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
@@ -5,11 +5,11 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  DUP_WINDOW_DEPRECATION_MESSAGE = 'The class-level duplicate_window variable is deprecated. Please use the :dup_seconds transaction option instead.'
7
7
 
8
- self.test_url = self.live_url = 'https://secure.nmi.com/api/transact.php'
8
+ self.test_url = self.live_url = 'https://secure.networkmerchants.com/api/transact.php'
9
9
  self.default_currency = 'USD'
10
10
  self.money_format = :dollars
11
11
  self.supported_countries = ['US']
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
+ self.supported_cardtypes = %i[visa master american_express discover]
13
13
  self.homepage_url = 'http://nmi.com/'
14
14
  self.display_name = 'NMI'
15
15
 
@@ -23,11 +23,15 @@ module ActiveMerchant #:nodoc:
23
23
  end
24
24
 
25
25
  def initialize(options = {})
26
- requires!(options, :login, :password)
26
+ if options.has_key?(:security_key)
27
+ requires!(options, :security_key)
28
+ else
29
+ requires!(options, :login, :password)
30
+ end
27
31
  super
28
32
  end
29
33
 
30
- def purchase(amount, payment_method, options={})
34
+ def purchase(amount, payment_method, options = {})
31
35
  post = {}
32
36
  add_invoice(post, amount, options)
33
37
  add_payment_method(post, payment_method, options)
@@ -36,11 +40,12 @@ module ActiveMerchant #:nodoc:
36
40
  add_vendor_data(post, options)
37
41
  add_merchant_defined_fields(post, options)
38
42
  add_level3_fields(post, options)
43
+ add_three_d_secure(post, options)
39
44
 
40
45
  commit('sale', post)
41
46
  end
42
47
 
43
- def authorize(amount, payment_method, options={})
48
+ def authorize(amount, payment_method, options = {})
44
49
  post = {}
45
50
  add_invoice(post, amount, options)
46
51
  add_payment_method(post, payment_method, options)
@@ -49,11 +54,11 @@ module ActiveMerchant #:nodoc:
49
54
  add_vendor_data(post, options)
50
55
  add_merchant_defined_fields(post, options)
51
56
  add_level3_fields(post, options)
52
-
57
+ add_three_d_secure(post, options)
53
58
  commit('auth', post)
54
59
  end
55
60
 
56
- def capture(amount, authorization, options={})
61
+ def capture(amount, authorization, options = {})
57
62
  post = {}
58
63
  add_invoice(post, amount, options)
59
64
  add_reference(post, authorization)
@@ -62,7 +67,7 @@ module ActiveMerchant #:nodoc:
62
67
  commit('capture', post)
63
68
  end
64
69
 
65
- def void(authorization, options={})
70
+ def void(authorization, options = {})
66
71
  post = {}
67
72
  add_reference(post, authorization)
68
73
  add_payment_type(post, authorization)
@@ -70,7 +75,7 @@ module ActiveMerchant #:nodoc:
70
75
  commit('void', post)
71
76
  end
72
77
 
73
- def refund(amount, authorization, options={})
78
+ def refund(amount, authorization, options = {})
74
79
  post = {}
75
80
  add_invoice(post, amount, options)
76
81
  add_reference(post, authorization)
@@ -79,7 +84,7 @@ module ActiveMerchant #:nodoc:
79
84
  commit('refund', post)
80
85
  end
81
86
 
82
- def credit(amount, payment_method, options={})
87
+ def credit(amount, payment_method, options = {})
83
88
  post = {}
84
89
  add_invoice(post, amount, options)
85
90
  add_payment_method(post, payment_method, options)
@@ -90,7 +95,7 @@ module ActiveMerchant #:nodoc:
90
95
  commit('credit', post)
91
96
  end
92
97
 
93
- def verify(payment_method, options={})
98
+ def verify(payment_method, options = {})
94
99
  post = {}
95
100
  add_payment_method(post, payment_method, options)
96
101
  add_customer_data(post, options)
@@ -124,6 +129,7 @@ module ActiveMerchant #:nodoc:
124
129
  def scrub(transcript)
125
130
  transcript.
126
131
  gsub(%r((password=)[^&\n]*), '\1[FILTERED]').
132
+ gsub(%r((security_key=)[^&\n]*), '\1[FILTERED]').
127
133
  gsub(%r((ccnumber=)\d+), '\1[FILTERED]').
128
134
  gsub(%r((cvv=)\d+), '\1[FILTERED]').
129
135
  gsub(%r((checkaba=)\d+), '\1[FILTERED]').
@@ -138,11 +144,12 @@ module ActiveMerchant #:nodoc:
138
144
  private
139
145
 
140
146
  def add_level3_fields(post, options)
141
- add_fields_to_post_if_present(post, options, [:tax, :shipping, :ponumber])
147
+ add_fields_to_post_if_present(post, options, %i[tax shipping ponumber])
142
148
  end
143
149
 
144
150
  def add_invoice(post, money, options)
145
151
  post[:amount] = amount(money)
152
+ post[:surcharge] = options[:surcharge] if options[:surcharge]
146
153
  post[:orderid] = options[:order_id]
147
154
  post[:orderdescription] = options[:description]
148
155
  post[:currency] = options[:currency] || currency(money)
@@ -153,14 +160,14 @@ module ActiveMerchant #:nodoc:
153
160
  end
154
161
 
155
162
  def add_payment_method(post, payment_method, options)
156
- if(payment_method.is_a?(String))
157
- customer_vault_id, _ = split_authorization(payment_method)
163
+ if payment_method.is_a?(String)
164
+ customer_vault_id, = split_authorization(payment_method)
158
165
  post[:customer_vault_id] = customer_vault_id
159
166
  elsif payment_method.is_a?(NetworkTokenizationCreditCard)
160
167
  post[:ccnumber] = payment_method.number
161
168
  post[:ccexp] = exp_date(payment_method)
162
169
  post[:token_cryptogram] = payment_method.payment_cryptogram
163
- elsif(card_brand(payment_method) == 'check')
170
+ elsif card_brand(payment_method) == 'check'
164
171
  post[:payment] = 'check'
165
172
  post[:firstname] = payment_method.first_name
166
173
  post[:lastname] = payment_method.last_name
@@ -204,7 +211,8 @@ module ActiveMerchant #:nodoc:
204
211
  post[:stored_credential_indicator] = 'stored'
205
212
  else
206
213
  post[:stored_credential_indicator] = 'used'
207
- post[:initial_transaction_id] = stored_credential[:network_transaction_id]
214
+ # should only send :initial_transaction_id if it is a MIT
215
+ post[:initial_transaction_id] = stored_credential[:network_transaction_id] if post[:initiated_by] == 'merchant'
208
216
  end
209
217
  end
210
218
 
@@ -213,26 +221,43 @@ module ActiveMerchant #:nodoc:
213
221
  post[:ipaddress] = options[:ip]
214
222
  post[:customer_id] = options[:customer_id] || options[:customer]
215
223
 
216
- if(billing_address = options[:billing_address] || options[:address])
224
+ if (billing_address = options[:billing_address] || options[:address])
217
225
  post[:company] = billing_address[:company]
218
226
  post[:address1] = billing_address[:address1]
219
227
  post[:address2] = billing_address[:address2]
220
228
  post[:city] = billing_address[:city]
221
229
  post[:state] = billing_address[:state]
222
230
  post[:country] = billing_address[:country]
223
- post[:zip] = billing_address[:zip]
231
+ post[:zip] = billing_address[:zip]
224
232
  post[:phone] = billing_address[:phone]
225
233
  end
226
234
 
227
- if(shipping_address = options[:shipping_address])
235
+ if (shipping_address = options[:shipping_address])
236
+ first_name, last_name = split_names(shipping_address[:name])
237
+ post[:shipping_firstname] = first_name if first_name
238
+ post[:shipping_lastname] = last_name if last_name
228
239
  post[:shipping_company] = shipping_address[:company]
229
240
  post[:shipping_address1] = shipping_address[:address1]
230
241
  post[:shipping_address2] = shipping_address[:address2]
231
242
  post[:shipping_city] = shipping_address[:city]
232
243
  post[:shipping_state] = shipping_address[:state]
233
244
  post[:shipping_country] = shipping_address[:country]
234
- post[:shipping_zip] = shipping_address[:zip]
245
+ post[:shipping_zip] = shipping_address[:zip]
235
246
  post[:shipping_phone] = shipping_address[:phone]
247
+ post[:shipping_email] = options[:shipping_email] if options[:shipping_email]
248
+ end
249
+
250
+ if (descriptor = options[:descriptors])
251
+ post[:descriptor] = descriptor[:descriptor]
252
+ post[:descriptor_phone] = descriptor[:descriptor_phone]
253
+ post[:descriptor_address] = descriptor[:descriptor_address]
254
+ post[:descriptor_city] = descriptor[:descriptor_city]
255
+ post[:descriptor_state] = descriptor[:descriptor_state]
256
+ post[:descriptor_postal] = descriptor[:descriptor_postal]
257
+ post[:descriptor_country] = descriptor[:descriptor_country]
258
+ post[:descriptor_mcc] = descriptor[:descriptor_mcc]
259
+ post[:descriptor_merchant_id] = descriptor[:descriptor_merchant_id]
260
+ post[:descriptor_url] = descriptor[:descriptor_url]
236
261
  end
237
262
  end
238
263
 
@@ -248,8 +273,25 @@ module ActiveMerchant #:nodoc:
248
273
  end
249
274
  end
250
275
 
276
+ def add_three_d_secure(post, options)
277
+ three_d_secure = options[:three_d_secure]
278
+ return unless three_d_secure
279
+
280
+ post[:cardholder_auth] = cardholder_auth(three_d_secure[:authentication_response_status])
281
+ post[:cavv] = three_d_secure[:cavv]
282
+ post[:xid] = three_d_secure[:xid]
283
+ post[:three_ds_version] = three_d_secure[:version]
284
+ post[:directory_server_id] = three_d_secure[:ds_transaction_id]
285
+ end
286
+
287
+ def cardholder_auth(trans_status)
288
+ return nil if trans_status.nil?
289
+
290
+ trans_status == 'Y' ? 'verified' : 'attempted'
291
+ end
292
+
251
293
  def add_reference(post, authorization)
252
- transaction_id, _ = split_authorization(authorization)
294
+ transaction_id, = split_authorization(authorization)
253
295
  post[:transactionid] = transaction_id
254
296
  end
255
297
 
@@ -264,9 +306,9 @@ module ActiveMerchant #:nodoc:
264
306
 
265
307
  def commit(action, params)
266
308
  params[action == 'add_customer' ? :customer_vault : :type] = action
267
- params[:username] = @options[:login]
268
- params[:password] = @options[:password]
269
-
309
+ params[:username] = @options[:login] unless @options[:login].nil?
310
+ params[:password] = @options[:password] unless @options[:password].nil?
311
+ params[:security_key] = @options[:security_key] unless @options[:security_key].nil?
270
312
  raw_response = ssl_post(url, post_data(action, params), headers)
271
313
  response = parse(raw_response)
272
314
  succeeded = success_from(response)
@@ -284,7 +326,7 @@ module ActiveMerchant #:nodoc:
284
326
 
285
327
  def authorization_from(response, payment_type, action)
286
328
  authorization = (action == 'add_customer' ? response[:customer_vault_id] : response[:transactionid])
287
- [ authorization, payment_type ].join('#')
329
+ [authorization, payment_type].join('#')
288
330
  end
289
331
 
290
332
  def split_authorization(authorization)
@@ -292,7 +334,8 @@ module ActiveMerchant #:nodoc:
292
334
  end
293
335
 
294
336
  def headers
295
- { 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' }
337
+ headers = { 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8' }
338
+ headers
296
339
  end
297
340
 
298
341
  def post_data(action, params)
@@ -318,7 +361,6 @@ module ActiveMerchant #:nodoc:
318
361
  response[:responsetext]
319
362
  end
320
363
  end
321
-
322
364
  end
323
365
  end
324
366
  end
@@ -122,10 +122,10 @@ module ActiveMerchant #:nodoc:
122
122
 
123
123
  SUCCESS_MESSAGE = 'The transaction was successful'
124
124
 
125
- THREE_D_SECURE_DISPLAY_WAYS = { :main_window => 'MAINW', # display the identification page in the main window (default value).
125
+ THREE_D_SECURE_DISPLAY_WAYS = { main_window: 'MAINW', # display the identification page in the main window (default value).
126
126
 
127
- :pop_up => 'POPUP', # display the identification page in a pop-up window and return to the main window at the end.
128
- :pop_ix => 'POPIX' } # display the identification page in a pop-up window and remain in the pop-up window.
127
+ pop_up: 'POPUP', # display the identification page in a pop-up window and return to the main window at the end.
128
+ pop_ix: 'POPIX' } # display the identification page in a pop-up window and remain in the pop-up window.
129
129
 
130
130
  OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE = 'Signature usage will be the default for a future release of ActiveMerchant. You should either begin using it, or update your configuration to explicitly disable it (signature_encryptor: none)'
131
131
  OGONE_STORE_OPTION_DEPRECATION_MESSAGE = "The 'store' option has been renamed to 'billing_id', and its usage is deprecated."
@@ -133,10 +133,10 @@ module ActiveMerchant #:nodoc:
133
133
  self.test_url = 'https://secure.ogone.com/ncol/test/'
134
134
  self.live_url = 'https://secure.ogone.com/ncol/prod/'
135
135
 
136
- self.supported_countries = ['BE', 'DE', 'FR', 'NL', 'AT', 'CH']
136
+ self.supported_countries = %w[BE DE FR NL AT CH]
137
137
  # also supports Airplus and UATP
138
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro]
139
- self.homepage_url = 'http://www.ogone.com/'
138
+ self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
139
+ self.homepage_url = 'https://www.ingenico.com/login/ogone/'
140
140
  self.display_name = 'Ogone'
141
141
  self.default_currency = 'EUR'
142
142
  self.money_format = :cents
@@ -204,7 +204,7 @@ module ActiveMerchant #:nodoc:
204
204
  perform_reference_credit(money, reference, options)
205
205
  end
206
206
 
207
- def verify(credit_card, options={})
207
+ def verify(credit_card, options = {})
208
208
  MultiResponse.run(:use_first_response) do |r|
209
209
  r.process { authorize(100, credit_card, options) }
210
210
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -213,7 +213,7 @@ module ActiveMerchant #:nodoc:
213
213
 
214
214
  # Store a credit card by creating an Ogone Alias
215
215
  def store(payment_source, options = {})
216
- options[:alias_operation] = 'BYPSP' unless(options.has_key?(:billing_id) || options.has_key?(:store))
216
+ options[:alias_operation] = 'BYPSP' unless options.has_key?(:billing_id) || options.has_key?(:store)
217
217
  response = authorize(@options[:store_amount] || 1, payment_source, options)
218
218
  void(response.authorization) if response.success?
219
219
  response
@@ -239,6 +239,7 @@ module ActiveMerchant #:nodoc:
239
239
 
240
240
  def reference_transaction?(identifier)
241
241
  return false unless identifier.is_a?(String)
242
+
242
243
  _, action = identifier.split(';')
243
244
  !action.nil?
244
245
  end
@@ -263,7 +264,6 @@ module ActiveMerchant #:nodoc:
263
264
 
264
265
  def add_payment_source(post, payment_source, options)
265
266
  add_d3d(post, options) if options[:d3d]
266
-
267
267
  if payment_source.is_a?(String)
268
268
  add_alias(post, payment_source, options[:alias_operation])
269
269
  add_eci(post, options[:eci] || '9')
@@ -284,17 +284,46 @@ module ActiveMerchant #:nodoc:
284
284
  THREE_D_SECURE_DISPLAY_WAYS[options[:win_3ds]] :
285
285
  THREE_D_SECURE_DISPLAY_WAYS[:main_window]
286
286
  add_pair post, 'WIN3DS', win_3ds
287
-
288
- add_pair post, 'HTTP_ACCEPT', options[:http_accept] || '*/*'
289
287
  add_pair post, 'HTTP_USER_AGENT', options[:http_user_agent] if options[:http_user_agent]
290
288
  add_pair post, 'ACCEPTURL', options[:accept_url] if options[:accept_url]
291
289
  add_pair post, 'DECLINEURL', options[:decline_url] if options[:decline_url]
292
290
  add_pair post, 'EXCEPTIONURL', options[:exception_url] if options[:exception_url]
293
291
  add_pair post, 'CANCELURL', options[:cancel_url] if options[:cancel_url]
294
- add_pair post, 'PARAMVAR', options[:paramvar] if options[:paramvar]
292
+ add_pair post, 'PARAMVAR', options[:paramvar] if options[:paramvar]
295
293
  add_pair post, 'PARAMPLUS', options[:paramplus] if options[:paramplus]
296
294
  add_pair post, 'COMPLUS', options[:complus] if options[:complus]
297
295
  add_pair post, 'LANGUAGE', options[:language] if options[:language]
296
+ if options[:three_ds_2]
297
+ browser_info = options[:three_ds_2][:browser_info]
298
+ ecom_postal = options[:billing_address]
299
+ if browser_info
300
+ add_pair post, 'BROWSERACCEPTHEADER', browser_info[:accept_header]
301
+ add_pair post, 'BROWSERCOLORDEPTH', browser_info[:depth]
302
+
303
+ # for 3ds v2.1 to v2.2 add BROWSERJAVASCRIPTENABLED: This boolean indicates whether your customers have enabled JavaScript in their browsers when making a purchase.
304
+ # the following BROWSER<tag> parameters will remain mandatory unless browser_info[:javascript] = false
305
+ # her documentation https://epayments-support.ingenico.com/en/integration-solutions/integrations/directlink#directlink_integration_guides_secure_payment_with_3_d_secure
306
+ add_pair post, 'BROWSERJAVASCRIPTENABLED', browser_info[:javascript]
307
+ add_pair post, 'BROWSERJAVAENABLED', browser_info[:java]
308
+ add_pair post, 'BROWSERLANGUAGE', browser_info[:language]
309
+ add_pair post, 'BROWSERSCREENHEIGHT', browser_info[:height]
310
+ add_pair post, 'BROWSERSCREENWIDTH', browser_info[:width]
311
+ add_pair post, 'BROWSERTIMEZONE', browser_info[:timezone]
312
+ add_pair post, 'BROWSERUSERAGENT', browser_info[:user_agent]
313
+ end
314
+ # recommended
315
+ if ecom_postal
316
+ add_pair post, 'ECOM_BILLTO_POSTAL_CITY', ecom_postal[:city]
317
+ add_pair post, 'ECOM_BILLTO_POSTAL_COUNTRYCODE', ecom_postal[:country]
318
+ add_pair post, 'ECOM_BILLTO_POSTAL_STREET_LINE1', ecom_postal[:address1]
319
+ add_pair post, 'ECOM_BILLTO_POSTAL_STREET_LINE2', ecom_postal[:address2]
320
+ add_pair post, 'ECOM_BILLTO_POSTAL_POSTALCODE', ecom_postal[:zip]
321
+ end
322
+ # optional
323
+ add_pair post, 'Mpi.threeDSRequestorChallengeIndicator', options[:three_ds_reqchallengeind]
324
+ else
325
+ add_pair post, 'HTTP_ACCEPT', options[:http_accept] || '*/*'
326
+ end
298
327
  end
299
328
 
300
329
  def add_eci(post, eci)
@@ -322,6 +351,7 @@ module ActiveMerchant #:nodoc:
322
351
 
323
352
  def add_address(post, creditcard, options)
324
353
  return unless options[:billing_address]
354
+
325
355
  add_pair post, 'Owneraddress', options[:billing_address][:address1]
326
356
  add_pair post, 'OwnerZip', options[:billing_address][:zip]
327
357
  add_pair post, 'ownertown', options[:billing_address][:city]
@@ -364,10 +394,10 @@ module ActiveMerchant #:nodoc:
364
394
  response = parse(ssl_post(url(parameters['PAYID']), post_data(action, parameters)))
365
395
 
366
396
  options = {
367
- :authorization => [response['PAYID'], action].join(';'),
368
- :test => test?,
369
- :avs_result => { :code => AVS_MAPPING[response['AAVCheck']] },
370
- :cvv_result => CVV_MAPPING[response['CVCCheck']]
397
+ authorization: [response['PAYID'], action].join(';'),
398
+ test: test?,
399
+ avs_result: { code: AVS_MAPPING[response['AAVCheck']] },
400
+ cvv_result: CVV_MAPPING[response['CVCCheck']]
371
401
  }
372
402
  OgoneResponse.new(successful?(response), message_from(response), response, options)
373
403
  end
@@ -408,30 +438,31 @@ module ActiveMerchant #:nodoc:
408
438
 
409
439
  def add_signature(parameters)
410
440
  if @options[:signature].blank?
411
- ActiveMerchant.deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless(@options[:signature_encryptor] == 'none')
441
+ ActiveMerchant.deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless @options[:signature_encryptor] == 'none'
412
442
  return
413
443
  end
414
444
 
415
- add_pair parameters, 'SHASign', calculate_signature(parameters, @options[:signature_encryptor], @options[:signature])
445
+ add_pair parameters, 'SHASIGN', calculate_signature(parameters, @options[:signature_encryptor], @options[:signature])
416
446
  end
417
447
 
418
448
  def calculate_signature(signed_parameters, algorithm, secret)
419
449
  return legacy_calculate_signature(signed_parameters, secret) unless algorithm
420
450
 
421
- sha_encryptor = case algorithm
422
- when 'sha256'
423
- Digest::SHA256
424
- when 'sha512'
425
- Digest::SHA512
426
- when 'sha1'
427
- Digest::SHA1
428
- else
429
- raise "Unknown signature algorithm #{algorithm}"
430
- end
451
+ sha_encryptor =
452
+ case algorithm
453
+ when 'sha256'
454
+ Digest::SHA256
455
+ when 'sha512'
456
+ Digest::SHA512
457
+ when 'sha1'
458
+ Digest::SHA1
459
+ else
460
+ raise "Unknown signature algorithm #{algorithm}"
461
+ end
431
462
 
432
- filtered_params = signed_parameters.select { |k, v| !v.blank? }
463
+ filtered_params = signed_parameters.compact
433
464
  sha_encryptor.hexdigest(
434
- filtered_params.sort_by { |k, v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
465
+ filtered_params.sort_by { |k, _v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('')
435
466
  ).upcase
436
467
  end
437
468
 
@@ -453,7 +484,7 @@ module ActiveMerchant #:nodoc:
453
484
  end
454
485
 
455
486
  def add_pair(post, key, value)
456
- post[key] = value if !value.blank?
487
+ post[key] = value unless value.nil?
457
488
  end
458
489
 
459
490
  def convert_attributes_to_hash(rexml_attributes)
@@ -21,13 +21,13 @@ module ActiveMerchant #:nodoc:
21
21
 
22
22
  # Country supported by Omise
23
23
  # * Thailand
24
- self.supported_countries = %w( TH JP )
24
+ self.supported_countries = %w(TH JP)
25
25
 
26
26
  # Credit cards supported by Omise
27
27
  # * VISA
28
28
  # * MasterCard
29
29
  # * JCB
30
- self.supported_cardtypes = [:visa, :master, :jcb]
30
+ self.supported_cardtypes = %i[visa master jcb]
31
31
 
32
32
  # Omise main page
33
33
  self.homepage_url = 'https://www.omise.co/'
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  # * <tt>:api_version</tt> -- Omise's API Version (OPTIONAL), default version is '2014-07-27'
47
47
  # See version at page https://dashboard.omise.co/api-version/edit
48
48
 
49
- def initialize(options={})
49
+ def initialize(options = {})
50
50
  requires!(options, :public_key, :secret_key)
51
51
  @public_key = options[:public_key]
52
52
  @secret_key = options[:secret_key]
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  #
80
80
  # purchase(money, nil, { :customer_id => customer_id })
81
81
 
82
- def purchase(money, payment_method, options={})
82
+ def purchase(money, payment_method, options = {})
83
83
  create_charge(money, payment_method, options)
84
84
  end
85
85
 
@@ -91,7 +91,7 @@ module ActiveMerchant #:nodoc:
91
91
  # * <tt>payment_method</tt> -- The CreditCard object
92
92
  # * <tt>options</tt> -- An optional parameters, such as token or capture
93
93
 
94
- def authorize(money, payment_method, options={})
94
+ def authorize(money, payment_method, options = {})
95
95
  options[:capture] = 'false'
96
96
  create_charge(money, payment_method, options)
97
97
  end
@@ -104,7 +104,7 @@ module ActiveMerchant #:nodoc:
104
104
  # * <tt>charge_id</tt> -- The CreditCard object
105
105
  # * <tt>options</tt> -- An optional parameters, such as token or capture
106
106
 
107
- def capture(money, charge_id, options={})
107
+ def capture(money, charge_id, options = {})
108
108
  post = {}
109
109
  add_amount(post, money, options)
110
110
  commit(:post, "charges/#{CGI.escape(charge_id)}/capture", post, options)
@@ -118,7 +118,7 @@ module ActiveMerchant #:nodoc:
118
118
  # * <tt>charge_id</tt> -- The CreditCard object
119
119
  # * <tt>options</tt> -- An optional parameters, such as token or capture
120
120
 
121
- def refund(money, charge_id, options={})
121
+ def refund(money, charge_id, options = {})
122
122
  options[:amount] = money if money
123
123
  commit(:post, "charges/#{CGI.escape(charge_id)}/refunds", options)
124
124
  end
@@ -132,7 +132,7 @@ module ActiveMerchant #:nodoc:
132
132
  # 'email' (A customer email)
133
133
  # 'description' (A customer description)
134
134
 
135
- def store(payment_method, options={})
135
+ def store(payment_method, options = {})
136
136
  post, card_params = {}, {}
137
137
  add_customer_data(post, options)
138
138
  add_token(card_params, payment_method, options)
@@ -145,7 +145,7 @@ module ActiveMerchant #:nodoc:
145
145
  #
146
146
  # * <tt>customer_id</tt> -- The Customer identifier (REQUIRED).
147
147
 
148
- def unstore(customer_id, options={})
148
+ def unstore(customer_id, options = {})
149
149
  commit(:delete, "customers/#{CGI.escape(customer_id)}")
150
150
  end
151
151
 
@@ -178,7 +178,7 @@ module ActiveMerchant #:nodoc:
178
178
  commit(:post, 'charges', post, options)
179
179
  end
180
180
 
181
- def headers(options={})
181
+ def headers(options = {})
182
182
  key = options[:key] || @secret_key
183
183
  {
184
184
  'Content-Type' => 'application/json;utf-8',
@@ -197,7 +197,7 @@ module ActiveMerchant #:nodoc:
197
197
  parameters.present? ? parameters.to_json : nil
198
198
  end
199
199
 
200
- def https_request(method, endpoint, parameters=nil, options={})
200
+ def https_request(method, endpoint, parameters = nil, options = {})
201
201
  raw_response = response = nil
202
202
  begin
203
203
  raw_response = ssl_request(method, url_for(endpoint), post_data(parameters), headers(options))
@@ -221,7 +221,7 @@ module ActiveMerchant #:nodoc:
221
221
  { message: msg }
222
222
  end
223
223
 
224
- def commit(method, endpoint, params=nil, options={})
224
+ def commit(method, endpoint, params = nil, options = {})
225
225
  response = https_request(method, endpoint, params, options)
226
226
  Response.new(
227
227
  successful?(response),
@@ -284,7 +284,7 @@ module ActiveMerchant #:nodoc:
284
284
  commit(:post, 'tokens', post, { key: @public_key })
285
285
  end
286
286
 
287
- def add_token(post, credit_card, options={})
287
+ def add_token(post, credit_card, options = {})
288
288
  if options[:token_id].present?
289
289
  post[:card] = options[:token_id]
290
290
  else
@@ -304,11 +304,11 @@ module ActiveMerchant #:nodoc:
304
304
  post[:card] = card
305
305
  end
306
306
 
307
- def add_customer(post, options={})
307
+ def add_customer(post, options = {})
308
308
  post[:customer] = options[:customer_id] if options[:customer_id]
309
309
  end
310
310
 
311
- def add_customer_data(post, options={})
311
+ def add_customer_data(post, options = {})
312
312
  post[:description] = options[:description] if options[:description]
313
313
  post[:email] = options[:email] if options[:email]
314
314
  end
@@ -318,7 +318,6 @@ module ActiveMerchant #:nodoc:
318
318
  post[:currency] = (options[:currency] || currency(money))
319
319
  post[:description] = options[:description] if options.key?(:description)
320
320
  end
321
-
322
321
  end
323
322
  end
324
323
  end