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 'nokogiri'
2
2
  require 'securerandom'
3
3
 
4
- module ActiveMerchant #:nodoc:
5
- module Billing #:nodoc:
4
+ module ActiveMerchant # :nodoc:
5
+ module Billing # :nodoc:
6
6
  class ElementGateway < Gateway
7
7
  self.test_url = 'https://certtransaction.elementexpress.com/express.asmx'
8
8
  self.live_url = 'https://transaction.elementexpress.com/express.asmx'
@@ -37,6 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  add_transaction(xml, money, options)
38
38
  add_terminal(xml, options)
39
39
  add_address(xml, options)
40
+ add_lodging(xml, options)
40
41
  end
41
42
  end
42
43
 
@@ -51,6 +52,7 @@ module ActiveMerchant #:nodoc:
51
52
  add_transaction(xml, money, options)
52
53
  add_terminal(xml, options)
53
54
  add_address(xml, options)
55
+ add_lodging(xml, options)
54
56
  end
55
57
  end
56
58
 
@@ -102,7 +104,7 @@ module ActiveMerchant #:nodoc:
102
104
 
103
105
  def void(authorization, options = {})
104
106
  trans_id, trans_amount = split_authorization(authorization)
105
- options.merge!({ trans_id: trans_id, trans_amount: trans_amount, reversal_type: 'Full' })
107
+ options.merge!({ trans_id:, trans_amount:, reversal_type: 'Full' })
106
108
 
107
109
  request = build_soap_request do |xml|
108
110
  xml.CreditCardReversal(xmlns: 'https://transaction.elementexpress.com') do
@@ -222,16 +224,44 @@ module ActiveMerchant #:nodoc:
222
224
  options[:market_code] || 'Default'
223
225
  end
224
226
 
227
+ def add_lodging(xml, options)
228
+ if lodging = options[:lodging]
229
+ xml.extendedParameters do
230
+ xml.ExtendedParameters do
231
+ xml.Key 'Lodging'
232
+ xml.Value('xsi:type' => 'Lodging') do
233
+ xml.LodgingAgreementNumber lodging[:agreement_number] if lodging[:agreement_number]
234
+ xml.LodgingCheckInDate lodging[:check_in_date] if lodging[:check_in_date]
235
+ xml.LodgingCheckOutDate lodging[:check_out_date] if lodging[:check_out_date]
236
+ xml.LodgingRoomAmount lodging[:room_amount] if lodging[:room_amount]
237
+ xml.LodgingRoomTax lodging[:room_tax] if lodging[:room_tax]
238
+ xml.LodgingNoShowIndicator lodging[:no_show_indicator] if lodging[:no_show_indicator]
239
+ xml.LodgingDuration lodging[:duration] if lodging[:duration]
240
+ xml.LodgingCustomerName lodging[:customer_name] if lodging[:customer_name]
241
+ xml.LodgingClientCode lodging[:client_code] if lodging[:client_code]
242
+ xml.LodgingExtraChargesDetail lodging[:extra_charges_detail] if lodging[:extra_charges_detail]
243
+ xml.LodgingExtraChargesAmounts lodging[:extra_charges_amounts] if lodging[:extra_charges_amounts]
244
+ xml.LodgingPrestigiousPropertyCode lodging[:prestigious_property_code] if lodging[:prestigious_property_code]
245
+ xml.LodgingSpecialProgramCode lodging[:special_program_code] if lodging[:special_program_code]
246
+ xml.LodgingChargeType lodging[:charge_type] if lodging[:charge_type]
247
+ end
248
+ end
249
+ end
250
+ end
251
+ end
252
+
225
253
  def add_terminal(xml, options)
226
254
  xml.terminal do
227
255
  xml.TerminalID options[:terminal_id] || '01'
256
+ xml.TerminalType options[:terminal_type] if options[:terminal_type]
228
257
  xml.CardPresentCode options[:card_present_code] || 'UseDefault'
229
- xml.CardholderPresentCode 'UseDefault'
230
- xml.CardInputCode 'UseDefault'
231
- xml.CVVPresenceCode 'UseDefault'
232
- xml.TerminalCapabilityCode 'UseDefault'
233
- xml.TerminalEnvironmentCode 'UseDefault'
258
+ xml.CardholderPresentCode options[:card_holder_present_code] || 'UseDefault'
259
+ xml.CardInputCode options[:card_input_code] || 'UseDefault'
260
+ xml.CVVPresenceCode options[:cvv_presence_code] || 'UseDefault'
261
+ xml.TerminalCapabilityCode options[:terminal_capability_code] || 'UseDefault'
262
+ xml.TerminalEnvironmentCode options[:terminal_environment_code] || 'UseDefault'
234
263
  xml.MotoECICode 'NonAuthenticatedSecureECommerceTransaction'
264
+ xml.PartialApprovedFlag options[:partial_approved_flag] if options[:partial_approved_flag]
235
265
  end
236
266
  end
237
267
 
@@ -240,7 +270,7 @@ module ActiveMerchant #:nodoc:
240
270
  xml.CardNumber payment.number
241
271
  xml.ExpirationMonth format(payment.month, :two_digits)
242
272
  xml.ExpirationYear format(payment.year, :two_digits)
243
- xml.CardholderName payment.first_name + ' ' + payment.last_name
273
+ xml.CardholderName "#{payment.first_name} #{payment.last_name}"
244
274
  xml.CVV payment.verification_value
245
275
  end
246
276
  end
@@ -363,7 +393,6 @@ module ActiveMerchant #:nodoc:
363
393
  xml['soap'].Envelope('xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
364
394
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
365
395
  'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/') do
366
-
367
396
  xml['soap'].Body do
368
397
  yield(xml)
369
398
  end
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class EpayGateway < Gateway
4
4
  self.live_url = 'https://ssl.ditonlinebetalingssystem.dk/'
5
5
 
@@ -174,17 +174,21 @@ module ActiveMerchant #:nodoc:
174
174
  response = send("do_#{action}", params)
175
175
 
176
176
  if action == :authorize
177
- Response.new response['accept'].to_i == 1,
177
+ Response.new(
178
+ response['accept'].to_i == 1,
178
179
  response['errortext'],
179
180
  response,
180
181
  test: test?,
181
182
  authorization: response['tid']
183
+ )
182
184
  else
183
- Response.new response['result'] == 'true',
185
+ Response.new(
186
+ response['result'] == 'true',
184
187
  messages(response['epay'], response['pbs']),
185
188
  response,
186
189
  test: test?,
187
190
  authorization: params[:transaction]
191
+ )
188
192
  end
189
193
  end
190
194
 
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  # === EVO Canada payment gateway.
4
4
  #
5
5
  # EVO returns two different identifiers for most transactions, the
@@ -279,11 +279,15 @@ module ActiveMerchant #:nodoc:
279
279
  response = parse(data)
280
280
  message = message_from(response)
281
281
 
282
- Response.new(success?(response), message, response,
282
+ Response.new(
283
+ success?(response),
284
+ message,
285
+ response,
283
286
  test: test?,
284
287
  authorization: response['transactionid'],
285
288
  avs_result: { code: response['avsresponse'] },
286
- cvv_result: response['cvvresponse'])
289
+ cvv_result: response['cvvresponse']
290
+ )
287
291
  end
288
292
 
289
293
  def message_from(response)
@@ -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
  # Public: For more information on the Eway Gateway please visit their
6
6
  # {Developers Area}[http://www.eway.com.au/developers/api/direct-payments]
7
7
  class EwayGateway < Gateway
@@ -111,11 +111,13 @@ module ActiveMerchant #:nodoc:
111
111
  raw_response = ssl_post(url, post_data(parameters))
112
112
  response = parse(raw_response)
113
113
 
114
- Response.new(success?(response),
114
+ Response.new(
115
+ success?(response),
115
116
  message_from(response[:ewaytrxnerror]),
116
117
  response,
117
118
  authorization: response[:ewaytrxnnumber],
118
- test: test?)
119
+ test: test?
120
+ )
119
121
  end
120
122
 
121
123
  def success?(response)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class EwayManagedGateway < Gateway
4
4
  self.test_url = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx'
5
5
  self.live_url = 'https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx'
@@ -222,9 +222,13 @@ module ActiveMerchant #:nodoc:
222
222
  end
223
223
  response = parse(raw)
224
224
 
225
- EwayResponse.new(response[:success], response[:message], response,
225
+ EwayResponse.new(
226
+ response[:success],
227
+ response[:message],
228
+ response,
226
229
  test: test?,
227
- authorization: response[:auth_code])
230
+ authorization: response[:auth_code]
231
+ )
228
232
  end
229
233
 
230
234
  # Where we build the full SOAP 1.2 request using builder
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class EwayRapidGateway < Gateway
6
6
  self.test_url = 'https://api.sandbox.ewaypayments.com/'
7
7
  self.live_url = 'https://api.ewaypayments.com/'
@@ -378,7 +378,7 @@ module ActiveMerchant #:nodoc:
378
378
  else
379
379
  'I'
380
380
  end
381
- { code: code }
381
+ { code: }
382
382
  end
383
383
 
384
384
  def cvv_result_from(response)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class ExactGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
5
5
 
@@ -158,11 +158,15 @@ module ActiveMerchant #:nodoc:
158
158
  def commit(action, request)
159
159
  response = parse(ssl_post(self.live_url, build_request(action, request), POST_HEADERS))
160
160
 
161
- Response.new(successful?(response), message_from(response), response,
161
+ Response.new(
162
+ successful?(response),
163
+ message_from(response),
164
+ response,
162
165
  test: test?,
163
166
  authorization: authorization_from(response),
164
167
  avs_result: { code: response[:avs] },
165
- cvv_result: response[:cvv2])
168
+ cvv_result: response[:cvv2]
169
+ )
166
170
  rescue ResponseError => e
167
171
  case e.response.code
168
172
  when '401'
@@ -1,10 +1,12 @@
1
1
  require 'json'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class FatZebraGateway < Gateway
6
- self.live_url = 'https://gateway.fatzebra.com.au/v1.0'
7
- self.test_url = 'https://gateway.sandbox.fatzebra.com.au/v1.0'
6
+ version 'v1.0'
7
+
8
+ self.live_url = "https://gateway.fatzebra.com.au/#{fetch_version}"
9
+ self.test_url = "https://gateway.sandbox.fatzebra.com.au/#{fetch_version}"
8
10
 
9
11
  self.supported_countries = ['AU']
10
12
  self.default_currency = 'AUD'
@@ -28,6 +30,7 @@ module ActiveMerchant #:nodoc:
28
30
  add_order_id(post, options)
29
31
  add_ip(post, options)
30
32
  add_metadata(post, options)
33
+ add_three_ds(post, options)
31
34
 
32
35
  commit(:post, 'purchases', post)
33
36
  end
@@ -41,6 +44,7 @@ module ActiveMerchant #:nodoc:
41
44
  add_order_id(post, options)
42
45
  add_ip(post, options)
43
46
  add_metadata(post, options)
47
+ add_three_ds(post, options)
44
48
 
45
49
  post[:capture] = false
46
50
 
@@ -125,16 +129,42 @@ module ActiveMerchant #:nodoc:
125
129
  def add_extra_options(post, options)
126
130
  extra = {}
127
131
  extra[:ecm] = '32' if options[:recurring]
128
- extra[:cavv] = options[:cavv] || options.dig(:three_d_secure, :cavv) if options[:cavv] || options.dig(:three_d_secure, :cavv)
129
- extra[:xid] = options[:xid] || options.dig(:three_d_secure, :xid) if options[:xid] || options.dig(:three_d_secure, :xid)
130
- extra[:sli] = options[:sli] || options.dig(:three_d_secure, :eci) if options[:sli] || options.dig(:three_d_secure, :eci)
131
132
  extra[:name] = options[:merchant] if options[:merchant]
132
133
  extra[:location] = options[:merchant_location] if options[:merchant_location]
133
134
  extra[:card_on_file] = options.dig(:extra, :card_on_file) if options.dig(:extra, :card_on_file)
134
135
  extra[:auth_reason] = options.dig(:extra, :auth_reason) if options.dig(:extra, :auth_reason)
136
+
137
+ unless options[:three_d_secure].present?
138
+ extra[:sli] = options[:sli] if options[:sli]
139
+ extra[:xid] = options[:xid] if options[:xid]
140
+ extra[:cavv] = options[:cavv] if options[:cavv]
141
+ end
142
+
135
143
  post[:extra] = extra if extra.any?
136
144
  end
137
145
 
146
+ def add_three_ds(post, options)
147
+ return unless three_d_secure = options[:three_d_secure]
148
+
149
+ post[:extra] = {
150
+ sli: three_d_secure[:eci],
151
+ xid: three_d_secure[:xid],
152
+ cavv: three_d_secure[:cavv],
153
+ par: three_d_secure[:authentication_response_status],
154
+ ver: formatted_enrollment(three_d_secure[:enrolled]),
155
+ threeds_version: three_d_secure[:version],
156
+ directory_server_txn_id: three_d_secure[:ds_transaction_id]
157
+ }.compact
158
+ end
159
+
160
+ def formatted_enrollment(val)
161
+ case val
162
+ when 'Y', 'N', 'U' then val
163
+ when true, 'true' then 'Y'
164
+ when false, 'false' then 'N'
165
+ end
166
+ end
167
+
138
168
  def add_order_id(post, options)
139
169
  post[:reference] = options[:order_id] || SecureRandom.hex(15)
140
170
  end
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class FederatedCanadaGateway < Gateway
4
4
  # Same URL for both test and live, testing is done by using the test username (demo) and password (password).
5
5
  self.live_url = self.test_url = 'https://secure.federatedgateway.com/api/transact.php'
@@ -121,11 +121,15 @@ module ActiveMerchant #:nodoc:
121
121
  response = parse(data)
122
122
  message = message_from(response)
123
123
 
124
- Response.new(success?(response), message, response,
124
+ Response.new(
125
+ success?(response),
126
+ message,
127
+ response,
125
128
  test: test?,
126
129
  authorization: response['transactionid'],
127
130
  avs_result: { code: response['avsresponse'] },
128
- cvv_result: response['cvvresponse'])
131
+ cvv_result: response['cvvresponse']
132
+ )
129
133
  end
130
134
 
131
135
  def success?(response)
@@ -1,7 +1,7 @@
1
1
  require 'active_merchant/billing/gateways/cc5'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class FinansbankGateway < CC5Gateway
6
6
  self.live_url = 'https://www.fbwebpos.com/servlet/cc5ApiServer'
7
7
  self.test_url = 'https://entegrasyon.asseco-see.com.tr/fim/api'
@@ -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
  class FirstGivingGateway < Gateway
6
6
  self.test_url = 'http://usapisandbox.fgdev.net'
7
7
  self.live_url = 'https://api.firstgiving.com'
@@ -0,0 +1,15 @@
1
+ module FirstPayCommon
2
+ def self.included(base)
3
+ base.supported_countries = ['US']
4
+ base.default_currency = 'USD'
5
+ base.money_format = :dollars
6
+ base.supported_cardtypes = %i[visa master american_express discover]
7
+
8
+ base.homepage_url = 'http://1stpaygateway.net/'
9
+ base.display_name = '1stPayGateway.Net'
10
+ end
11
+
12
+ def supports_scrubbing?
13
+ true
14
+ end
15
+ end
@@ -0,0 +1,190 @@
1
+ require 'active_merchant/billing/gateways/first_pay/first_pay_common'
2
+
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
+ class FirstPayJsonGateway < Gateway
6
+ include FirstPayCommon
7
+
8
+ ACTIONS = {
9
+ purchase: 'Sale',
10
+ authorize: 'Auth',
11
+ capture: 'Settle',
12
+ refund: 'Refund',
13
+ void: 'Void'
14
+ }.freeze
15
+
16
+ WALLET_TYPES = {
17
+ apple_pay: 'ApplePay',
18
+ google_pay: 'GooglePay'
19
+ }.freeze
20
+
21
+ self.test_url = 'https://secure-v.1stPaygateway.net/secure/RestGW/Gateway/Transaction/'
22
+ self.live_url = 'https://secure.1stPaygateway.net/secure/RestGW/Gateway/Transaction/'
23
+
24
+ # Creates a new FirstPayJsonGateway
25
+ #
26
+ # The gateway requires two values for connection to be passed
27
+ # in the +options+ hash.
28
+ #
29
+ # ==== Options
30
+ #
31
+ # * <tt>:merchant_key</tt> -- FirstPay's merchant_key (REQUIRED)
32
+ # * <tt>:processor_id</tt> -- FirstPay's processor_id or processorId (REQUIRED)
33
+ def initialize(options = {})
34
+ requires!(options, :merchant_key, :processor_id)
35
+ super
36
+ end
37
+
38
+ def purchase(money, payment, options = {})
39
+ post = {}
40
+ add_invoice(post, money, options)
41
+ add_payment(post, payment, options)
42
+ add_address(post, payment, options)
43
+
44
+ commit(:purchase, post)
45
+ end
46
+
47
+ def authorize(money, payment, options = {})
48
+ post = {}
49
+ add_invoice(post, money, options)
50
+ add_payment(post, payment, options)
51
+ add_address(post, payment, options)
52
+
53
+ commit(:authorize, post)
54
+ end
55
+
56
+ def capture(money, authorization, options = {})
57
+ post = {}
58
+ add_invoice(post, money, options)
59
+ add_reference(post, authorization)
60
+
61
+ commit(:capture, post)
62
+ end
63
+
64
+ def refund(money, authorization, options = {})
65
+ post = {}
66
+ add_invoice(post, money, options)
67
+ add_reference(post, authorization)
68
+
69
+ commit(:refund, post)
70
+ end
71
+
72
+ def void(authorization, options = {})
73
+ post = {}
74
+ add_reference(post, authorization)
75
+
76
+ commit(:void, post)
77
+ end
78
+
79
+ def scrub(transcript)
80
+ transcript.
81
+ gsub(%r(("processorId\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
82
+ gsub(%r(("merchantKey\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
83
+ gsub(%r(("cardNumber\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
84
+ gsub(%r(("paymentCryptogram\\?"\s*:\s*\\?")[^"]*)i, '\1[FILTERED]').
85
+ gsub(%r(("cvv\\?"\s*:\s*\\?)[^,]*)i, '\1[FILTERED]')
86
+ end
87
+
88
+ private
89
+
90
+ def add_address(post, creditcard, options)
91
+ if address = options[:billing_address] || options[:address]
92
+ post[:ownerName] = address[:name]
93
+ post[:ownerStreet] = address[:address1]
94
+ post[:ownerCity] = address[:city]
95
+ post[:ownerState] = address[:state]
96
+ post[:ownerZip] = address[:zip]
97
+ post[:ownerCountry] = address[:country]
98
+ end
99
+ end
100
+
101
+ def add_invoice(post, money, options)
102
+ post[:orderId] = options[:order_id]
103
+ post[:transactionAmount] = amount(money)
104
+ end
105
+
106
+ def add_payment(post, payment, options)
107
+ post[:cardNumber] = payment.number
108
+ post[:cardExpMonth] = payment.month
109
+ post[:cardExpYear] = format(payment.year, :two_digits)
110
+ post[:cvv] = payment.verification_value
111
+ post[:recurring] = options[:recurring] if options[:recurring]
112
+ post[:recurringStartDate] = options[:recurring_start_date] if options[:recurring_start_date]
113
+ post[:recurringEndDate] = options[:recurring_end_date] if options[:recurring_end_date]
114
+
115
+ case payment
116
+ when NetworkTokenizationCreditCard
117
+ post[:walletType] = WALLET_TYPES[payment.source]
118
+ other_fields = post[:otherFields] = {}
119
+ other_fields[:paymentCryptogram] = payment.payment_cryptogram
120
+ other_fields[:eciIndicator] = payment.eci || '07'
121
+ when CreditCard
122
+ post[:cvv] = payment.verification_value
123
+ end
124
+ end
125
+
126
+ def add_reference(post, authorization)
127
+ post[:refNumber] = authorization
128
+ end
129
+
130
+ def commit(action, parameters)
131
+ response = parse(api_request(base_url + ACTIONS[action], post_data(parameters)))
132
+
133
+ Response.new(
134
+ success_from(response),
135
+ message_from(response),
136
+ response,
137
+ authorization: authorization_from(response),
138
+ error_code: error_code_from(response),
139
+ test: test?
140
+ )
141
+ end
142
+
143
+ def base_url
144
+ test? ? self.test_url : self.live_url
145
+ end
146
+
147
+ def api_request(url, data)
148
+ ssl_post(url, data, headers)
149
+ rescue ResponseError => e
150
+ e.response.body
151
+ end
152
+
153
+ def parse(data)
154
+ JSON.parse data
155
+ end
156
+
157
+ def headers
158
+ { 'Content-Type' => 'application/json' }
159
+ end
160
+
161
+ def format_messages(messages)
162
+ return unless messages.present?
163
+
164
+ messages.map { |message| message['message'] || message }.join('; ')
165
+ end
166
+
167
+ def success_from(response)
168
+ response['isSuccess']
169
+ end
170
+
171
+ def message_from(response)
172
+ format_messages(response['errorMessages'] + response['validationFailures']) || response['data']['authResponse']
173
+ end
174
+
175
+ def error_code_from(response)
176
+ return 'isError' if response['isError']
177
+
178
+ return 'validationHasFailed' if response['validationHasFailed']
179
+ end
180
+
181
+ def authorization_from(response)
182
+ response.dig('data', 'referenceNumber') || ''
183
+ end
184
+
185
+ def post_data(params)
186
+ params.merge({ processorId: @options[:processor_id], merchantKey: @options[:merchant_key] }).to_json
187
+ end
188
+ end
189
+ end
190
+ end