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,9 @@
1
1
  require 'active_merchant/billing/gateways/orbital/orbital_soft_descriptors'
2
2
  require 'rexml/document'
3
+ require 'active_merchant/billing/gateways/orbital/orbital_codes'
3
4
 
4
- module ActiveMerchant #:nodoc:
5
- module Billing #:nodoc:
5
+ module ActiveMerchant # :nodoc:
6
+ module Billing # :nodoc:
6
7
  # For more information on Orbital, visit the {integration center}[http://download.chasepaymentech.com]
7
8
  #
8
9
  # ==== Authentication Options
@@ -28,13 +29,14 @@ module ActiveMerchant #:nodoc:
28
29
  # Company will automatically be affiliated.
29
30
 
30
31
  class OrbitalGateway < Gateway
32
+ include OrbitalCodes
31
33
  include Empty
32
34
 
33
- API_VERSION = '9.0'
35
+ version '9.5'
34
36
 
35
37
  POST_HEADERS = {
36
38
  'MIME-Version' => '1.1',
37
- 'Content-Type' => "application/PTI#{API_VERSION.delete('.')}",
39
+ 'Content-Type' => "application/PTI#{fetch_version.delete('.')}",
38
40
  'Content-transfer-encoding' => 'text',
39
41
  'Request-number' => '1',
40
42
  'Document-type' => 'Request',
@@ -84,50 +86,6 @@ module ActiveMerchant #:nodoc:
84
86
 
85
87
  AVS_SUPPORTED_COUNTRIES = %w[US CA UK GB]
86
88
 
87
- CURRENCY_CODES = {
88
- 'AUD' => '036',
89
- 'BRL' => '986',
90
- 'CAD' => '124',
91
- 'CLP' => '152',
92
- 'CZK' => '203',
93
- 'DKK' => '208',
94
- 'HKD' => '344',
95
- 'ICK' => '352',
96
- 'JPY' => '392',
97
- 'MXN' => '484',
98
- 'NZD' => '554',
99
- 'NOK' => '578',
100
- 'SGD' => '702',
101
- 'ZAR' => '710',
102
- 'SEK' => '752',
103
- 'CHF' => '756',
104
- 'GBP' => '826',
105
- 'USD' => '840',
106
- 'EUR' => '978'
107
- }
108
-
109
- CURRENCY_EXPONENTS = {
110
- 'AUD' => '2',
111
- 'BRL' => '2',
112
- 'CAD' => '2',
113
- 'CLP' => '2',
114
- 'CZK' => '2',
115
- 'DKK' => '2',
116
- 'HKD' => '2',
117
- 'ICK' => '2',
118
- 'JPY' => '0',
119
- 'MXN' => '2',
120
- 'NZD' => '2',
121
- 'NOK' => '2',
122
- 'SGD' => '2',
123
- 'ZAR' => '2',
124
- 'SEK' => '2',
125
- 'CHF' => '2',
126
- 'GBP' => '2',
127
- 'USD' => '2',
128
- 'EUR' => '2'
129
- }
130
-
131
89
  # INDUSTRY TYPES
132
90
  ECOMMERCE_TRANSACTION = 'EC'
133
91
  RECURRING_PAYMENT_TRANSACTION = 'RC'
@@ -193,6 +151,10 @@ module ActiveMerchant #:nodoc:
193
151
  'checking' => 'C'
194
152
  }
195
153
 
154
+ # safetech token flags
155
+ GET_TOKEN = 'GT'
156
+ USE_TOKEN = 'UT'
157
+
196
158
  def initialize(options = {})
197
159
  requires!(options, :merchant_id)
198
160
  requires!(options, :login, :password) unless options[:ip_authentication]
@@ -210,7 +172,7 @@ module ActiveMerchant #:nodoc:
210
172
 
211
173
  order = build_new_auth_purchase_order(AUTH_ONLY, money, payment_source, options)
212
174
 
213
- commit(order, :authorize, options[:retry_logic], options[:trace_number])
175
+ commit(order, :authorize, options)
214
176
  end
215
177
 
216
178
  def verify(credit_card, options = {})
@@ -226,23 +188,23 @@ module ActiveMerchant #:nodoc:
226
188
  action = options[:force_capture] ? FORCE_AUTH_AND_CAPTURE : AUTH_AND_CAPTURE
227
189
  order = build_new_auth_purchase_order(action, money, payment_source, options)
228
190
 
229
- commit(order, :purchase, options[:retry_logic], options[:trace_number])
191
+ commit(order, :purchase, options)
230
192
  end
231
193
 
232
194
  # MFC - Mark For Capture
233
195
  def capture(money, authorization, options = {})
234
- commit(build_mark_for_capture_xml(money, authorization, options), :capture, options[:retry_logic], options[:trace_number])
196
+ commit(build_mark_for_capture_xml(money, authorization, options), :capture, options)
235
197
  end
236
198
 
237
199
  # R – Refund request
238
200
  def refund(money, authorization, options = {})
239
201
  payment_method = options[:payment_method]
240
- order = build_new_order_xml(REFUND, money, payment_method, options.merge(authorization: authorization)) do |xml|
202
+ order = build_new_order_xml(REFUND, money, payment_method, options.merge(authorization:)) do |xml|
241
203
  add_payment_source(xml, payment_method, options)
242
204
  xml.tag! :CustomerRefNum, options[:customer_ref_num] if @options[:customer_profiles] && options[:profile_txn]
243
205
  end
244
206
 
245
- commit(order, :refund, options[:retry_logic], options[:trace_number])
207
+ commit(order, :refund, options)
246
208
  end
247
209
 
248
210
  def credit(money, payment_method, options = {})
@@ -250,7 +212,14 @@ module ActiveMerchant #:nodoc:
250
212
  add_payment_source(xml, payment_method, options)
251
213
  end
252
214
 
253
- commit(order, :refund, options[:retry_logic], options[:trace_number])
215
+ commit(order, :refund, options)
216
+ end
217
+
218
+ # Orbital save a payment method if the TokenTxnType is 'GT', that's why we use this as the default value for store
219
+ def store(creditcard, options = {})
220
+ options[:exp_date] = expiry_date(creditcard) if creditcard.is_a?(CreditCard)
221
+
222
+ authorize(0, creditcard, options.merge({ token_txn_type: GET_TOKEN }))
254
223
  end
255
224
 
256
225
  def void(authorization, options = {}, deprecated = {})
@@ -261,7 +230,7 @@ module ActiveMerchant #:nodoc:
261
230
 
262
231
  order = build_void_request_xml(authorization, options)
263
232
 
264
- commit(order, :void, options[:retry_logic], options[:trace_number])
233
+ commit(order, :void, options)
265
234
  end
266
235
 
267
236
  def default_verify_amount(credit_card)
@@ -307,13 +276,13 @@ module ActiveMerchant #:nodoc:
307
276
  end
308
277
 
309
278
  def retrieve_customer_profile(customer_ref_num)
310
- options = { customer_profile_action: RETRIEVE, customer_ref_num: customer_ref_num }
279
+ options = { customer_profile_action: RETRIEVE, customer_ref_num: }
311
280
  order = build_customer_request_xml(nil, options)
312
281
  commit(order, :retrieve_customer_profile)
313
282
  end
314
283
 
315
284
  def delete_customer_profile(customer_ref_num)
316
- options = { customer_profile_action: DELETE, customer_ref_num: customer_ref_num }
285
+ options = { customer_profile_action: DELETE, customer_ref_num: }
317
286
  order = build_customer_request_xml(nil, options)
318
287
  commit(order, :delete_customer_profile)
319
288
  end
@@ -380,8 +349,10 @@ module ActiveMerchant #:nodoc:
380
349
  xml.tag! :TxRefNum, split_authorization(authorization).first
381
350
  end
382
351
 
383
- def authorization_string(*args)
384
- args.compact.join(';')
352
+ def authorization_string(options, response)
353
+ authorization = [response[:tx_ref_num], response[:order_id], response[:safetech_token], response[:card_brand]]
354
+ authorization << options[:exp_date] if options[:exp_date] && options[:token_txn_type] == GET_TOKEN
355
+ authorization.compact.join(';')
385
356
  end
386
357
 
387
358
  def split_authorization(authorization)
@@ -487,6 +458,35 @@ module ActiveMerchant #:nodoc:
487
458
  end
488
459
  end
489
460
 
461
+ def add_level2_card_and_more_tax(xml, options = {})
462
+ if (level2 = options[:level_2_data])
463
+ xml.tag! :PCardRequestorName, byte_limit(level2[:requestor_name], 38) if level2[:requestor_name]
464
+ xml.tag! :PCardLocalTaxRate, byte_limit(level2[:local_tax_rate], 5) if level2[:local_tax_rate]
465
+ # Canadian Merchants Only
466
+ xml.tag! :PCardNationalTax, byte_limit(level2[:national_tax], 12) if level2[:national_tax]
467
+ xml.tag! :PCardPstTaxRegNumber, byte_limit(level2[:pst_tax_reg_number], 15) if level2[:pst_tax_reg_number]
468
+ xml.tag! :PCardCustomerVatRegNumber, byte_limit(level2[:customer_vat_reg_number], 13) if level2[:customer_vat_reg_number]
469
+ # Canadian Merchants Only
470
+ xml.tag! :PCardMerchantVatRegNumber, byte_limit(level2[:merchant_vat_reg_number], 20) if level2[:merchant_vat_reg_number]
471
+ xml.tag! :PCardTotalTaxAmount, byte_limit(level2[:total_tax_amount], 12) if level2[:total_tax_amount]
472
+ end
473
+ end
474
+
475
+ def add_card_commodity_code(xml, options = {})
476
+ if (level2 = options[:level_2_data]) && (level2[:commodity_code])
477
+ xml.tag! :PCardCommodityCode, byte_limit(level2[:commodity_code], 4)
478
+ end
479
+ end
480
+
481
+ def add_level3_vat_fields(xml, options = {})
482
+ if (level3 = options[:level_3_data])
483
+ xml.tag! :PC3InvoiceDiscTreatment, byte_limit(level3[:invoice_discount_treatment], 1) if level3[:invoice_discount_treatment]
484
+ xml.tag! :PC3TaxTreatment, byte_limit(level3[:tax_treatment], 1) if level3[:tax_treatment]
485
+ xml.tag! :PC3UniqueVATInvoiceRefNum, byte_limit(level3[:unique_vat_invoice_ref], 15) if level3[:unique_vat_invoice_ref]
486
+ xml.tag! :PC3ShipVATRate, byte_limit(level3[:ship_vat_rate], 4) if level3[:ship_vat_rate]
487
+ end
488
+ end
489
+
490
490
  #=====ADDRESS FIELDS=====
491
491
 
492
492
  def add_address(xml, payment_source, options)
@@ -536,11 +536,13 @@ module ActiveMerchant #:nodoc:
536
536
  end
537
537
 
538
538
  def billing_name(payment_source, options)
539
- if payment_source&.name.present?
540
- payment_source.name[0..29]
541
- elsif options[:billing_address][:name].present?
542
- options[:billing_address][:name][0..29]
543
- end
539
+ name =
540
+ if !payment_source.is_a?(String) && payment_source&.name.present?
541
+ payment_source.name
542
+ elsif options[:billing_address] && options[:billing_address][:name].present?
543
+ options[:billing_address][:name]
544
+ end
545
+ name ? format_name(name)[0..29] : nil
544
546
  end
545
547
 
546
548
  def avs_supported?(address)
@@ -555,10 +557,18 @@ module ActiveMerchant #:nodoc:
555
557
  options[:billing_address] || options[:address]
556
558
  end
557
559
 
560
+ def add_safetech_token_data(xml, payment_source, options)
561
+ _, _, payment_source_token, card_brand, exp_date = split_authorization(payment_source)
562
+ xml.tag! :CardBrand, card_brand
563
+ xml.tag! :AccountNum, payment_source_token
564
+ xml.tag! :Exp, exp_date if exp_date && options[:pass_exp_date]&.to_s == 'true'
565
+ end
566
+
558
567
  #=====PAYMENT SOURCE FIELDS=====
559
568
 
560
569
  # Payment can be done through either Credit Card or Electronic Check
561
570
  def add_payment_source(xml, payment_source, options = {})
571
+ add_safetech_token_data(xml, payment_source, options) if payment_source.is_a?(String)
562
572
  payment_source.is_a?(Check) ? add_echeck(xml, payment_source, options) : add_credit_card(xml, payment_source, options)
563
573
  end
564
574
 
@@ -572,14 +582,14 @@ module ActiveMerchant #:nodoc:
572
582
  add_bank_account_type(xml, check)
573
583
  xml.tag! :ECPAuthMethod, options[:auth_method] if options[:auth_method]
574
584
  xml.tag! :BankPmtDelv, options[:payment_delivery] || 'B'
575
- xml.tag! :AVSname, (check&.name ? check.name[0..29] : nil) if get_address(options).blank?
585
+ xml.tag! :AVSname, (check&.name ? format_name(check.name)[0..29] : nil) if get_address(options).blank?
576
586
  end
577
587
 
578
588
  def add_credit_card(xml, credit_card, options)
579
- xml.tag! :AccountNum, credit_card.number if credit_card
580
- xml.tag! :Exp, expiry_date(credit_card) if credit_card
589
+ xml.tag! :AccountNum, credit_card.number if credit_card.is_a?(CreditCard)
590
+ xml.tag! :Exp, options[:override_exp_date] || expiry_date(credit_card) if credit_card.is_a?(CreditCard)
581
591
  add_currency_fields(xml, options[:currency])
582
- add_verification_value(xml, credit_card) if credit_card
592
+ add_verification_value(xml, credit_card) if credit_card.is_a?(CreditCard)
583
593
  end
584
594
 
585
595
  def add_verification_value(xml, credit_card)
@@ -664,10 +674,14 @@ module ActiveMerchant #:nodoc:
664
674
  xml.tag!(:XID, three_d_secure[:xid]) if three_d_secure[:xid]
665
675
  end
666
676
 
677
+ PYMT_PROGRAM_CODE_BY_BRAND = {
678
+ 'american_express' => 'ASK',
679
+ 'discover' => 'DPB'
680
+ }.freeze
667
681
  def add_pymt_brand_program_code(xml, credit_card, three_d_secure)
668
- return unless three_d_secure && credit_card.brand == 'american_express'
682
+ return unless three_d_secure && (code = PYMT_PROGRAM_CODE_BY_BRAND[credit_card.brand])
669
683
 
670
- xml.tag!(:PymtBrandProgramCode, 'ASK')
684
+ xml.tag!(:PymtBrandProgramCode, code)
671
685
  end
672
686
 
673
687
  def mastercard?(payment_source)
@@ -679,7 +693,7 @@ module ActiveMerchant #:nodoc:
679
693
  add_mc_sca_recurring(xml, credit_card, parameters, three_d_secure)
680
694
  add_mc_program_protocol(xml, credit_card, three_d_secure)
681
695
  add_mc_directory_trans_id(xml, credit_card, three_d_secure)
682
- add_mc_ucafind(xml, credit_card, three_d_secure)
696
+ add_mc_ucafind(xml, credit_card, three_d_secure, parameters)
683
697
  end
684
698
 
685
699
  def add_mc_sca_merchant_initiated(xml, credit_card, parameters, three_d_secure)
@@ -708,16 +722,16 @@ module ActiveMerchant #:nodoc:
708
722
  xml.tag!(:MCDirectoryTransID, three_d_secure[:ds_transaction_id]) if three_d_secure[:ds_transaction_id]
709
723
  end
710
724
 
711
- def add_mc_ucafind(xml, credit_card, three_d_secure)
712
- return unless three_d_secure
725
+ def add_mc_ucafind(xml, credit_card, three_d_secure, options)
726
+ return unless three_d_secure && %w(4 6 7).include?(three_d_secure&.dig(:eci))
713
727
 
714
- xml.tag! :UCAFInd, '4'
728
+ xml.tag! :UCAFInd, options[:ucaf_collection_indicator] if options[:ucaf_collection_indicator]
715
729
  end
716
730
 
717
731
  #=====SCA (STORED CREDENTIAL) FIELDS=====
718
732
 
719
733
  def add_stored_credentials(xml, parameters)
720
- return unless parameters[:mit_stored_credential_ind] == 'Y' || parameters[:stored_credential] && !parameters[:stored_credential].values.all?(&:nil?)
734
+ return unless parameters[:mit_stored_credential_ind] == 'Y' || (parameters[:stored_credential] && !parameters[:stored_credential].values.all?(&:nil?))
721
735
 
722
736
  if msg_type = get_msg_type(parameters)
723
737
  xml.tag! :MITMsgType, msg_type
@@ -769,7 +783,7 @@ module ActiveMerchant #:nodoc:
769
783
  end
770
784
 
771
785
  def add_digital_token_cryptogram(xml, credit_card, three_d_secure)
772
- return unless credit_card.is_a?(NetworkTokenizationCreditCard) || three_d_secure && credit_card.brand == 'discover'
786
+ return unless credit_card.is_a?(NetworkTokenizationCreditCard) || (three_d_secure && credit_card.brand == 'discover')
773
787
 
774
788
  cryptogram =
775
789
  if three_d_secure && credit_card.brand == 'discover'
@@ -868,10 +882,10 @@ module ActiveMerchant #:nodoc:
868
882
 
869
883
  #=====REQUEST/RESPONSE METHODS=====
870
884
 
871
- def commit(order, message_type, retry_logic = nil, trace_number = nil)
885
+ def commit(order, message_type, options = {})
872
886
  headers = POST_HEADERS.merge('Content-length' => order.size.to_s)
873
- if (@options[:retry_logic] || retry_logic) && trace_number
874
- headers['Trace-number'] = trace_number.to_s
887
+ if (@options[:retry_logic] || options[:retry_logic]) && options[:trace_number]
888
+ headers['Trace-number'] = options[:trace_number].to_s
875
889
  headers['Merchant-Id'] = @options[:merchant_id]
876
890
  end
877
891
  request = ->(url) { parse(ssl_post(url, order, headers)) }
@@ -886,13 +900,17 @@ module ActiveMerchant #:nodoc:
886
900
  request.call(remote_url(:secondary))
887
901
  end
888
902
 
889
- Response.new(success?(response, message_type), message_from(response), response,
903
+ Response.new(
904
+ success?(response, message_type),
905
+ message_from(response),
906
+ response,
890
907
  {
891
- authorization: authorization_string(response[:tx_ref_num], response[:order_id]),
908
+ authorization: authorization_string(options, response),
892
909
  test: self.test?,
893
910
  avs_result: OrbitalGateway::AVSResult.new(response[:avs_resp_code]),
894
911
  cvv_result: OrbitalGateway::CVVResult.new(response[:cvv2_resp_code])
895
- })
912
+ }
913
+ )
896
914
  end
897
915
 
898
916
  def remote_url(url = :primary)
@@ -981,35 +999,34 @@ module ActiveMerchant #:nodoc:
981
999
  xml.tag! :OrderID, format_order_id(parameters[:order_id])
982
1000
  xml.tag! :Amount, amount(money)
983
1001
  xml.tag! :Comments, parameters[:comments] if parameters[:comments]
984
-
985
1002
  add_level2_tax(xml, parameters)
986
1003
  add_level2_advice_addendum(xml, parameters)
987
-
988
1004
  add_aav(xml, payment_source, three_d_secure)
989
1005
  # CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
990
-
991
1006
  add_soft_descriptors(xml, parameters[:soft_descriptors])
992
- add_payment_action_ind(xml, parameters[:payment_action_ind])
993
- add_dpanind(xml, payment_source, parameters[:industry_type])
994
- add_aevv(xml, payment_source, three_d_secure)
995
- add_digital_token_cryptogram(xml, payment_source, three_d_secure)
996
-
997
- xml.tag! :ECPSameDayInd, parameters[:same_day] if parameters[:same_day] && payment_source.is_a?(Check)
998
-
999
1007
  set_recurring_ind(xml, parameters)
1000
1008
 
1001
1009
  # Append Transaction Reference Number at the end for Refund transactions
1002
1010
  add_tx_ref_num(xml, parameters[:authorization]) if action == REFUND && payment_source.nil?
1003
-
1004
1011
  add_level2_purchase(xml, parameters)
1005
1012
  add_level3_purchase(xml, parameters)
1006
1013
  add_level3_tax(xml, parameters)
1007
1014
  add_line_items(xml, parameters) if parameters[:line_items]
1008
- add_ecp_details(xml, payment_source, parameters) if payment_source.is_a?(Check)
1009
1015
  add_card_indicators(xml, parameters)
1016
+ add_payment_action_ind(xml, parameters[:payment_action_ind])
1017
+ add_dpanind(xml, payment_source, parameters[:industry_type])
1018
+ add_aevv(xml, payment_source, three_d_secure)
1019
+ add_level2_card_and_more_tax(xml, parameters)
1020
+ add_digital_token_cryptogram(xml, payment_source, three_d_secure)
1021
+ xml.tag! :ECPSameDayInd, parameters[:same_day] if parameters[:same_day] && payment_source.is_a?(Check)
1022
+ add_ecp_details(xml, payment_source, parameters) if payment_source.is_a?(Check)
1023
+
1010
1024
  add_stored_credentials(xml, parameters)
1011
1025
  add_pymt_brand_program_code(xml, payment_source, three_d_secure)
1026
+ xml.tag! :TokenTxnType, parameters[:token_txn_type] if parameters[:token_txn_type]
1012
1027
  add_mastercard_fields(xml, payment_source, parameters, three_d_secure) if mastercard?(payment_source)
1028
+ add_card_commodity_code(xml, parameters)
1029
+ add_level3_vat_fields(xml, parameters)
1013
1030
  end
1014
1031
  end
1015
1032
  xml.target!
@@ -1031,6 +1048,9 @@ module ActiveMerchant #:nodoc:
1031
1048
  add_level3_purchase(xml, parameters)
1032
1049
  add_level3_tax(xml, parameters)
1033
1050
  add_line_items(xml, parameters) if parameters[:line_items]
1051
+ add_level2_card_and_more_tax(xml, parameters)
1052
+ add_card_commodity_code(xml, parameters)
1053
+ add_level3_vat_fields(xml, parameters)
1034
1054
  end
1035
1055
  end
1036
1056
  xml.target!
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PacNetRavenGateway < Gateway
4
4
  AVS_ADDRESS_CODES = {
5
5
  'avs_address_unavailable' => 'X',
@@ -121,7 +121,10 @@ module ActiveMerchant #:nodoc:
121
121
 
122
122
  test_mode = test? || message =~ /TESTMODE/
123
123
 
124
- Response.new(success?(response), message, response,
124
+ Response.new(
125
+ success?(response),
126
+ message,
127
+ response,
125
128
  test: test_mode,
126
129
  authorization: response['TrackingNumber'],
127
130
  fraud_review: fraud_review?(response),
@@ -129,7 +132,8 @@ module ActiveMerchant #:nodoc:
129
132
  postal_match: AVS_POSTAL_CODES[response['AVSPostalResponseCode']],
130
133
  street_match: AVS_ADDRESS_CODES[response['AVSAddressResponseCode']]
131
134
  },
132
- cvv_result: CVV2_CODES[response['CVV2ResponseCode']])
135
+ cvv_result: CVV2_CODES[response['CVV2ResponseCode']]
136
+ )
133
137
  end
134
138
 
135
139
  def url(action)
@@ -178,8 +182,7 @@ module ActiveMerchant #:nodoc:
178
182
  post['RequestID'] = request_id
179
183
  post['Signature'] = signature(action, post, parameters)
180
184
 
181
- request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
182
- request
185
+ post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
183
186
  end
184
187
 
185
188
  def timestamp
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PagarmeGateway < Gateway
4
4
  self.live_url = 'https://api.pagar.me/1/'
5
5
 
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PagoFacilGateway < Gateway
4
4
  self.test_url = 'https://www.pagofacil.net/st/public/Wsrtransaccion/index/format/json?'
5
5
  self.live_url = 'https://www.pagofacil.net/ws/public/Wsrtransaccion/index/format/json?'
@@ -1,8 +1,10 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PayArcGateway < Gateway
4
- self.test_url = 'https://testapi.payarc.net/v1'
5
- self.live_url = 'https://api.payarc.net/v1'
4
+ version 'v1'
5
+
6
+ self.test_url = "https://testapi.payarc.net/#{fetch_version}"
7
+ self.live_url = "https://api.payarc.net/#{fetch_version}"
6
8
 
7
9
  self.supported_countries = ['US']
8
10
  self.default_currency = 'usd'
@@ -242,7 +244,7 @@ module ActiveMerchant #:nodoc:
242
244
  token(creditcard, options)
243
245
  end
244
246
 
245
- #:nodoc:
247
+ # :nodoc:
246
248
  def token(creditcard, options = {})
247
249
  post = {}
248
250
  post['authorize_card'] = 1
@@ -253,12 +255,12 @@ module ActiveMerchant #:nodoc:
253
255
  commit(STANDARD_ACTIONS[:token][:end_point], post)
254
256
  end
255
257
 
256
- def supports_scrubbing? #:nodoc:
258
+ def supports_scrubbing? # :nodoc:
257
259
  true
258
260
  end
259
261
 
260
262
  def scrub(transcript)
261
- #:nodoc:
263
+ # :nodoc:
262
264
  transcript.
263
265
  gsub(%r((Authorization: Bearer )[^\s]+\s)i, '\1[FILTERED]\2').
264
266
  gsub(%r((&?card_number=)[^&]*)i, '\1[FILTERED]').
@@ -1,10 +1,12 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PayConexGateway < Gateway
4
4
  include Empty
5
5
 
6
- self.test_url = 'https://cert.payconex.net/api/qsapi/3.8/'
7
- self.live_url = 'https://secure.payconex.net/api/qsapi/3.8/'
6
+ version '3.8'
7
+
8
+ self.test_url = "https://cert.payconex.net/api/qsapi/#{fetch_version}/"
9
+ self.live_url = "https://secure.payconex.net/api/qsapi/#{fetch_version}/"
8
10
 
9
11
  self.supported_countries = %w(US CA)
10
12
  self.default_currency = 'USD'
@@ -1,7 +1,7 @@
1
1
  require 'digest/md5'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  # This gateway accepts the following arguments:
6
6
  # :login => your PayJunction username
7
7
  # :password => your PayJunction pass
@@ -264,9 +264,13 @@ module ActiveMerchant #:nodoc:
264
264
 
265
265
  def commit(action, request, authorization = nil)
266
266
  response = parse(action, ssl_post(self.live_url, request))
267
- Response.new(successful?(response), message_from(response), response,
267
+ Response.new(
268
+ successful?(response),
269
+ message_from(response),
270
+ response,
268
271
  test: test?,
269
- authorization: authorization || response[:tid])
272
+ authorization: authorization || response[:tid]
273
+ )
270
274
  end
271
275
 
272
276
  def message_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 PayHubGateway < Gateway
4
4
  self.live_url = 'https://checkout.payhub.com/transaction/api'
5
5
 
@@ -182,14 +182,16 @@ module ActiveMerchant #:nodoc:
182
182
  response = json_error(raw_response)
183
183
  end
184
184
 
185
- Response.new(success,
185
+ Response.new(
186
+ success,
186
187
  response_message(response),
187
188
  response,
188
189
  test: test?,
189
190
  avs_result: { code: response['AVS_RESULT_CODE'] },
190
191
  cvv_result: response['VERIFICATION_RESULT_CODE'],
191
192
  error_code: (success ? nil : STANDARD_ERROR_CODE_MAPPING[response['RESPONSE_CODE']]),
192
- authorization: response['TRANSACTION_ID'])
193
+ authorization: response['TRANSACTION_ID']
194
+ )
193
195
  end
194
196
 
195
197
  def response_error(raw_response)
@@ -201,7 +203,7 @@ module ActiveMerchant #:nodoc:
201
203
  def json_error(raw_response)
202
204
  {
203
205
  error_message: 'Invalid response received from the Payhub API. Please contact wecare@payhub.com if you continue to receive this message.' \
204
- " (The raw response returned by the API was #{raw_response.inspect})"
206
+ " (The raw response returned by the API was #{raw_response.inspect})"
205
207
  }
206
208
  end
207
209
 
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  # PayJunction Gateway
4
4
  #
5
5
  # This gateway accepts the following arguments:
@@ -337,9 +337,13 @@ module ActiveMerchant #:nodoc:
337
337
 
338
338
  response = parse(ssl_post(url, post_data(action, parameters)))
339
339
 
340
- Response.new(successful?(response), message_from(response), response,
340
+ Response.new(
341
+ successful?(response),
342
+ message_from(response),
343
+ response,
341
344
  test: test?,
342
- authorization: response[:transaction_id] || parameters[:transaction_id])
345
+ authorization: response[:transaction_id] || parameters[:transaction_id]
346
+ )
343
347
  end
344
348
 
345
349
  def successful?(response)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PayJunctionV2Gateway < Gateway
4
4
  self.display_name = 'PayJunction'
5
5
  self.homepage_url = 'https://www.payjunction.com/'
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PaySecureGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://clearance.commsecure.com.au/cgi-bin/PSDirect'
5
5
 
@@ -68,9 +68,13 @@ module ActiveMerchant #:nodoc:
68
68
  def commit(action, money, parameters)
69
69
  response = parse(ssl_post(self.live_url, post_data(action, parameters)))
70
70
 
71
- Response.new(successful?(response), message_from(response), response,
71
+ Response.new(
72
+ successful?(response),
73
+ message_from(response),
74
+ response,
72
75
  test: test_response?(response),
73
- authorization: authorization_from(response))
76
+ authorization: authorization_from(response)
77
+ )
74
78
  end
75
79
 
76
80
  def successful?(response)