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,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  # This module is included in both PaypalGateway and PaypalExpressGateway
4
4
  module PaypalCommonAPI
5
5
  include Empty
@@ -7,13 +7,6 @@ module ActiveMerchant #:nodoc:
7
7
  API_VERSION = '124'
8
8
  API_VERSION_3DS2 = '214.0'
9
9
 
10
- URLS = {
11
- :test => { :certificate => 'https://api.sandbox.paypal.com/2.0/',
12
- :signature => 'https://api-3t.sandbox.paypal.com/2.0/' },
13
- :live => { :certificate => 'https://api.paypal.com/2.0/',
14
- :signature => 'https://api-3t.paypal.com/2.0/' }
15
- }
16
-
17
10
  PAYPAL_NAMESPACE = 'urn:ebay:api:PayPalAPI'
18
11
  EBAY_NAMESPACE = 'urn:ebay:apis:eBLBaseComponents'
19
12
 
@@ -59,8 +52,6 @@ module ActiveMerchant #:nodoc:
59
52
  base.default_currency = 'USD'
60
53
  base.cattr_accessor :pem_file
61
54
  base.cattr_accessor :signature
62
- base.live_url = URLS[:live][:signature]
63
- base.test_url = URLS[:test][:signature]
64
55
  end
65
56
 
66
57
  # The gateway must be configured with either your PayPal PEM file
@@ -96,6 +87,15 @@ module ActiveMerchant #:nodoc:
96
87
  super(options)
97
88
  end
98
89
 
90
+ def urls
91
+ {
92
+ :test => { :certificate => "https://api.sandbox.paypal.com/#{fetch_version}/",
93
+ :signature => "https://api-3t.sandbox.paypal.com/#{fetch_version}/" },
94
+ :live => { :certificate => "https://api.paypal.com/#{fetch_version}/",
95
+ :signature => "https://api-3t.paypal.com/#{fetch_version}/" }
96
+ }
97
+ end
98
+
99
99
  def reauthorize(money, authorization, options = {})
100
100
  commit 'DoReauthorization', build_reauthorize_request(money, authorization, options)
101
101
  end
@@ -179,6 +179,11 @@ module ActiveMerchant #:nodoc:
179
179
  # . (period)
180
180
  # {space}
181
181
  #
182
+
183
+ def inquire(authorization, options = {})
184
+ transaction_details(authorization)
185
+ end
186
+
182
187
  def reference_transaction(money, options = {})
183
188
  requires!(options, :reference_id)
184
189
  commit 'DoReferenceTransaction', build_reference_transaction_request(money, options)
@@ -656,7 +661,7 @@ module ActiveMerchant #:nodoc:
656
661
  end
657
662
 
658
663
  def endpoint_url
659
- URLS[test? ? :test : :live][@options[:signature].blank? ? :certificate : :signature]
664
+ urls[test? ? :test : :live][@options[:signature].blank? ? :certificate : :signature]
660
665
  end
661
666
 
662
667
  def commit(action, request)
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PaypalExpressResponse < Response
4
4
  def email
5
5
  info['Payer']
@@ -1,7 +1,7 @@
1
1
  require 'active_merchant/billing/gateways/paypal/paypal_common_api'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  # This module is included in both PaypalGateway and PaypalExpressGateway
6
6
  module PaypalRecurringApi
7
7
  PAYPAL_NAMESPACE = ActiveMerchant::Billing::PaypalCommonAPI::PAYPAL_NAMESPACE
@@ -2,9 +2,11 @@ require 'active_merchant/billing/gateways/paypal/paypal_common_api'
2
2
  require 'active_merchant/billing/gateways/paypal/paypal_recurring_api'
3
3
  require 'active_merchant/billing/gateways/paypal_express'
4
4
 
5
- module ActiveMerchant #:nodoc:
6
- module Billing #:nodoc:
5
+ module ActiveMerchant # :nodoc:
6
+ module Billing # :nodoc:
7
7
  class PaypalGateway < Gateway
8
+ version '2.0'
9
+
8
10
  include PaypalCommonAPI
9
11
  include PaypalRecurringApi
10
12
 
@@ -1,7 +1,7 @@
1
1
  require 'active_merchant/billing/gateways/paypal'
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  # The PayPal gateway for PayPal Website Payments Pro Canada only supports Visa and MasterCard
6
6
  class PaypalCaGateway < PaypalGateway
7
7
  self.supported_cardtypes = %i[visa master]
@@ -2,8 +2,8 @@ require 'active_merchant/billing/gateways/paypal/paypal_common_api'
2
2
  require 'active_merchant/billing/gateways/paypal/paypal_express_response'
3
3
  require 'active_merchant/billing/gateways/paypal_express_common'
4
4
 
5
- module ActiveMerchant #:nodoc:
6
- module Billing #:nodoc:
5
+ module ActiveMerchant # :nodoc:
6
+ module Billing # :nodoc:
7
7
  class PaypalDigitalGoodsGateway < PaypalExpressGateway
8
8
  self.test_redirect_url = 'https://www.sandbox.paypal.com/incontext'
9
9
  self.live_redirect_url = 'https://www.paypal.com/incontext'
@@ -3,9 +3,11 @@ require 'active_merchant/billing/gateways/paypal/paypal_express_response'
3
3
  require 'active_merchant/billing/gateways/paypal/paypal_recurring_api'
4
4
  require 'active_merchant/billing/gateways/paypal_express_common'
5
5
 
6
- module ActiveMerchant #:nodoc:
7
- module Billing #:nodoc:
6
+ module ActiveMerchant # :nodoc:
7
+ module Billing # :nodoc:
8
8
  class PaypalExpressGateway < Gateway
9
+ version '2.0'
10
+
9
11
  include PaypalCommonAPI
10
12
  include PaypalExpressCommon
11
13
  include PaypalRecurringApi
@@ -1,6 +1,8 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PaysafeGateway < Gateway
4
+ version 'v1'
5
+
4
6
  self.test_url = 'https://api.test.paysafe.com'
5
7
  self.live_url = 'https://api.paysafe.com'
6
8
 
@@ -58,6 +60,9 @@ module ActiveMerchant #:nodoc:
58
60
  post = {}
59
61
  add_invoice(post, money, options)
60
62
  add_payment(post, payment)
63
+ add_customer_data(post, payment, options) unless payment.is_a?(String)
64
+ add_merchant_details(post, options)
65
+ add_billing_address(post, options)
61
66
 
62
67
  commit(:post, 'standalonecredits', post, options)
63
68
  end
@@ -74,12 +79,28 @@ module ActiveMerchant #:nodoc:
74
79
 
75
80
  def store(payment, options = {})
76
81
  post = {}
77
- add_payment(post, payment)
78
- add_address_for_vaulting(post, options)
79
- add_profile_data(post, payment, options)
80
- add_store_data(post, payment, options)
81
82
 
82
- commit(:post, 'profiles', post, options)
83
+ if options[:profile_id]
84
+ post[:cardNum] = payment.number
85
+ post[:cardExpiry] = {
86
+ month: payment.month,
87
+ year: payment.year
88
+ }
89
+ post[:accountId] = options[:account_id] if options[:account_id]
90
+ post[:nickName] = options[:nickname] if options[:nickname]
91
+ post[:holderName] = payment.name
92
+ post[:billingAddressId] = options[:billing_address_id] if options[:billing_address_id]
93
+ post[:defaultCardIndicator] = normalize(options[:default_card_indicator]) if options[:default_card_indicator]
94
+ else
95
+ add_payment(post, payment)
96
+ add_address_for_vaulting(post, options)
97
+ add_profile_data(post, payment, options)
98
+ add_store_data(post, payment, options)
99
+ end
100
+
101
+ endpoint = options[:profile_id] ? "profiles/#{options[:profile_id]}/cards" : 'profiles'
102
+
103
+ commit(:post, endpoint, post, options)
83
104
  end
84
105
 
85
106
  def unstore(pm_profile_id)
@@ -117,6 +138,7 @@ module ActiveMerchant #:nodoc:
117
138
  post[:profile][:firstName] = creditcard.first_name
118
139
  post[:profile][:lastName] = creditcard.last_name
119
140
  post[:profile][:email] = options[:email] if options[:email]
141
+ post[:profile][:merchantCustomerId] = options[:customer_id] if options[:customer_id]
120
142
  post[:customerIp] = options[:ip] if options[:ip]
121
143
  end
122
144
 
@@ -124,12 +146,13 @@ module ActiveMerchant #:nodoc:
124
146
  return unless address = options[:billing_address] || options[:address]
125
147
 
126
148
  post[:billingDetails] = {}
127
- post[:billingDetails][:street] = address[:address1]
128
- post[:billingDetails][:city] = address[:city]
129
- post[:billingDetails][:state] = address[:state]
149
+ post[:billingDetails][:street] = truncate(address[:address1], 50)
150
+ post[:billingDetails][:street2] = truncate(address[:address2], 50)
151
+ post[:billingDetails][:city] = truncate(address[:city], 40)
152
+ post[:billingDetails][:state] = truncate(address[:state], 40)
130
153
  post[:billingDetails][:country] = address[:country]
131
- post[:billingDetails][:zip] = address[:zip]
132
- post[:billingDetails][:phone] = address[:phone]
154
+ post[:billingDetails][:zip] = truncate(address[:zip], 10)
155
+ post[:billingDetails][:phone] = truncate(address[:phone], 40)
133
156
  end
134
157
 
135
158
  # The add_address_for_vaulting method is applicable to the store method, as the APIs address
@@ -138,12 +161,12 @@ module ActiveMerchant #:nodoc:
138
161
  return unless address = options[:billing_address] || options[:address]
139
162
 
140
163
  post[:card][:billingAddress] = {}
141
- post[:card][:billingAddress][:street] = address[:address1]
142
- post[:card][:billingAddress][:street2] = address[:address2]
143
- post[:card][:billingAddress][:city] = address[:city]
144
- post[:card][:billingAddress][:zip] = address[:zip]
164
+ post[:card][:billingAddress][:street] = truncate(address[:address1], 50)
165
+ post[:card][:billingAddress][:street2] = truncate(address[:address2], 50)
166
+ post[:card][:billingAddress][:city] = truncate(address[:city], 40)
167
+ post[:card][:billingAddress][:zip] = truncate(address[:zip], 10)
145
168
  post[:card][:billingAddress][:country] = address[:country]
146
- post[:card][:billingAddress][:state] = address[:state] if address[:state]
169
+ post[:card][:billingAddress][:state] = truncate(address[:state], 40) if address[:state]
147
170
  end
148
171
 
149
172
  # This data is specific to creating a profile at the gateway's vault level
@@ -151,9 +174,9 @@ module ActiveMerchant #:nodoc:
151
174
  post[:firstName] = payment.first_name
152
175
  post[:lastName] = payment.last_name
153
176
  post[:dateOfBirth] = {}
154
- post[:dateOfBirth][:year] = options[:date_of_birth][:year]
155
- post[:dateOfBirth][:month] = options[:date_of_birth][:month]
156
- post[:dateOfBirth][:day] = options[:date_of_birth][:day]
177
+ post[:dateOfBirth][:year] = options.dig(:date_of_birth, :year)
178
+ post[:dateOfBirth][:month] = options.dig(:date_of_birth, :month)
179
+ post[:dateOfBirth][:day] = options.dig(:date_of_birth, :day)
157
180
  post[:email] = options[:email] if options[:email]
158
181
  post[:ip] = options[:ip] if options[:ip]
159
182
 
@@ -320,6 +343,7 @@ module ActiveMerchant #:nodoc:
320
343
  end
321
344
 
322
345
  post[:storedCredential][:initialTransactionId] = options[:stored_credential][:network_transaction_id] if options[:stored_credential][:network_transaction_id]
346
+ post[:storedCredential][:externalInitialTransactionId] = options[:external_initial_transaction_id] if options[:external_initial_transaction_id]
323
347
  end
324
348
 
325
349
  def mastercard?(payment)
@@ -363,9 +387,9 @@ module ActiveMerchant #:nodoc:
363
387
  base_url = (test? ? test_url : live_url)
364
388
 
365
389
  if action.include? 'profiles'
366
- "#{base_url}/customervault/v1/#{action}"
390
+ "#{base_url}/customervault/#{fetch_version}/#{action}"
367
391
  else
368
- "#{base_url}/cardpayments/v1/accounts/#{@options[:account_id]}/#{action}"
392
+ "#{base_url}/cardpayments/#{fetch_version}/accounts/#{@options[:account_id]}/#{action}"
369
393
  end
370
394
  end
371
395
 
@@ -383,7 +407,7 @@ module ActiveMerchant #:nodoc:
383
407
 
384
408
  def authorization_from(action, response)
385
409
  if action == 'profiles'
386
- pm = response['cards'].first['paymentToken']
410
+ pm = response['cards']&.first&.dig('paymentToken')
387
411
  "#{pm}|#{response['id']}"
388
412
  else
389
413
  response['id']
@@ -401,7 +425,7 @@ module ActiveMerchant #:nodoc:
401
425
  def post_data(parameters = {}, options = {})
402
426
  return unless parameters.present?
403
427
 
404
- parameters[:merchantRefNum] = options[:merchant_ref_num] || SecureRandom.hex(16).to_s
428
+ parameters[:merchantRefNum] = options[:merchant_ref_num] || options[:order_id] || SecureRandom.hex(16).to_s
405
429
 
406
430
  parameters.to_json
407
431
  end
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PayscoutGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://secure.payscout.com/api/transact.php'
5
5
 
@@ -115,12 +115,16 @@ module ActiveMerchant #:nodoc:
115
115
 
116
116
  message = message_from(response)
117
117
  test_mode = (test? || message =~ /TESTMODE/)
118
- Response.new(success?(response), message, response,
118
+ Response.new(
119
+ success?(response),
120
+ message,
121
+ response,
119
122
  test: test_mode,
120
123
  authorization: response['transactionid'],
121
124
  fraud_review: fraud_review?(response),
122
125
  avs_result: { code: response['avsresponse'] },
123
- cvv_result: response['cvvresponse'])
126
+ cvv_result: response['cvvresponse']
127
+ )
124
128
  end
125
129
 
126
130
  def message_from(response)
@@ -151,8 +155,7 @@ module ActiveMerchant #:nodoc:
151
155
  post[:password] = @options[:password]
152
156
  post[:type] = action
153
157
 
154
- request = post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
155
- request
158
+ post.merge(parameters).collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&')
156
159
  end
157
160
  end
158
161
  end
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PaystationGateway < Gateway
4
4
  self.live_url = self.test_url = 'https://www.paystation.co.nz/direct/paystation.dll'
5
5
 
@@ -177,9 +177,13 @@ module ActiveMerchant #:nodoc:
177
177
  response = parse(data)
178
178
  message = message_from(response)
179
179
 
180
- PaystationResponse.new(success?(response), message, response,
181
- test: (response[:tm]&.casecmp('t')&.zero?),
182
- authorization: response[:paystation_transaction_id])
180
+ PaystationResponse.new(
181
+ success?(response),
182
+ message,
183
+ response,
184
+ test: response[:tm]&.casecmp('t')&.zero?,
185
+ authorization: response[:paystation_transaction_id]
186
+ )
183
187
  end
184
188
 
185
189
  def success?(response)
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
- module ActiveMerchant #:nodoc:
4
- module Billing #:nodoc:
3
+ module ActiveMerchant # :nodoc:
4
+ module Billing # :nodoc:
5
5
  class PayuInGateway < Gateway
6
6
  self.test_url = 'https://test.payu.in/_payment'
7
7
  self.live_url = 'https://secure.payu.in/_payment'
@@ -1,13 +1,15 @@
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
  class PayuLatamGateway < Gateway
6
+ version '4.0'
7
+
6
8
  self.display_name = 'PayU Latam'
7
9
  self.homepage_url = 'http://www.payulatam.com'
8
10
 
9
- self.test_url = 'https://sandbox.api.payulatam.com/payments-api/4.0/service.cgi'
10
- self.live_url = 'https://api.payulatam.com/payments-api/4.0/service.cgi'
11
+ self.test_url = "https://sandbox.api.payulatam.com/payments-api/#{fetch_version}/service.cgi"
12
+ self.live_url = "https://api.payulatam.com/payments-api/#{fetch_version}/service.cgi"
11
13
 
12
14
  self.supported_countries = %w[AR BR CL CO MX PA PE]
13
15
  self.default_currency = 'USD'
@@ -167,7 +169,7 @@ module ActiveMerchant #:nodoc:
167
169
  order[:accountId] = @options[:account_id]
168
170
  order[:partnerId] = options[:partner_id] if options[:partner_id]
169
171
  order[:referenceCode] = options[:order_id] || generate_unique_id
170
- order[:description] = options[:description] || 'Compra en ' + @options[:merchant_id]
172
+ order[:description] = options[:description] || ('Compra en ' + @options[:merchant_id])
171
173
  order[:language] = options[:language] || 'en'
172
174
  order[:shippingAddress] = shipping_address_fields(options) if options[:shipping_address]
173
175
  post[:transaction][:order] = order
@@ -192,9 +192,13 @@ module ActiveMerchant
192
192
 
193
193
  success = (params[:summary_code] ? (params[:summary_code] == '0') : (params[:response_code] == '00'))
194
194
 
195
- Response.new(success, message, params,
195
+ Response.new(
196
+ success,
197
+ message,
198
+ params,
196
199
  test: (@options[:merchant].to_s == 'TEST'),
197
- authorization: post[:order_number])
200
+ authorization: post[:order_number]
201
+ )
198
202
  rescue ActiveMerchant::ResponseError => e
199
203
  raise unless e.response.code == '403'
200
204
 
@@ -1,5 +1,5 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
1
+ module ActiveMerchant # :nodoc:
2
+ module Billing # :nodoc:
3
3
  class PaywayDotComGateway < Gateway
4
4
  self.test_url = 'https://paywaywsdev.com/PaywayWS/Payment/CreditCard'
5
5
  self.live_url = 'https://paywayws.net/PaywayWS/Payment/CreditCard'
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  'I5' => 'M', # +4 and Address Match
49
49
  'I6' => 'W', # +4 Match
50
50
  'I7' => 'A', # Address Match
51
- 'I8' => 'C', # No Match
51
+ 'I8' => 'C' # No Match
52
52
  }
53
53
 
54
54
  PAYWAY_WS_SUCCESS = '5000'
@@ -212,8 +212,8 @@ module ActiveMerchant #:nodoc:
212
212
  test: test?,
213
213
  error_code: error_code_from(response),
214
214
  authorization: authorization_from(response),
215
- avs_result: avs_result,
216
- cvv_result: cvv_result
215
+ avs_result:,
216
+ cvv_result:
217
217
  )
218
218
  end
219
219
 
@@ -224,7 +224,7 @@ module ActiveMerchant #:nodoc:
224
224
  def error_code_from(response)
225
225
  return '' if success_from(response)
226
226
 
227
- error = !STANDARD_ERROR_CODE_MAPPING[response['paywayCode']].nil? ? STANDARD_ERROR_CODE_MAPPING[response['paywayCode']] : STANDARD_ERROR_CODE[:processing_error]
227
+ error = STANDARD_ERROR_CODE_MAPPING[response['paywayCode']].nil? ? STANDARD_ERROR_CODE[:processing_error] : STANDARD_ERROR_CODE_MAPPING[response['paywayCode']]
228
228
  return error
229
229
  end
230
230