activemerchant 1.133.0 → 1.138.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +450 -0
  3. data/CONTRIBUTORS +1 -0
  4. data/lib/active_merchant/billing/apple_pay_payment_token.rb +2 -2
  5. data/lib/active_merchant/billing/base.rb +2 -2
  6. data/lib/active_merchant/billing/check.rb +16 -4
  7. data/lib/active_merchant/billing/compatibility.rb +4 -4
  8. data/lib/active_merchant/billing/credit_card.rb +35 -16
  9. data/lib/active_merchant/billing/credit_card_formatting.rb +13 -2
  10. data/lib/active_merchant/billing/credit_card_methods.rb +74 -19
  11. data/lib/active_merchant/billing/gateway.rb +22 -2
  12. data/lib/active_merchant/billing/gateways/adyen.rb +282 -87
  13. data/lib/active_merchant/billing/gateways/airwallex.rb +46 -25
  14. data/lib/active_merchant/billing/gateways/alelo.rb +29 -11
  15. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/authorize_net.rb +49 -41
  17. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +14 -10
  18. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -5
  19. data/lib/active_merchant/billing/gateways/axcessms.rb +9 -5
  20. data/lib/active_merchant/billing/gateways/balanced.rb +2 -2
  21. data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
  22. data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/banwire.rb +6 -4
  24. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +8 -8
  25. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +2 -2
  26. data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
  27. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +12 -8
  28. data/lib/active_merchant/billing/gateways/beanstream.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +2 -2
  30. data/lib/active_merchant/billing/gateways/blue_pay.rb +15 -7
  31. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -5
  32. data/lib/active_merchant/billing/gateways/bogus.rb +2 -2
  33. data/lib/active_merchant/billing/gateways/borgun.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/bpoint.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +3 -1
  36. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +68 -23
  37. data/lib/active_merchant/billing/gateways/braintree.rb +2 -2
  38. data/lib/active_merchant/billing/gateways/braintree_blue.rb +266 -89
  39. data/lib/active_merchant/billing/gateways/braintree_orange.rb +3 -3
  40. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  42. data/lib/active_merchant/billing/gateways/card_connect.rb +7 -4
  43. data/lib/active_merchant/billing/gateways/card_save.rb +2 -2
  44. data/lib/active_merchant/billing/gateways/card_stream.rb +12 -13
  45. data/lib/active_merchant/billing/gateways/cardknox.rb +2 -2
  46. data/lib/active_merchant/billing/gateways/cardprocess.rb +2 -2
  47. data/lib/active_merchant/billing/gateways/cashnet.rb +4 -4
  48. data/lib/active_merchant/billing/gateways/cc5.rb +2 -2
  49. data/lib/active_merchant/billing/gateways/cecabank/cecabank_common.rb +36 -0
  50. data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +331 -0
  51. data/lib/active_merchant/billing/gateways/cecabank/cecabank_xml.rb +220 -0
  52. data/lib/active_merchant/billing/gateways/cecabank.rb +9 -242
  53. data/lib/active_merchant/billing/gateways/cenpos.rb +9 -3
  54. data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
  55. data/lib/active_merchant/billing/gateways/checkout_v2.rb +362 -50
  56. data/lib/active_merchant/billing/gateways/clearhaus.rb +2 -2
  57. data/lib/active_merchant/billing/gateways/commerce_hub.rb +117 -35
  58. data/lib/active_merchant/billing/gateways/commercegate.rb +4 -4
  59. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  60. data/lib/active_merchant/billing/gateways/creditcall.rb +2 -2
  61. data/lib/active_merchant/billing/gateways/credorax.rb +109 -20
  62. data/lib/active_merchant/billing/gateways/ct_payment.rb +6 -6
  63. data/lib/active_merchant/billing/gateways/culqi.rb +2 -2
  64. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +2 -2
  65. data/lib/active_merchant/billing/gateways/cyber_source.rb +379 -100
  66. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +147 -76
  67. data/lib/active_merchant/billing/gateways/d_local.rb +45 -22
  68. data/lib/active_merchant/billing/gateways/data_cash.rb +22 -18
  69. data/lib/active_merchant/billing/gateways/datatrans.rb +284 -0
  70. data/lib/active_merchant/billing/gateways/decidir.rb +82 -46
  71. data/lib/active_merchant/billing/gateways/decidir_plus.rb +31 -35
  72. data/lib/active_merchant/billing/gateways/deepstack.rb +382 -0
  73. data/lib/active_merchant/billing/gateways/dibs.rb +3 -3
  74. data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
  75. data/lib/active_merchant/billing/gateways/ebanx.rb +116 -68
  76. data/lib/active_merchant/billing/gateways/efsnet.rb +13 -8
  77. data/lib/active_merchant/billing/gateways/elavon.rb +80 -47
  78. data/lib/active_merchant/billing/gateways/element.rb +39 -10
  79. data/lib/active_merchant/billing/gateways/epay.rb +8 -4
  80. data/lib/active_merchant/billing/gateways/evo_ca.rb +8 -4
  81. data/lib/active_merchant/billing/gateways/eway.rb +6 -4
  82. data/lib/active_merchant/billing/gateways/eway_managed.rb +8 -4
  83. data/lib/active_merchant/billing/gateways/eway_rapid.rb +3 -3
  84. data/lib/active_merchant/billing/gateways/exact.rb +8 -4
  85. data/lib/active_merchant/billing/gateways/fat_zebra.rb +37 -7
  86. data/lib/active_merchant/billing/gateways/federated_canada.rb +8 -4
  87. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  88. data/lib/active_merchant/billing/gateways/first_giving.rb +2 -2
  89. data/lib/active_merchant/billing/gateways/first_pay/first_pay_common.rb +15 -0
  90. data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +190 -0
  91. data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +183 -0
  92. data/lib/active_merchant/billing/gateways/first_pay.rb +8 -174
  93. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +8 -4
  94. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +9 -5
  95. data/lib/active_merchant/billing/gateways/flex_charge.rb +359 -0
  96. data/lib/active_merchant/billing/gateways/flo2cash.rb +4 -2
  97. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
  98. data/lib/active_merchant/billing/gateways/forte.rb +6 -4
  99. data/lib/active_merchant/billing/gateways/fortis.rb +347 -0
  100. data/lib/active_merchant/billing/gateways/garanti.rb +6 -4
  101. data/lib/active_merchant/billing/gateways/global_collect.rb +69 -50
  102. data/lib/active_merchant/billing/gateways/global_transport.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/hdfc.rb +2 -2
  104. data/lib/active_merchant/billing/gateways/hi_pay.rb +287 -0
  105. data/lib/active_merchant/billing/gateways/hps.rb +40 -47
  106. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  107. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +2 -2
  108. data/lib/active_merchant/billing/gateways/inspire.rb +8 -6
  109. data/lib/active_merchant/billing/gateways/instapay.rb +9 -6
  110. data/lib/active_merchant/billing/gateways/ipg.rb +14 -10
  111. data/lib/active_merchant/billing/gateways/ipp.rb +2 -2
  112. data/lib/active_merchant/billing/gateways/iridium.rb +18 -8
  113. data/lib/active_merchant/billing/gateways/itransact.rb +8 -4
  114. data/lib/active_merchant/billing/gateways/iveri.rb +12 -9
  115. data/lib/active_merchant/billing/gateways/ixopay.rb +4 -4
  116. data/lib/active_merchant/billing/gateways/jetpay.rb +6 -4
  117. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +9 -6
  118. data/lib/active_merchant/billing/gateways/komoju.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/kushki.rb +79 -16
  120. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/linkpoint.rb +8 -4
  122. data/lib/active_merchant/billing/gateways/litle.rb +37 -54
  123. data/lib/active_merchant/billing/gateways/loan_payment_pro.rb +267 -0
  124. data/lib/active_merchant/billing/gateways/loan_payment_pro_ach.rb +93 -0
  125. data/lib/active_merchant/billing/gateways/mastercard.rb +4 -4
  126. data/lib/active_merchant/billing/gateways/maxipago.rb +4 -4
  127. data/lib/active_merchant/billing/gateways/mercado_pago.rb +32 -11
  128. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +10 -7
  129. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  130. data/lib/active_merchant/billing/gateways/merchant_partners.rb +2 -2
  131. data/lib/active_merchant/billing/gateways/merchant_ware.rb +13 -6
  132. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +13 -6
  133. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +21 -5
  134. data/lib/active_merchant/billing/gateways/mercury.rb +11 -5
  135. data/lib/active_merchant/billing/gateways/metrics_global.rb +10 -8
  136. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  137. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -6
  138. data/lib/active_merchant/billing/gateways/migs.rb +8 -4
  139. data/lib/active_merchant/billing/gateways/mit.rb +10 -5
  140. data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
  141. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +21 -13
  142. data/lib/active_merchant/billing/gateways/moka.rb +2 -2
  143. data/lib/active_merchant/billing/gateways/monei.rb +3 -3
  144. data/lib/active_merchant/billing/gateways/moneris.rb +11 -5
  145. data/lib/active_merchant/billing/gateways/money_movers.rb +8 -4
  146. data/lib/active_merchant/billing/gateways/multi_pay.rb +267 -0
  147. data/lib/active_merchant/billing/gateways/mundipagg.rb +5 -3
  148. data/lib/active_merchant/billing/gateways/nab_transact.rb +18 -10
  149. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +2 -2
  150. data/lib/active_merchant/billing/gateways/net_registry.rb +6 -2
  151. data/lib/active_merchant/billing/gateways/netaxept.rb +4 -4
  152. data/lib/active_merchant/billing/gateways/netbanx.rb +4 -6
  153. data/lib/active_merchant/billing/gateways/netbilling.rb +8 -4
  154. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/network_merchants.rb +9 -5
  156. data/lib/active_merchant/billing/gateways/nmi.rb +29 -8
  157. data/lib/active_merchant/billing/gateways/nuvei.rb +573 -0
  158. data/lib/active_merchant/billing/gateways/ogone.rb +8 -4
  159. data/lib/active_merchant/billing/gateways/omise.rb +2 -2
  160. data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
  161. data/lib/active_merchant/billing/gateways/opp.rb +3 -4
  162. data/lib/active_merchant/billing/gateways/optimal_payment.rb +12 -6
  163. data/lib/active_merchant/billing/gateways/orbital/orbital_codes.rb +273 -0
  164. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +3 -5
  165. data/lib/active_merchant/billing/gateways/orbital.rb +114 -94
  166. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +9 -6
  167. data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
  168. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  169. data/lib/active_merchant/billing/gateways/pay_arc.rb +9 -7
  170. data/lib/active_merchant/billing/gateways/pay_conex.rb +6 -4
  171. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +8 -4
  172. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -5
  173. data/lib/active_merchant/billing/gateways/pay_junction.rb +8 -4
  174. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  175. data/lib/active_merchant/billing/gateways/pay_secure.rb +8 -4
  176. data/lib/active_merchant/billing/gateways/pay_trace.rb +36 -22
  177. data/lib/active_merchant/billing/gateways/paybox_direct.rb +14 -14
  178. data/lib/active_merchant/billing/gateways/payeezy.rb +26 -13
  179. data/lib/active_merchant/billing/gateways/payex.rb +8 -6
  180. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +3 -3
  181. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +2 -2
  182. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +2 -2
  183. data/lib/active_merchant/billing/gateways/payflow.rb +12 -11
  184. data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
  185. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +2 -2
  186. data/lib/active_merchant/billing/gateways/payflow_uk.rb +2 -2
  187. data/lib/active_merchant/billing/gateways/payment_express.rb +10 -6
  188. data/lib/active_merchant/billing/gateways/paymentez.rb +30 -16
  189. data/lib/active_merchant/billing/gateways/paymill.rb +6 -4
  190. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +17 -12
  191. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +2 -2
  192. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +2 -2
  193. data/lib/active_merchant/billing/gateways/paypal.rb +4 -2
  194. data/lib/active_merchant/billing/gateways/paypal_ca.rb +2 -2
  195. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
  196. data/lib/active_merchant/billing/gateways/paypal_express.rb +4 -2
  197. data/lib/active_merchant/billing/gateways/paysafe.rb +48 -24
  198. data/lib/active_merchant/billing/gateways/payscout.rb +9 -6
  199. data/lib/active_merchant/billing/gateways/paystation.rb +9 -5
  200. data/lib/active_merchant/billing/gateways/payu_in.rb +2 -2
  201. data/lib/active_merchant/billing/gateways/payu_latam.rb +7 -5
  202. data/lib/active_merchant/billing/gateways/payway.rb +6 -2
  203. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +6 -6
  204. data/lib/active_merchant/billing/gateways/pin.rb +126 -41
  205. data/lib/active_merchant/billing/gateways/plexo.rb +71 -20
  206. data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -2
  207. data/lib/active_merchant/billing/gateways/priority.rb +29 -24
  208. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  209. data/lib/active_merchant/billing/gateways/psigate.rb +8 -4
  210. data/lib/active_merchant/billing/gateways/psl_card.rb +6 -2
  211. data/lib/active_merchant/billing/gateways/qbms.rb +9 -5
  212. data/lib/active_merchant/billing/gateways/quantum.rb +9 -5
  213. data/lib/active_merchant/billing/gateways/quickbooks.rb +27 -17
  214. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -4
  215. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +8 -4
  216. data/lib/active_merchant/billing/gateways/quickpay.rb +2 -2
  217. data/lib/active_merchant/billing/gateways/qvalent.rb +2 -2
  218. data/lib/active_merchant/billing/gateways/rapyd.rb +172 -53
  219. data/lib/active_merchant/billing/gateways/reach.rb +16 -9
  220. data/lib/active_merchant/billing/gateways/redsys.rb +7 -15
  221. data/lib/active_merchant/billing/gateways/redsys_rest.rb +545 -0
  222. data/lib/active_merchant/billing/gateways/s5.rb +5 -5
  223. data/lib/active_merchant/billing/gateways/safe_charge.rb +47 -24
  224. data/lib/active_merchant/billing/gateways/sage.rb +14 -6
  225. data/lib/active_merchant/billing/gateways/sage_pay.rb +81 -7
  226. data/lib/active_merchant/billing/gateways/sallie_mae.rb +8 -4
  227. data/lib/active_merchant/billing/gateways/secure_net.rb +9 -5
  228. data/lib/active_merchant/billing/gateways/secure_pay.rb +10 -8
  229. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +25 -15
  230. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +8 -4
  231. data/lib/active_merchant/billing/gateways/securion_pay.rb +26 -12
  232. data/lib/active_merchant/billing/gateways/shift4.rb +34 -26
  233. data/lib/active_merchant/billing/gateways/shift4_v2.rb +117 -0
  234. data/lib/active_merchant/billing/gateways/simetrik.rb +26 -17
  235. data/lib/active_merchant/billing/gateways/skip_jack.rb +8 -4
  236. data/lib/active_merchant/billing/gateways/smart_ps.rb +10 -7
  237. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -4
  238. data/lib/active_merchant/billing/gateways/spreedly_core.rb +4 -6
  239. data/lib/active_merchant/billing/gateways/stripe.rb +88 -84
  240. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +388 -77
  241. data/lib/active_merchant/billing/gateways/sum_up.rb +224 -0
  242. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +6 -4
  243. data/lib/active_merchant/billing/gateways/telr.rb +6 -7
  244. data/lib/active_merchant/billing/gateways/trans_first.rb +6 -4
  245. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +10 -18
  246. data/lib/active_merchant/billing/gateways/transact_pro.rb +3 -3
  247. data/lib/active_merchant/billing/gateways/transax.rb +2 -2
  248. data/lib/active_merchant/billing/gateways/transnational.rb +2 -2
  249. data/lib/active_merchant/billing/gateways/trexle.rb +2 -2
  250. data/lib/active_merchant/billing/gateways/trust_commerce.rb +9 -5
  251. data/lib/active_merchant/billing/gateways/usa_epay.rb +2 -2
  252. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -31
  253. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -4
  254. data/lib/active_merchant/billing/gateways/vanco.rb +2 -4
  255. data/lib/active_merchant/billing/gateways/vantiv_express.rb +668 -0
  256. data/lib/active_merchant/billing/gateways/verifi.rb +12 -8
  257. data/lib/active_merchant/billing/gateways/versa_pay.rb +307 -0
  258. data/lib/active_merchant/billing/gateways/viaklix.rb +8 -4
  259. data/lib/active_merchant/billing/gateways/visanet_peru.rb +5 -5
  260. data/lib/active_merchant/billing/gateways/vpos.rb +25 -13
  261. data/lib/active_merchant/billing/gateways/webpay.rb +3 -3
  262. data/lib/active_merchant/billing/gateways/wepay.rb +6 -4
  263. data/lib/active_merchant/billing/gateways/wirecard.rb +10 -6
  264. data/lib/active_merchant/billing/gateways/wompi.rb +14 -7
  265. data/lib/active_merchant/billing/gateways/world_net.rb +2 -2
  266. data/lib/active_merchant/billing/gateways/worldpay.rb +297 -113
  267. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +16 -13
  268. data/lib/active_merchant/billing/gateways/worldpay_us.rb +2 -2
  269. data/lib/active_merchant/billing/gateways/xpay.rb +244 -0
  270. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +15 -3
  271. data/lib/active_merchant/billing/payment_token.rb +2 -2
  272. data/lib/active_merchant/billing/response.rb +7 -6
  273. data/lib/active_merchant/billing.rb +1 -0
  274. data/lib/active_merchant/connection.rb +8 -20
  275. data/lib/active_merchant/country.rb +3 -1
  276. data/lib/active_merchant/errors.rb +12 -2
  277. data/lib/active_merchant/net_http_ssl_connection.rb +35 -0
  278. data/lib/active_merchant/posts_data.rb +19 -4
  279. data/lib/active_merchant/version.rb +1 -1
  280. data/lib/active_merchant/versionable.rb +29 -0
  281. data/lib/certs/cacert.pem +1326 -1491
  282. data/lib/support/gateway_support.rb +3 -3
  283. data/lib/support/ssl_verify.rb +6 -6
  284. data/lib/support/ssl_version.rb +8 -8
  285. metadata +35 -9
@@ -1,8 +1,8 @@
1
1
  require 'digest/md5'
2
2
  require 'rexml/document'
3
3
 
4
- module ActiveMerchant #:nodoc:
5
- module Billing #:nodoc:
4
+ module ActiveMerchant # :nodoc:
5
+ module Billing # :nodoc:
6
6
  class MerchantWarriorGateway < Gateway
7
7
  TOKEN_TEST_URL = 'https://base.merchantwarrior.com/token/'
8
8
  TOKEN_LIVE_URL = 'https://api.merchantwarrior.com/token/'
@@ -32,6 +32,8 @@ module ActiveMerchant #:nodoc:
32
32
  add_payment_method(post, payment_method)
33
33
  add_recurring_flag(post, options)
34
34
  add_soft_descriptors(post, options)
35
+ add_three_ds(post, options)
36
+ post['storeID'] = options[:store_id] if options[:store_id]
35
37
  commit('processAuth', post)
36
38
  end
37
39
 
@@ -43,6 +45,8 @@ module ActiveMerchant #:nodoc:
43
45
  add_payment_method(post, payment_method)
44
46
  add_recurring_flag(post, options)
45
47
  add_soft_descriptors(post, options)
48
+ add_three_ds(post, options)
49
+ post['storeID'] = options[:store_id] if options[:store_id]
46
50
  commit('processCard', post)
47
51
  end
48
52
 
@@ -111,9 +115,9 @@ module ActiveMerchant #:nodoc:
111
115
  post['customerCity'] = address[:city]
112
116
  post['customerAddress'] = address[:address1]
113
117
  post['customerPostCode'] = address[:zip]
114
- post['customerIP'] = address[:ip]
115
- post['customerPhone'] = address[:phone]
116
- post['customerEmail'] = address[:email]
118
+ post['customerIP'] = address[:ip] || options[:ip]
119
+ post['customerPhone'] = address[:phone] || address[:phone_number]
120
+ post['customerEmail'] = address[:email] || options[:email]
117
121
  end
118
122
 
119
123
  def add_order_id(post, options)
@@ -184,6 +188,18 @@ module ActiveMerchant #:nodoc:
184
188
  )
185
189
  end
186
190
 
191
+ def add_three_ds(post, options)
192
+ return unless three_d_secure = options[:three_d_secure]
193
+
194
+ post.merge!({
195
+ threeDSEci: three_d_secure[:eci],
196
+ threeDSXid: three_d_secure[:xid] || three_d_secure[:ds_transaction_id],
197
+ threeDSCavv: three_d_secure[:cavv],
198
+ threeDSStatus: three_d_secure[:authentication_response_status],
199
+ threeDSV2Version: three_d_secure[:version]
200
+ }.compact)
201
+ end
202
+
187
203
  def parse(body)
188
204
  xml = REXML::Document.new(body)
189
205
 
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  # The Mercury gateway integration by default requires that the Mercury
4
4
  # account being used has tokenization turned. This enables the use of
5
5
  # capture/refund/void without having to pass the credit card back in each
@@ -302,12 +302,16 @@ module ActiveMerchant #:nodoc:
302
302
  success = SUCCESS_CODES.include?(response[:cmd_status])
303
303
  message = success ? 'Success' : message_from(response)
304
304
 
305
- Response.new(success, message, response,
305
+ Response.new(
306
+ success,
307
+ message,
308
+ response,
306
309
  test: test?,
307
310
  authorization: authorization_from(response),
308
311
  avs_result: { code: response[:avs_result] },
309
312
  cvv_result: response[:cvv_result],
310
- error_code: success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]])
313
+ error_code: success ? nil : STANDARD_ERROR_CODE_MAPPING[response[:dsix_return_code]]
314
+ )
311
315
  end
312
316
 
313
317
  def message_from(response)
@@ -345,7 +349,9 @@ module ActiveMerchant #:nodoc:
345
349
  end
346
350
 
347
351
  def unescape_xml(escaped_xml)
348
- escaped_xml.gsub(/\&gt;/, '>').gsub(/\&lt;/, '<')
352
+ xml = escaped_xml.gsub(/\&gt;/, '>').gsub(/\r/, '').gsub(/\n/, '').gsub(/\t/, '').gsub('&lt;', '<')
353
+ xml.slice! "<?xml version=\"1.0\"?>" # rubocop:disable Style/StringLiterals
354
+ xml
349
355
  end
350
356
  end
351
357
  end
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  # For more information on the Metrics Global Payment Gateway, visit the {Metrics Global website}[www.metricsglobal.com].
4
4
  # Further documentation on AVS and CVV response codes are available under the support section of the Metrics Global
5
5
  # control panel.
@@ -175,12 +175,16 @@ module ActiveMerchant #:nodoc:
175
175
  # (TESTMODE) Successful Sale
176
176
  test_mode = test? || message =~ /TESTMODE/
177
177
 
178
- Response.new(success?(response), message, response,
178
+ Response.new(
179
+ success?(response),
180
+ message,
181
+ response,
179
182
  test: test_mode,
180
183
  authorization: response[:transaction_id],
181
184
  fraud_review: fraud_review?(response),
182
185
  avs_result: { code: response[:avs_result_code] },
183
- cvv_result: response[:card_code])
186
+ cvv_result: response[:card_code]
187
+ )
184
188
  end
185
189
 
186
190
  def success?(response)
@@ -194,7 +198,7 @@ module ActiveMerchant #:nodoc:
194
198
  def parse(body)
195
199
  fields = split(body)
196
200
 
197
- results = {
201
+ {
198
202
  response_code: fields[RESPONSE_CODE].to_i,
199
203
  response_reason_code: fields[RESPONSE_REASON_CODE],
200
204
  response_reason_text: fields[RESPONSE_REASON_TEXT],
@@ -202,7 +206,6 @@ module ActiveMerchant #:nodoc:
202
206
  transaction_id: fields[TRANSACTION_ID],
203
207
  card_code: fields[CARD_CODE_RESPONSE_CODE]
204
208
  }
205
- results
206
209
  end
207
210
 
208
211
  def post_data(action, parameters = {})
@@ -218,8 +221,7 @@ module ActiveMerchant #:nodoc:
218
221
  post[:encap_char] = '$'
219
222
  post[:solution_ID] = application_id if application_id
220
223
 
221
- request = post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
222
- request
224
+ post.merge(parameters).collect { |key, value| "x_#{key}=#{CGI.escape(value.to_s)}" }.join('&')
223
225
  end
224
226
 
225
227
  def add_invoice(post, options)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class MicropaymentGateway < Gateway
4
4
  self.display_name = 'micropayment'
5
5
  self.homepage_url = 'https://www.micropayment.de/'
@@ -71,6 +71,7 @@ module ActiveMerchant
71
71
 
72
72
  class CreditCardType
73
73
  attr_accessor :am_code, :migs_code, :migs_long_code, :name
74
+
74
75
  def initialize(am_code, migs_code, migs_long_code, name)
75
76
  @am_code = am_code
76
77
  @migs_code = migs_code
@@ -85,13 +86,13 @@ module ActiveMerchant
85
86
  # migs_code: Used in response for purchase/authorize/status
86
87
  # migs_long_code: Used to pre-select card for server_purchase_url
87
88
  # name: The nice display name
88
- %w(american_express AE Amex American\ Express),
89
- %w(diners_club DC Dinersclub Diners\ Club),
90
- %w(jcb JC JCB JCB\ Card),
91
- %w(maestro MS Maestro Maestro\ Card),
89
+ ['american_express', 'AE', 'Amex', 'American Express'],
90
+ ['diners_club', 'DC', 'Dinersclub', 'Diners Club'],
91
+ ['jcb', 'JC', 'JCB', 'JCB Card'],
92
+ ['maestro', 'MS', 'Maestro', 'Maestro Card'],
92
93
  %w(master MC Mastercard MasterCard),
93
- %w(na PL PrivateLabelCard Private\ Label\ Card),
94
- %w(visa VC Visa Visa\ Card)
94
+ ['na', 'PL', 'PrivateLabelCard', 'Private Label Card'],
95
+ ['visa', 'VC', 'Visa', 'Visa Card']
95
96
  ].map do |am_code, migs_code, migs_long_code, name|
96
97
  CreditCardType.new(am_code, migs_code, migs_long_code, name)
97
98
  end
@@ -1,7 +1,7 @@
1
1
  require 'active_merchant/billing/gateways/migs/migs_codes'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class MigsGateway < Gateway
6
6
  include MigsCodes
7
7
 
@@ -281,12 +281,16 @@ module ActiveMerchant #:nodoc:
281
281
  cvv_result_code = response[:CSCResultCode]
282
282
  cvv_result_code = 'P' if cvv_result_code == 'Unsupported'
283
283
 
284
- Response.new(success?(response), response[:Message], response,
284
+ Response.new(
285
+ success?(response),
286
+ response[:Message],
287
+ response,
285
288
  test: test?,
286
289
  authorization: response[:TransactionNo],
287
290
  fraud_review: fraud_review?(response),
288
291
  avs_result: { code: avs_response_code },
289
- cvv_result: cvv_result_code)
292
+ cvv_result: cvv_result_code
293
+ )
290
294
  end
291
295
 
292
296
  def success?(response)
@@ -3,10 +3,11 @@ require 'openssl'
3
3
  require 'digest'
4
4
  require 'base64'
5
5
 
6
- module ActiveMerchant #:nodoc:
7
- module Billing #:nodoc:
6
+ module ActiveMerchant # :nodoc:
7
+ module Billing # :nodoc:
8
8
  class MitGateway < Gateway
9
9
  self.live_url = 'https://wpy.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
10
+ self.test_url = 'https://shoppingrc.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
10
11
 
11
12
  self.supported_countries = ['MX']
12
13
  self.default_currency = 'MXN'
@@ -41,7 +42,7 @@ module ActiveMerchant #:nodoc:
41
42
  # original message
42
43
  full_data = unpacked[0].bytes.slice(16, unpacked[0].bytes.length)
43
44
  # Creates the engine
44
- engine = OpenSSL::Cipher::AES128.new(:CBC)
45
+ engine = OpenSSL::Cipher.new('aes-128-cbc')
45
46
  # Set engine as decrypt mode
46
47
  engine.decrypt
47
48
  # Converts the key from hex to bytes
@@ -54,7 +55,7 @@ module ActiveMerchant #:nodoc:
54
55
 
55
56
  def encrypt(val, keyinhex)
56
57
  # Creates the engine motor
57
- engine = OpenSSL::Cipher::AES128.new(:CBC)
58
+ engine = OpenSSL::Cipher.new('aes-128-cbc')
58
59
  # Set engine as encrypt mode
59
60
  engine.encrypt
60
61
  # Converts the key from hex to bytes
@@ -220,8 +221,12 @@ module ActiveMerchant #:nodoc:
220
221
  post[:name_client] = [payment.first_name, payment.last_name].join(' ')
221
222
  end
222
223
 
224
+ def url
225
+ test? ? test_url : live_url
226
+ end
227
+
223
228
  def commit(action, parameters)
224
- raw_response = ssl_post(live_url, parameters, { 'Content-type' => 'text/plain' })
229
+ raw_response = ssl_post(url, parameters, { 'Content-type' => 'text/plain' })
225
230
  response = JSON.parse(decrypt(raw_response, @options[:key_session]))
226
231
 
227
232
  Response.new(
@@ -1,7 +1,7 @@
1
1
  require 'active_merchant/billing/gateways/modern_payments_cim'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class ModernPaymentsGateway < Gateway
6
6
  self.supported_countries = ModernPaymentsCimGateway.supported_countries
7
7
  self.supported_cardtypes = ModernPaymentsCimGateway.supported_cardtypes
@@ -1,6 +1,6 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
3
- class ModernPaymentsCimGateway < Gateway #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
+ class ModernPaymentsCimGateway < Gateway # :nodoc:
4
4
  self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
5
5
  self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
6
6
 
@@ -111,13 +111,12 @@ module ActiveMerchant #:nodoc:
111
111
  end
112
112
 
113
113
  def build_request(action, params)
114
+ envelope_obj = { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
115
+ 'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
116
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' }
114
117
  xml = Builder::XmlMarkup.new indent: 2
115
118
  xml.instruct!
116
- xml.tag! 'env:Envelope',
117
- { 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
118
- 'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
119
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } do
120
-
119
+ xml.tag! 'env:Envelope', envelope_obj do
121
120
  xml.tag! 'env:Body' do
122
121
  xml.tag! action, { 'xmlns' => xmlns(action) } do
123
122
  xml.tag! 'clientId', @options[:login]
@@ -146,15 +145,24 @@ module ActiveMerchant #:nodoc:
146
145
  end
147
146
 
148
147
  def commit(action, params)
149
- data = ssl_post(url(action), build_request(action, params),
150
- { 'Content-Type' => 'text/xml; charset=utf-8',
151
- 'SOAPAction' => "#{xmlns(action)}#{action}" })
148
+ data = ssl_post(
149
+ url(action),
150
+ build_request(action, params),
151
+ {
152
+ 'Content-Type' => 'text/xml; charset=utf-8',
153
+ 'SOAPAction' => "#{xmlns(action)}#{action}"
154
+ }
155
+ )
152
156
 
153
157
  response = parse(action, data)
154
- Response.new(successful?(action, response), message_from(action, response), response,
158
+ Response.new(
159
+ successful?(action, response),
160
+ message_from(action, response),
161
+ response,
155
162
  test: test?,
156
163
  authorization: authorization_from(action, response),
157
- avs_result: { code: response[:avs_code] })
164
+ avs_result: { code: response[:avs_code] }
165
+ )
158
166
  end
159
167
 
160
168
  def authorization_from(action, response)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class MokaGateway < Gateway
4
4
  self.test_url = 'https://service.refmoka.com'
5
5
  self.live_url = 'https://service.moka.com'
@@ -1,7 +1,7 @@
1
1
  require 'nokogiri'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  #
6
6
  # == Monei gateway
7
7
  # This class implements Monei gateway for Active Merchant. For more information about Monei
@@ -337,7 +337,7 @@ module ActiveMerchant #:nodoc:
337
337
  endpoint = translate_action_endpoint(action, options)
338
338
  headers = {
339
339
  'Content-Type': 'application/json;charset=UTF-8',
340
- 'Authorization': @options[:api_key],
340
+ Authorization: @options[:api_key],
341
341
  'User-Agent': 'MONEI/Shopify/0.1.0'
342
342
  }
343
343
 
@@ -1,7 +1,7 @@
1
1
  require 'rexml/document'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  # To learn more about the Moneris gateway, please contact
6
6
  # eselectplus@moneris.com for a copy of their integration guide. For
7
7
  # information on remote testing, please see "Test Environment Penny Value
@@ -54,6 +54,7 @@ module ActiveMerchant #:nodoc:
54
54
  post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
55
55
  add_external_mpi_fields(post, options)
56
56
  add_stored_credential(post, options)
57
+ add_cust_id(post, options)
57
58
  action = if post[:cavv] || options[:three_d_secure]
58
59
  'cavv_preauth'
59
60
  elsif post[:data_key].blank?
@@ -78,6 +79,7 @@ module ActiveMerchant #:nodoc:
78
79
  post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
79
80
  add_external_mpi_fields(post, options)
80
81
  add_stored_credential(post, options)
82
+ add_cust_id(post, options)
81
83
  action = if post[:cavv] || options[:three_d_secure]
82
84
  'cavv_purchase'
83
85
  elsif post[:data_key].blank?
@@ -216,7 +218,7 @@ module ActiveMerchant #:nodoc:
216
218
  three_d_secure_options = options[:three_d_secure]
217
219
 
218
220
  post[:threeds_version] = three_d_secure_options[:version]
219
- post[:crypt_type] = three_d_secure_options[:eci]
221
+ post[:crypt_type] = three_d_secure_options.dig(:eci)&.to_s&.sub!(/^0/, '')
220
222
  post[:cavv] = three_d_secure_options[:cavv]
221
223
  post[:threeds_server_trans_id] = three_d_secure_options[:three_ds_server_trans_id]
222
224
  post[:ds_trans_id] = three_d_secure_options[:ds_transaction_id]
@@ -248,6 +250,10 @@ module ActiveMerchant #:nodoc:
248
250
  post[:payment_information] = options[:payment_information] if options[:payment_information]
249
251
  end
250
252
 
253
+ def add_cust_id(post, options)
254
+ post[:cust_id] = options[:cust_id] if options[:cust_id]
255
+ end
256
+
251
257
  def add_stored_credential(post, options)
252
258
  add_cof(post, options)
253
259
  # if any of :issuer_id, :payment_information, or :payment_indicator is not passed,
@@ -467,8 +473,8 @@ module ActiveMerchant #:nodoc:
467
473
  'indrefund' => %i[order_id cust_id amount pan expdate crypt_type],
468
474
  'completion' => %i[order_id comp_amount txn_number crypt_type],
469
475
  'purchasecorrection' => %i[order_id txn_number crypt_type],
470
- 'cavv_preauth' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
471
- 'cavv_purchase' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator],
476
+ 'cavv_preauth' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator threeds_version threeds_server_trans_id ds_trans_id],
477
+ 'cavv_purchase' => %i[order_id cust_id amount pan expdate cavv crypt_type wallet_indicator threeds_version threeds_server_trans_id ds_trans_id],
472
478
  'card_verification' => %i[order_id cust_id pan expdate crypt_type avs_info cvd_info cof_info],
473
479
  'transact' => %i[order_id cust_id amount pan expdate crypt_type],
474
480
  'Batchcloseall' => [],
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class MoneyMoversGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://secure.mmoagateway.com/api/transact.php'
5
5
 
@@ -113,11 +113,15 @@ module ActiveMerchant #:nodoc:
113
113
  response = parse(data)
114
114
  message = message_from(response)
115
115
 
116
- Response.new(success?(response), message, response,
116
+ Response.new(
117
+ success?(response),
118
+ message,
119
+ response,
117
120
  test: test?,
118
121
  authorization: response['transactionid'],
119
122
  avs_result: { code: response['avsresponse'] },
120
- cvv_result: response['cvvresponse'])
123
+ cvv_result: response['cvvresponse']
124
+ )
121
125
  end
122
126
 
123
127
  def success?(response)