activemerchant 1.79.2 → 1.129.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG +1391 -0
  3. data/README.md +29 -14
  4. data/lib/active_merchant/billing/avs_result.rb +25 -28
  5. data/lib/active_merchant/billing/base.rb +0 -13
  6. data/lib/active_merchant/billing/check.rb +55 -22
  7. data/lib/active_merchant/billing/compatibility.rb +10 -12
  8. data/lib/active_merchant/billing/credit_card.rb +82 -62
  9. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -4
  10. data/lib/active_merchant/billing/credit_card_methods.rb +328 -58
  11. data/lib/active_merchant/billing/cvv_result.rb +0 -1
  12. data/lib/active_merchant/billing/gateway.rb +61 -56
  13. data/lib/active_merchant/billing/gateways/adyen.rb +562 -87
  14. data/lib/active_merchant/billing/gateways/airwallex.rb +370 -0
  15. data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
  16. data/lib/active_merchant/billing/gateways/allied_wallet.rb +35 -36
  17. data/lib/active_merchant/billing/gateways/authorize_net.rb +297 -196
  18. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +31 -24
  19. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +94 -98
  20. data/lib/active_merchant/billing/gateways/axcessms.rb +64 -66
  21. data/lib/active_merchant/billing/gateways/balanced.rb +72 -65
  22. data/lib/active_merchant/billing/gateways/bambora_apac.rb +222 -0
  23. data/lib/active_merchant/billing/gateways/bank_frick.rb +16 -16
  24. data/lib/active_merchant/billing/gateways/banwire.rb +12 -12
  25. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +140 -69
  26. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +7 -7
  27. data/lib/active_merchant/billing/gateways/be2bill.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +115 -115
  29. data/lib/active_merchant/billing/gateways/beanstream.rb +39 -13
  30. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +1 -2
  31. data/lib/active_merchant/billing/gateways/blue_pay.rb +87 -58
  32. data/lib/active_merchant/billing/gateways/blue_snap.rb +405 -104
  33. data/lib/active_merchant/billing/gateways/bogus.rb +34 -30
  34. data/lib/active_merchant/billing/gateways/borgun.rb +97 -47
  35. data/lib/active_merchant/billing/gateways/bpoint.rb +20 -20
  36. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -3
  37. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +113 -0
  38. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  39. data/lib/active_merchant/billing/gateways/braintree_blue.rb +561 -259
  40. data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
  41. data/lib/active_merchant/billing/gateways/bridge_pay.rb +53 -54
  42. data/lib/active_merchant/billing/gateways/cams.rb +31 -31
  43. data/lib/active_merchant/billing/gateways/card_connect.rb +85 -33
  44. data/lib/active_merchant/billing/gateways/card_save.rb +7 -9
  45. data/lib/active_merchant/billing/gateways/card_stream.rb +187 -169
  46. data/lib/active_merchant/billing/gateways/cardknox.rb +24 -25
  47. data/lib/active_merchant/billing/gateways/cardprocess.rb +9 -7
  48. data/lib/active_merchant/billing/gateways/cashnet.rb +43 -27
  49. data/lib/active_merchant/billing/gateways/cc5.rb +14 -17
  50. data/lib/active_merchant/billing/gateways/cecabank.rb +62 -52
  51. data/lib/active_merchant/billing/gateways/cenpos.rb +63 -62
  52. data/lib/active_merchant/billing/gateways/checkout.rb +21 -23
  53. data/lib/active_merchant/billing/gateways/checkout_v2.rb +391 -113
  54. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -3
  55. data/lib/active_merchant/billing/gateways/clearhaus.rb +40 -41
  56. data/lib/active_merchant/billing/gateways/commerce_hub.rb +361 -0
  57. data/lib/active_merchant/billing/gateways/commercegate.rb +11 -12
  58. data/lib/active_merchant/billing/gateways/conekta.rb +35 -30
  59. data/lib/active_merchant/billing/gateways/creditcall.rb +59 -59
  60. data/lib/active_merchant/billing/gateways/credorax.rb +326 -145
  61. data/lib/active_merchant/billing/gateways/ct_payment.rb +269 -0
  62. data/lib/active_merchant/billing/gateways/culqi.rb +53 -53
  63. data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
  64. data/lib/active_merchant/billing/gateways/cyber_source.rb +566 -208
  65. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +456 -0
  66. data/lib/active_merchant/billing/gateways/d_local.rb +342 -0
  67. data/lib/active_merchant/billing/gateways/data_cash.rb +40 -56
  68. data/lib/active_merchant/billing/gateways/decidir.rb +358 -0
  69. data/lib/active_merchant/billing/gateways/decidir_plus.rb +344 -0
  70. data/lib/active_merchant/billing/gateways/dibs.rb +34 -40
  71. data/lib/active_merchant/billing/gateways/digitzs.rb +48 -45
  72. data/lib/active_merchant/billing/gateways/ebanx.rb +110 -60
  73. data/lib/active_merchant/billing/gateways/efsnet.rb +46 -50
  74. data/lib/active_merchant/billing/gateways/elavon.rb +351 -189
  75. data/lib/active_merchant/billing/gateways/element.rb +106 -56
  76. data/lib/active_merchant/billing/gateways/epay.rb +74 -64
  77. data/lib/active_merchant/billing/gateways/evo_ca.rb +13 -14
  78. data/lib/active_merchant/billing/gateways/eway.rb +74 -73
  79. data/lib/active_merchant/billing/gateways/eway_managed.rb +85 -87
  80. data/lib/active_merchant/billing/gateways/eway_rapid.rb +105 -60
  81. data/lib/active_merchant/billing/gateways/exact.rb +29 -37
  82. data/lib/active_merchant/billing/gateways/ezic.rb +21 -22
  83. data/lib/active_merchant/billing/gateways/fat_zebra.rb +70 -48
  84. data/lib/active_merchant/billing/gateways/federated_canada.rb +11 -13
  85. data/lib/active_merchant/billing/gateways/finansbank.rb +3 -4
  86. data/lib/active_merchant/billing/gateways/first_giving.rb +23 -23
  87. data/lib/active_merchant/billing/gateways/first_pay.rb +33 -13
  88. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +106 -105
  89. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +505 -0
  90. data/lib/active_merchant/billing/gateways/flo2cash.rb +36 -36
  91. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +2 -2
  92. data/lib/active_merchant/billing/gateways/forte.rb +70 -40
  93. data/lib/active_merchant/billing/gateways/garanti.rb +24 -31
  94. data/lib/active_merchant/billing/gateways/global_collect.rb +378 -154
  95. data/lib/active_merchant/billing/gateways/global_transport.rb +12 -13
  96. data/lib/active_merchant/billing/gateways/hdfc.rb +55 -57
  97. data/lib/active_merchant/billing/gateways/hps.rb +236 -69
  98. data/lib/active_merchant/billing/gateways/iats_payments.rb +61 -39
  99. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  100. data/lib/active_merchant/billing/gateways/inspire.rb +41 -47
  101. data/lib/active_merchant/billing/gateways/instapay.rb +10 -14
  102. data/lib/active_merchant/billing/gateways/ipg.rb +420 -0
  103. data/lib/active_merchant/billing/gateways/ipp.rb +25 -24
  104. data/lib/active_merchant/billing/gateways/iridium.rb +243 -244
  105. data/lib/active_merchant/billing/gateways/itransact.rb +14 -14
  106. data/lib/active_merchant/billing/gateways/iveri.rb +73 -34
  107. data/lib/active_merchant/billing/gateways/ixopay.rb +320 -0
  108. data/lib/active_merchant/billing/gateways/jetpay.rb +145 -152
  109. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +154 -159
  110. data/lib/active_merchant/billing/gateways/komoju.rb +16 -16
  111. data/lib/active_merchant/billing/gateways/kushki.rb +127 -57
  112. data/lib/active_merchant/billing/gateways/latitude19.rb +111 -115
  113. data/lib/active_merchant/billing/gateways/linkpoint.rb +82 -85
  114. data/lib/active_merchant/billing/gateways/litle.rb +247 -53
  115. data/lib/active_merchant/billing/gateways/mastercard.rb +41 -23
  116. data/lib/active_merchant/billing/gateways/maxipago.rb +5 -5
  117. data/lib/active_merchant/billing/gateways/mercado_pago.rb +135 -49
  118. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +62 -29
  119. data/lib/active_merchant/billing/gateways/merchant_one.rb +16 -20
  120. data/lib/active_merchant/billing/gateways/merchant_partners.rb +40 -40
  121. data/lib/active_merchant/billing/gateways/merchant_ware.rb +54 -60
  122. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +42 -44
  123. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +52 -14
  124. data/lib/active_merchant/billing/gateways/mercury.rb +47 -51
  125. data/lib/active_merchant/billing/gateways/metrics_global.rb +32 -42
  126. data/lib/active_merchant/billing/gateways/micropayment.rb +42 -45
  127. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +7 -7
  128. data/lib/active_merchant/billing/gateways/migs.rb +45 -40
  129. data/lib/active_merchant/billing/gateways/mit.rb +260 -0
  130. data/lib/active_merchant/billing/gateways/modern_payments.rb +2 -2
  131. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +29 -31
  132. data/lib/active_merchant/billing/gateways/moka.rb +290 -0
  133. data/lib/active_merchant/billing/gateways/monei.rb +255 -138
  134. data/lib/active_merchant/billing/gateways/moneris.rb +226 -88
  135. data/lib/active_merchant/billing/gateways/money_movers.rb +11 -13
  136. data/lib/active_merchant/billing/gateways/mundipagg.rb +117 -43
  137. data/lib/active_merchant/billing/gateways/nab_transact.rb +28 -31
  138. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +13 -15
  139. data/lib/active_merchant/billing/gateways/net_registry.rb +12 -12
  140. data/lib/active_merchant/billing/gateways/netaxept.rb +33 -34
  141. data/lib/active_merchant/billing/gateways/netbanx.rb +167 -80
  142. data/lib/active_merchant/billing/gateways/netbilling.rb +27 -30
  143. data/lib/active_merchant/billing/gateways/netpay.rb +10 -10
  144. data/lib/active_merchant/billing/gateways/network_merchants.rb +7 -11
  145. data/lib/active_merchant/billing/gateways/nmi.rb +134 -48
  146. data/lib/active_merchant/billing/gateways/ogone.rb +88 -58
  147. data/lib/active_merchant/billing/gateways/omise.rb +30 -31
  148. data/lib/active_merchant/billing/gateways/openpay.rb +45 -26
  149. data/lib/active_merchant/billing/gateways/opp.rb +166 -144
  150. data/lib/active_merchant/billing/gateways/optimal_payment.rb +67 -64
  151. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +5 -7
  152. data/lib/active_merchant/billing/gateways/orbital.rb +726 -382
  153. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +26 -27
  154. data/lib/active_merchant/billing/gateways/pagarme.rb +47 -56
  155. data/lib/active_merchant/billing/gateways/pago_facil.rb +12 -14
  156. data/lib/active_merchant/billing/gateways/pay_arc.rb +392 -0
  157. data/lib/active_merchant/billing/gateways/pay_conex.rb +39 -40
  158. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +65 -65
  159. data/lib/active_merchant/billing/gateways/pay_hub.rb +39 -39
  160. data/lib/active_merchant/billing/gateways/pay_junction.rb +37 -37
  161. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +70 -54
  162. data/lib/active_merchant/billing/gateways/pay_secure.rb +15 -17
  163. data/lib/active_merchant/billing/gateways/pay_trace.rb +450 -0
  164. data/lib/active_merchant/billing/gateways/paybox_direct.rb +71 -47
  165. data/lib/active_merchant/billing/gateways/payeezy.rb +159 -32
  166. data/lib/active_merchant/billing/gateways/payex.rb +39 -42
  167. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +41 -36
  168. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +11 -8
  169. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +3 -3
  170. data/lib/active_merchant/billing/gateways/payflow.rb +178 -54
  171. data/lib/active_merchant/billing/gateways/payflow_express.rb +61 -65
  172. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +0 -1
  173. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -2
  174. data/lib/active_merchant/billing/gateways/payment_express.rb +66 -58
  175. data/lib/active_merchant/billing/gateways/paymentez.rb +114 -25
  176. data/lib/active_merchant/billing/gateways/paymill.rb +134 -133
  177. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +2 -1
  178. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
  179. data/lib/active_merchant/billing/gateways/paypal.rb +27 -14
  180. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +2 -2
  182. data/lib/active_merchant/billing/gateways/paypal_express.rb +5 -2
  183. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/paysafe.rb +420 -0
  185. data/lib/active_merchant/billing/gateways/payscout.rb +10 -13
  186. data/lib/active_merchant/billing/gateways/paystation.rb +79 -82
  187. data/lib/active_merchant/billing/gateways/payu_in.rb +59 -58
  188. data/lib/active_merchant/billing/gateways/payu_latam.rb +139 -97
  189. data/lib/active_merchant/billing/gateways/payway.rb +27 -27
  190. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +253 -0
  191. data/lib/active_merchant/billing/gateways/pin.rb +87 -34
  192. data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
  193. data/lib/active_merchant/billing/gateways/plugnpay.rb +82 -82
  194. data/lib/active_merchant/billing/gateways/priority.rb +392 -0
  195. data/lib/active_merchant/billing/gateways/pro_pay.rb +139 -140
  196. data/lib/active_merchant/billing/gateways/psigate.rb +44 -44
  197. data/lib/active_merchant/billing/gateways/psl_card.rb +29 -37
  198. data/lib/active_merchant/billing/gateways/qbms.rb +75 -76
  199. data/lib/active_merchant/billing/gateways/quantum.rb +21 -23
  200. data/lib/active_merchant/billing/gateways/quickbooks.rb +142 -55
  201. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +103 -107
  202. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +156 -158
  203. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +7 -8
  204. data/lib/active_merchant/billing/gateways/quickpay.rb +1 -3
  205. data/lib/active_merchant/billing/gateways/qvalent.rb +137 -68
  206. data/lib/active_merchant/billing/gateways/rapyd.rb +319 -0
  207. data/lib/active_merchant/billing/gateways/reach.rb +277 -0
  208. data/lib/active_merchant/billing/gateways/realex.rb +132 -50
  209. data/lib/active_merchant/billing/gateways/redsys.rb +382 -186
  210. data/lib/active_merchant/billing/gateways/s5.rb +16 -16
  211. data/lib/active_merchant/billing/gateways/safe_charge.rb +83 -47
  212. data/lib/active_merchant/billing/gateways/sage.rb +49 -48
  213. data/lib/active_merchant/billing/gateways/sage_pay.rb +76 -83
  214. data/lib/active_merchant/billing/gateways/sallie_mae.rb +13 -15
  215. data/lib/active_merchant/billing/gateways/secure_net.rb +32 -40
  216. data/lib/active_merchant/billing/gateways/secure_pay.rb +30 -40
  217. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +23 -26
  218. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +14 -16
  219. data/lib/active_merchant/billing/gateways/securion_pay.rb +69 -31
  220. data/lib/active_merchant/billing/gateways/shift4.rb +342 -0
  221. data/lib/active_merchant/billing/gateways/simetrik.rb +368 -0
  222. data/lib/active_merchant/billing/gateways/skip_jack.rb +52 -53
  223. data/lib/active_merchant/billing/gateways/smart_ps.rb +51 -60
  224. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +29 -29
  225. data/lib/active_merchant/billing/gateways/spreedly_core.rb +66 -47
  226. data/lib/active_merchant/billing/gateways/stripe.rb +309 -148
  227. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +556 -0
  228. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +18 -23
  229. data/lib/active_merchant/billing/gateways/telr.rb +46 -48
  230. data/lib/active_merchant/billing/gateways/tns.rb +8 -7
  231. data/lib/active_merchant/billing/gateways/trans_first.rb +37 -37
  232. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +249 -245
  233. data/lib/active_merchant/billing/gateways/transact_pro.rb +25 -27
  234. data/lib/active_merchant/billing/gateways/transax.rb +6 -8
  235. data/lib/active_merchant/billing/gateways/transnational.rb +1 -2
  236. data/lib/active_merchant/billing/gateways/trexle.rb +22 -18
  237. data/lib/active_merchant/billing/gateways/trust_commerce.rb +161 -88
  238. data/lib/active_merchant/billing/gateways/usa_epay.rb +5 -6
  239. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +231 -238
  240. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +129 -55
  241. data/lib/active_merchant/billing/gateways/vanco.rb +42 -33
  242. data/lib/active_merchant/billing/gateways/verifi.rb +52 -53
  243. data/lib/active_merchant/billing/gateways/viaklix.rb +18 -22
  244. data/lib/active_merchant/billing/gateways/visanet_peru.rb +115 -74
  245. data/lib/active_merchant/billing/gateways/vpos.rb +223 -0
  246. data/lib/active_merchant/billing/gateways/webpay.rb +9 -9
  247. data/lib/active_merchant/billing/gateways/wepay.rb +38 -41
  248. data/lib/active_merchant/billing/gateways/wirecard.rb +36 -37
  249. data/lib/active_merchant/billing/gateways/wompi.rb +197 -0
  250. data/lib/active_merchant/billing/gateways/world_net.rb +39 -38
  251. data/lib/active_merchant/billing/gateways/worldpay.rb +756 -142
  252. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +73 -83
  253. data/lib/active_merchant/billing/gateways/worldpay_us.rb +31 -31
  254. data/lib/active_merchant/billing/model.rb +2 -2
  255. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +3 -3
  256. data/lib/active_merchant/billing/rails.rb +1 -1
  257. data/lib/active_merchant/billing/response.rb +32 -13
  258. data/lib/active_merchant/billing/three_d_secure_eci_mapper.rb +27 -0
  259. data/lib/active_merchant/billing.rb +1 -0
  260. data/lib/active_merchant/connection.rb +24 -38
  261. data/lib/active_merchant/country.rb +9 -5
  262. data/lib/active_merchant/errors.rb +4 -1
  263. data/lib/active_merchant/net_http_ssl_connection.rb +2 -0
  264. data/lib/active_merchant/network_connection_retries.rb +28 -31
  265. data/lib/active_merchant/post_data.rb +5 -3
  266. data/lib/active_merchant/posts_data.rb +5 -7
  267. data/lib/active_merchant/version.rb +1 -1
  268. data/lib/active_merchant.rb +3 -3
  269. data/lib/activemerchant.rb +1 -1
  270. data/lib/certs/cacert.pem +1592 -2329
  271. data/lib/support/gateway_support.rb +8 -10
  272. data/lib/support/ssl_verify.rb +9 -14
  273. data/lib/support/ssl_version.rb +9 -10
  274. metadata +98 -37
  275. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
  276. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
  277. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
  278. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
  279. data/lib/active_merchant/billing/gateways/moneris_us.rb +0 -309
@@ -6,202 +6,202 @@ module ActiveMerchant #:nodoc:
6
6
  self.test_url = 'https://xmltest.propay.com/API/PropayAPI.aspx'
7
7
  self.live_url = 'https://epay.propay.com/api/propayapi.aspx'
8
8
 
9
- self.supported_countries = ['US', 'CA']
9
+ self.supported_countries = %w[US CA]
10
10
  self.default_currency = 'USD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
+ self.supported_cardtypes = %i[visa master american_express discover]
13
13
 
14
14
  self.homepage_url = 'https://www.propay.com/'
15
15
  self.display_name = 'ProPay'
16
16
 
17
17
  STATUS_RESPONSE_CODES = {
18
- "00" => "Success",
19
- "20" => "Invalid username",
20
- "21" => "Invalid transType",
21
- "22" => "Invalid Currency Code",
22
- "23" => "Invalid accountType",
23
- "24" => "Invalid sourceEmail",
24
- "25" => "Invalid firstName",
25
- "26" => "Invalid mInitial",
26
- "27" => "Invalid lastName",
27
- "28" => "Invalid billAddr",
28
- "29" => "Invalid aptNum",
29
- "30" => "Invalid city",
30
- "31" => "Invalid state",
31
- "32" => "Invalid billZip",
32
- "33" => "Invalid mailAddr",
33
- "34" => "Invalid mailApt",
34
- "35" => "Invalid mailCity",
35
- "36" => "Invalid mailState",
36
- "37" => "Invalid mailZip",
37
- "38" => "Invalid dayPhone",
38
- "39" => "Invalid evenPhone",
39
- "40" => "Invalid ssn",
40
- "41" => "Invalid dob",
41
- "42" => "Invalid recEmail",
42
- "43" => "Invalid knownAccount",
43
- "44" => "Invalid amount",
44
- "45" => "Invalid invNum",
45
- "46" => "Invalid rtNum",
46
- "47" => "Invalid accntNum",
47
- "48" => "Invalid ccNum",
48
- "49" => "Invalid expDate",
49
- "50" => "Invalid cvv2",
50
- "51" => "Invalid transNum and/or Unable to act perform actions on transNum due to funding",
51
- "52" => "Invalid splitNum",
52
- "53" => "A ProPay account with this email address already exists AND/OR User has no account number",
53
- "54" => "A ProPay account with this social security number already exists",
54
- "55" => "The email address provided does not correspond to a ProPay account.",
55
- "56" => "Recipient’s email address shouldn’t have a ProPay account and does",
56
- "57" => "Cannot settle transaction because it already expired",
57
- "58" => "Credit card declined",
58
- "59" => "Invalid Credential or IP address not allowed",
59
- "60" => "Credit card authorization timed out; retry at a later time",
60
- "61" => "Amount exceeds single transaction limit",
61
- "62" => "Amount exceeds monthly volume limit",
62
- "63" => "Insufficient funds in account",
63
- "64" => "Over credit card use limit",
64
- "65" => "Miscellaneous error",
65
- "66" => "Denied a ProPay account",
66
- "67" => "Unauthorized service requested",
67
- "68" => "Account not affiliated",
68
- "69" => "Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)",
69
- "70" => "Duplicate external ID",
70
- "71" => "Account previously set up, but problem affiliating it with partner",
71
- "72" => "The ProPay Account has already been upgraded to a Premium Account",
72
- "73" => "Invalid Destination Account",
73
- "74" => "Account or Trans Error",
74
- "75" => "Money already pulled",
75
- "76" => "Not Premium (used only for push/pull transactions)",
76
- "77" => "Empty results",
77
- "78" => "Invalid Authentication",
78
- "79" => "Generic account status error",
79
- "80" => "Invalid Password",
80
- "81" => "Account Expired",
81
- "82" => "InvalidUserID",
82
- "83" => "BatchTransCountError",
83
- "84" => "InvalidBeginDate",
84
- "85" => "InvalidEndDate",
85
- "86" => "InvalidExternalID",
86
- "87" => "DuplicateUserID",
87
- "88" => "Invalid track 1",
88
- "89" => "Invalid track 2",
89
- "90" => "Transaction already refunded",
90
- "91" => "Duplicate Batch ID"
18
+ '00' => 'Success',
19
+ '20' => 'Invalid username',
20
+ '21' => 'Invalid transType',
21
+ '22' => 'Invalid Currency Code',
22
+ '23' => 'Invalid accountType',
23
+ '24' => 'Invalid sourceEmail',
24
+ '25' => 'Invalid firstName',
25
+ '26' => 'Invalid mInitial',
26
+ '27' => 'Invalid lastName',
27
+ '28' => 'Invalid billAddr',
28
+ '29' => 'Invalid aptNum',
29
+ '30' => 'Invalid city',
30
+ '31' => 'Invalid state',
31
+ '32' => 'Invalid billZip',
32
+ '33' => 'Invalid mailAddr',
33
+ '34' => 'Invalid mailApt',
34
+ '35' => 'Invalid mailCity',
35
+ '36' => 'Invalid mailState',
36
+ '37' => 'Invalid mailZip',
37
+ '38' => 'Invalid dayPhone',
38
+ '39' => 'Invalid evenPhone',
39
+ '40' => 'Invalid ssn',
40
+ '41' => 'Invalid dob',
41
+ '42' => 'Invalid recEmail',
42
+ '43' => 'Invalid knownAccount',
43
+ '44' => 'Invalid amount',
44
+ '45' => 'Invalid invNum',
45
+ '46' => 'Invalid rtNum',
46
+ '47' => 'Invalid accntNum',
47
+ '48' => 'Invalid ccNum',
48
+ '49' => 'Invalid expDate',
49
+ '50' => 'Invalid cvv2',
50
+ '51' => 'Invalid transNum and/or Unable to act perform actions on transNum due to funding',
51
+ '52' => 'Invalid splitNum',
52
+ '53' => 'A ProPay account with this email address already exists AND/OR User has no account number',
53
+ '54' => 'A ProPay account with this social security number already exists',
54
+ '55' => 'The email address provided does not correspond to a ProPay account.',
55
+ '56' => 'Recipient’s email address shouldn’t have a ProPay account and does',
56
+ '57' => 'Cannot settle transaction because it already expired',
57
+ '58' => 'Credit card declined',
58
+ '59' => 'Invalid Credential or IP address not allowed',
59
+ '60' => 'Credit card authorization timed out; retry at a later time',
60
+ '61' => 'Amount exceeds single transaction limit',
61
+ '62' => 'Amount exceeds monthly volume limit',
62
+ '63' => 'Insufficient funds in account',
63
+ '64' => 'Over credit card use limit',
64
+ '65' => 'Miscellaneous error',
65
+ '66' => 'Denied a ProPay account',
66
+ '67' => 'Unauthorized service requested',
67
+ '68' => 'Account not affiliated',
68
+ '69' => 'Duplicate invoice number (The same card was charged for the same amount with the same invoice number (including blank invoices) in a 1 minute period. Details about the original transaction are included whenever a 69 response is returned. These details include a repeat of the auth code, the original AVS response, and the original CVV response.)',
69
+ '70' => 'Duplicate external ID',
70
+ '71' => 'Account previously set up, but problem affiliating it with partner',
71
+ '72' => 'The ProPay Account has already been upgraded to a Premium Account',
72
+ '73' => 'Invalid Destination Account',
73
+ '74' => 'Account or Trans Error',
74
+ '75' => 'Money already pulled',
75
+ '76' => 'Not Premium (used only for push/pull transactions)',
76
+ '77' => 'Empty results',
77
+ '78' => 'Invalid Authentication',
78
+ '79' => 'Generic account status error',
79
+ '80' => 'Invalid Password',
80
+ '81' => 'Account Expired',
81
+ '82' => 'InvalidUserID',
82
+ '83' => 'BatchTransCountError',
83
+ '84' => 'InvalidBeginDate',
84
+ '85' => 'InvalidEndDate',
85
+ '86' => 'InvalidExternalID',
86
+ '87' => 'DuplicateUserID',
87
+ '88' => 'Invalid track 1',
88
+ '89' => 'Invalid track 2',
89
+ '90' => 'Transaction already refunded',
90
+ '91' => 'Duplicate Batch ID'
91
91
  }
92
92
 
93
93
  TRANSACTION_RESPONSE_CODES = {
94
- "00" => "Success",
95
- "1" => "Transaction blocked by issuer",
96
- "4" => "Pick up card and deny transaction",
97
- "5" => "Problem with the account",
98
- "6" => "Customer requested stop to recurring payment",
99
- "7" => "Customer requested stop to all recurring payments",
100
- "8" => "Honor with ID only",
101
- "9" => "Unpaid items on customer account",
102
- "12" => "Invalid transaction",
103
- "13" => "Amount Error",
104
- "14" => "Invalid card number",
105
- "15" => "No such issuer. Could not route transaction",
106
- "16" => "Refund error",
107
- "17" => "Over limit",
108
- "19" => "Reenter transaction or the merchant account may be boarded incorrectly",
109
- "25" => "Invalid terminal 41 Lost card",
110
- "43" => "Stolen card",
111
- "51" => "Insufficient funds",
112
- "52" => "No such account",
113
- "54" => "Expired card",
114
- "55" => "Incorrect PIN",
115
- "57" => "Bank does not allow this type of purchase",
116
- "58" => "Credit card network does not allow this type of purchase for your merchant account.",
117
- "61" => "Exceeds issuer withdrawal limit",
118
- "62" => "Issuer does not allow this card to be charged for your business.",
119
- "63" => "Security Violation",
120
- "65" => "Activity limit exceeded",
121
- "75" => "PIN tries exceeded",
122
- "76" => "Unable to locate account",
123
- "78" => "Account not recognized",
124
- "80" => "Invalid Date",
125
- "82" => "Invalid CVV2",
126
- "83" => "Cannot verify the PIN",
127
- "85" => "Service not supported for this card",
128
- "93" => "Cannot complete transaction. Customer should call 800 number.",
129
- "95" => "Misc Error Transaction failure",
130
- "96" => "Issuer system malfunction or timeout.",
131
- "97" => "Approved for a lesser amount. ProPay will not settle and consider this a decline.",
132
- "98" => "Failure HV",
133
- "99" => "Generic decline or unable to parse issuer response code"
94
+ '00' => 'Success',
95
+ '1' => 'Transaction blocked by issuer',
96
+ '4' => 'Pick up card and deny transaction',
97
+ '5' => 'Problem with the account',
98
+ '6' => 'Customer requested stop to recurring payment',
99
+ '7' => 'Customer requested stop to all recurring payments',
100
+ '8' => 'Honor with ID only',
101
+ '9' => 'Unpaid items on customer account',
102
+ '12' => 'Invalid transaction',
103
+ '13' => 'Amount Error',
104
+ '14' => 'Invalid card number',
105
+ '15' => 'No such issuer. Could not route transaction',
106
+ '16' => 'Refund error',
107
+ '17' => 'Over limit',
108
+ '19' => 'Reenter transaction or the merchant account may be boarded incorrectly',
109
+ '25' => 'Invalid terminal 41 Lost card',
110
+ '43' => 'Stolen card',
111
+ '51' => 'Insufficient funds',
112
+ '52' => 'No such account',
113
+ '54' => 'Expired card',
114
+ '55' => 'Incorrect PIN',
115
+ '57' => 'Bank does not allow this type of purchase',
116
+ '58' => 'Credit card network does not allow this type of purchase for your merchant account.',
117
+ '61' => 'Exceeds issuer withdrawal limit',
118
+ '62' => 'Issuer does not allow this card to be charged for your business.',
119
+ '63' => 'Security Violation',
120
+ '65' => 'Activity limit exceeded',
121
+ '75' => 'PIN tries exceeded',
122
+ '76' => 'Unable to locate account',
123
+ '78' => 'Account not recognized',
124
+ '80' => 'Invalid Date',
125
+ '82' => 'Invalid CVV2',
126
+ '83' => 'Cannot verify the PIN',
127
+ '85' => 'Service not supported for this card',
128
+ '93' => 'Cannot complete transaction. Customer should call 800 number.',
129
+ '95' => 'Misc Error Transaction failure',
130
+ '96' => 'Issuer system malfunction or timeout.',
131
+ '97' => 'Approved for a lesser amount. ProPay will not settle and consider this a decline.',
132
+ '98' => 'Failure HV',
133
+ '99' => 'Generic decline or unable to parse issuer response code'
134
134
  }
135
135
 
136
- def initialize(options={})
136
+ def initialize(options = {})
137
137
  requires!(options, :cert_str)
138
138
  super
139
139
  end
140
140
 
141
- def purchase(money, payment, options={})
141
+ def purchase(money, payment, options = {})
142
142
  request = build_xml_request do |xml|
143
143
  add_invoice(xml, money, options)
144
144
  add_payment(xml, payment, options)
145
145
  add_address(xml, options)
146
146
  add_account(xml, options)
147
147
  add_recurring(xml, options)
148
- xml.transType "04"
148
+ xml.transType '04'
149
149
  end
150
150
 
151
151
  commit(request)
152
152
  end
153
153
 
154
- def authorize(money, payment, options={})
154
+ def authorize(money, payment, options = {})
155
155
  request = build_xml_request do |xml|
156
156
  add_invoice(xml, money, options)
157
157
  add_payment(xml, payment, options)
158
158
  add_address(xml, options)
159
159
  add_account(xml, options)
160
160
  add_recurring(xml, options)
161
- xml.transType "05"
161
+ xml.transType '05'
162
162
  end
163
163
 
164
164
  commit(request)
165
165
  end
166
166
 
167
- def capture(money, authorization, options={})
167
+ def capture(money, authorization, options = {})
168
168
  request = build_xml_request do |xml|
169
169
  add_invoice(xml, money, options)
170
170
  add_account(xml, options)
171
171
  xml.transNum authorization
172
- xml.transType "06"
172
+ xml.transType '06'
173
173
  end
174
174
 
175
175
  commit(request)
176
176
  end
177
177
 
178
- def refund(money, authorization, options={})
178
+ def refund(money, authorization, options = {})
179
179
  request = build_xml_request do |xml|
180
180
  add_invoice(xml, money, options)
181
181
  add_account(xml, options)
182
182
  xml.transNum authorization
183
- xml.transType "07"
183
+ xml.transType '07'
184
184
  end
185
185
 
186
186
  commit(request)
187
187
  end
188
188
 
189
- def void(authorization, options={})
189
+ def void(authorization, options = {})
190
190
  refund(nil, authorization, options)
191
191
  end
192
192
 
193
- def credit(money, payment, options={})
193
+ def credit(money, payment, options = {})
194
194
  request = build_xml_request do |xml|
195
195
  add_invoice(xml, money, options)
196
196
  add_payment(xml, payment, options)
197
197
  add_account(xml, options)
198
- xml.transType "35"
198
+ xml.transType '35'
199
199
  end
200
200
 
201
201
  commit(request)
202
202
  end
203
203
 
204
- def verify(credit_card, options={})
204
+ def verify(credit_card, options = {})
205
205
  MultiResponse.run(:use_first_response) do |r|
206
206
  r.process { authorize(100, credit_card, options) }
207
207
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -234,7 +234,7 @@ module ActiveMerchant #:nodoc:
234
234
  xml.aptNum address[:address2]
235
235
  xml.city address[:city]
236
236
  xml.state address[:state]
237
- xml.zip address[:zip]
237
+ xml.zip address[:zip].to_s.delete('-')
238
238
  end
239
239
  end
240
240
 
@@ -253,9 +253,9 @@ module ActiveMerchant #:nodoc:
253
253
  end
254
254
 
255
255
  def parse(body)
256
- results = {}
256
+ results = {}
257
257
  xml = Nokogiri::XML(body)
258
- resp = xml.xpath("//XMLResponse/XMLTrans")
258
+ resp = xml.xpath('//XMLResponse/XMLTrans')
259
259
  resp.children.each do |element|
260
260
  results[element.name.underscore.downcase.to_sym] = element.text
261
261
  end
@@ -279,11 +279,12 @@ module ActiveMerchant #:nodoc:
279
279
  end
280
280
 
281
281
  def success_from(response)
282
- response[:status] == "00"
282
+ response[:status] == '00'
283
283
  end
284
284
 
285
285
  def message_from(response)
286
- return "Success" if success_from(response)
286
+ return 'Success' if success_from(response)
287
+
287
288
  message = STATUS_RESPONSE_CODES[response[:status]]
288
289
  message += " - #{TRANSACTION_RESPONSE_CODES[response[:response_code]]}" if response[:response_code]
289
290
 
@@ -295,16 +296,14 @@ module ActiveMerchant #:nodoc:
295
296
  end
296
297
 
297
298
  def error_code_from(response)
298
- unless success_from(response)
299
- response[:status]
300
- end
299
+ response[:status] unless success_from(response)
301
300
  end
302
301
 
303
302
  def build_xml_request
304
303
  builder = Nokogiri::XML::Builder.new do |xml|
305
304
  xml.XMLRequest do
306
305
  xml.certStr @options[:cert_str]
307
- xml.class_ "partner"
306
+ xml.class_ 'partner'
308
307
  xml.XMLTrans do
309
308
  yield(xml)
310
309
  end
@@ -317,9 +316,9 @@ module ActiveMerchant #:nodoc:
317
316
 
318
317
  def underscore(camel_cased_word)
319
318
  camel_cased_word.to_s.gsub(/::/, '/').
320
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
321
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
322
- tr("-", "_").
319
+ gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
320
+ gsub(/([a-z\d])([A-Z])/, '\1_\2').
321
+ tr('-', '_').
323
322
  downcase
324
323
  end
325
324
  end
@@ -35,10 +35,10 @@ module ActiveMerchant #:nodoc:
35
35
  # :email => 'jack@yahoo.com'
36
36
  # )
37
37
  class PsigateGateway < Gateway
38
- self.test_url = 'https://staging.psigate.com:17989/Messenger/XMLMessenger'
39
- self.live_url = 'https://secure.psigate.com:17934/Messenger/XMLMessenger'
38
+ self.test_url = 'https://realtimestaging.psigate.com/xml'
39
+ self.live_url = 'https://realtime.psigate.com/xml'
40
40
 
41
- self.supported_cardtypes = [:visa, :master, :american_express]
41
+ self.supported_cardtypes = %i[visa master american_express]
42
42
  self.supported_countries = ['CA']
43
43
  self.homepage_url = 'http://www.psigate.com/'
44
44
  self.display_name = 'Psigate'
@@ -53,18 +53,18 @@ module ActiveMerchant #:nodoc:
53
53
 
54
54
  def authorize(money, creditcard, options = {})
55
55
  requires!(options, :order_id)
56
- options[:CardAction] = "1"
56
+ options[:CardAction] = '1'
57
57
  commit(money, creditcard, options)
58
58
  end
59
59
 
60
60
  def purchase(money, creditcard, options = {})
61
61
  requires!(options, :order_id)
62
- options[:CardAction] = "0"
62
+ options[:CardAction] = '0'
63
63
  commit(money, creditcard, options)
64
64
  end
65
65
 
66
66
  def capture(money, authorization, options = {})
67
- options[:CardAction] = "2"
67
+ options[:CardAction] = '2'
68
68
  options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
69
69
  commit(money, nil, options)
70
70
  end
@@ -75,13 +75,13 @@ module ActiveMerchant #:nodoc:
75
75
  end
76
76
 
77
77
  def refund(money, authorization, options = {})
78
- options[:CardAction] = "3"
78
+ options[:CardAction] = '3'
79
79
  options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
80
80
  commit(money, nil, options)
81
81
  end
82
82
 
83
83
  def void(authorization, options = {})
84
- options[:CardAction] = "9"
84
+ options[:CardAction] = '9'
85
85
  options[:order_id], options[:trans_ref_number] = split_authorization(authorization)
86
86
  commit(nil, nil, options)
87
87
  end
@@ -103,11 +103,10 @@ module ActiveMerchant #:nodoc:
103
103
  response = parse(ssl_post(url, post_data(money, creditcard, options)))
104
104
 
105
105
  Response.new(successful?(response), message_from(response), response,
106
- :test => test?,
107
- :authorization => build_authorization(response) ,
108
- :avs_result => { :code => response[:avsresult] },
109
- :cvv_result => response[:cardidresult]
110
- )
106
+ test: test?,
107
+ authorization: build_authorization(response),
108
+ avs_result: { code: response[:avsresult] },
109
+ cvv_result: response[:cardidresult])
111
110
  end
112
111
 
113
112
  def url
@@ -115,11 +114,11 @@ module ActiveMerchant #:nodoc:
115
114
  end
116
115
 
117
116
  def successful?(response)
118
- response[:approved] == "APPROVED"
117
+ response[:approved] == 'APPROVED'
119
118
  end
120
119
 
121
120
  def parse(xml)
122
- response = {:message => "Global Error Receipt", :complete => false}
121
+ response = { message: 'Global Error Receipt', complete: false }
123
122
 
124
123
  xml = REXML::Document.new(xml)
125
124
  xml.elements.each('//Result/*') do |node|
@@ -132,7 +131,7 @@ module ActiveMerchant #:nodoc:
132
131
  def post_data(money, creditcard, options)
133
132
  xml = REXML::Document.new
134
133
  xml << REXML::XMLDecl.new
135
- root = xml.add_element("Order")
134
+ root = xml.add_element('Order')
136
135
 
137
136
  parameters(money, creditcard, options).each do |key, value|
138
137
  root.add_element(key.to_s).text = value if value
@@ -144,43 +143,43 @@ module ActiveMerchant #:nodoc:
144
143
  def parameters(money, creditcard, options = {})
145
144
  params = {
146
145
  # General order parameters
147
- :StoreID => @options[:login],
148
- :Passphrase => @options[:password],
149
- :TestResult => options[:test_result],
150
- :OrderID => options[:order_id],
151
- :UserID => options[:user_id],
152
- :Phone => options[:phone],
153
- :Fax => options[:fax],
154
- :Email => options[:email],
155
- :TransRefNumber => options[:trans_ref_number],
146
+ StoreID: @options[:login],
147
+ Passphrase: @options[:password],
148
+ TestResult: options[:test_result],
149
+ OrderID: options[:order_id],
150
+ UserID: options[:user_id],
151
+ Phone: options[:phone],
152
+ Fax: options[:fax],
153
+ Email: options[:email],
154
+ TransRefNumber: options[:trans_ref_number],
156
155
 
157
156
  # Credit Card parameters
158
- :PaymentType => "CC",
159
- :CardAction => options[:CardAction],
157
+ PaymentType: 'CC',
158
+ CardAction: options[:CardAction],
160
159
 
161
160
  # Financial parameters
162
- :CustomerIP => options[:ip],
163
- :SubTotal => amount(money),
164
- :Tax1 => options[:tax1],
165
- :Tax2 => options[:tax2],
166
- :ShippingTotal => options[:shipping_total],
161
+ CustomerIP: options[:ip],
162
+ SubTotal: amount(money),
163
+ Tax1: options[:tax1],
164
+ Tax2: options[:tax2],
165
+ ShippingTotal: options[:shipping_total]
167
166
  }
168
167
 
169
168
  if creditcard
170
- exp_month = sprintf("%.2i", creditcard.month) unless creditcard.month.blank?
171
- exp_year = creditcard.year.to_s[2,2] unless creditcard.year.blank?
172
- card_id_code = (creditcard.verification_value.blank? ? nil : "1")
169
+ exp_month = sprintf('%.2i', creditcard.month) unless creditcard.month.blank?
170
+ exp_year = creditcard.year.to_s[2, 2] unless creditcard.year.blank?
171
+ card_id_code = (creditcard.verification_value.blank? ? nil : '1')
173
172
 
174
173
  params.update(
175
- :CardNumber => creditcard.number,
176
- :CardExpMonth => exp_month,
177
- :CardExpYear => exp_year,
178
- :CardIDCode => card_id_code,
179
- :CardIDNumber => creditcard.verification_value
174
+ CardNumber: creditcard.number,
175
+ CardExpMonth: exp_month,
176
+ CardExpYear: exp_year,
177
+ CardIDCode: card_id_code,
178
+ CardIDNumber: creditcard.verification_value
180
179
  )
181
180
  end
182
181
 
183
- if(address = (options[:billing_address] || options[:address]))
182
+ if (address = (options[:billing_address] || options[:address]))
184
183
  params[:Bname] = address[:name] || creditcard.name
185
184
  params[:Baddress1] = address[:address1] unless address[:address1].blank?
186
185
  params[:Baddress2] = address[:address2] unless address[:address2].blank?
@@ -206,11 +205,12 @@ module ActiveMerchant #:nodoc:
206
205
  end
207
206
 
208
207
  def message_from(response)
209
- if response[:approved] == "APPROVED"
208
+ if response[:approved] == 'APPROVED'
210
209
  return SUCCESS_MESSAGE
211
210
  else
212
211
  return FAILURE_MESSAGE if response[:errmsg].blank?
213
- return response[:errmsg].gsub(/[^\w]/, ' ').split.join(" ").capitalize
212
+
213
+ return response[:errmsg].gsub(/[^\w]/, ' ').split.join(' ').capitalize
214
214
  end
215
215
  end
216
216
 
@@ -220,7 +220,7 @@ module ActiveMerchant #:nodoc:
220
220
  end
221
221
 
222
222
  def build_authorization(response)
223
- [response[:orderid], response[:transrefnumber]].join(";")
223
+ [response[:orderid], response[:transrefnumber]].join(';')
224
224
  end
225
225
  end
226
226
  end