tanga_activemerchant 1.37.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +1202 -0
  3. data/CONTRIBUTORS +414 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +221 -0
  6. data/gem-public_cert.pem +20 -0
  7. data/lib/active_merchant/billing/avs_result.rb +98 -0
  8. data/lib/active_merchant/billing/base.rb +57 -0
  9. data/lib/active_merchant/billing/check.rb +69 -0
  10. data/lib/active_merchant/billing/credit_card.rb +283 -0
  11. data/lib/active_merchant/billing/credit_card_formatting.rb +21 -0
  12. data/lib/active_merchant/billing/credit_card_methods.rb +143 -0
  13. data/lib/active_merchant/billing/cvv_result.rb +38 -0
  14. data/lib/active_merchant/billing/expiry_date.rb +34 -0
  15. data/lib/active_merchant/billing/gateway.rb +181 -0
  16. data/lib/active_merchant/billing/gateways/authorize_net.rb +725 -0
  17. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +956 -0
  18. data/lib/active_merchant/billing/gateways/balanced.rb +468 -0
  19. data/lib/active_merchant/billing/gateways/banwire.rb +105 -0
  20. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +314 -0
  21. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +15 -0
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +393 -0
  23. data/lib/active_merchant/billing/gateways/beanstream.rb +169 -0
  24. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
  25. data/lib/active_merchant/billing/gateways/blue_pay.rb +501 -0
  26. data/lib/active_merchant/billing/gateways/bogus.rb +142 -0
  27. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
  28. data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +401 -0
  30. data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
  31. data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
  32. data/lib/active_merchant/billing/gateways/card_stream.rb +225 -0
  33. data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
  34. data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
  35. data/lib/active_merchant/billing/gateways/certo_direct.rb +277 -0
  36. data/lib/active_merchant/billing/gateways/cyber_source.rb +639 -0
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +591 -0
  38. data/lib/active_merchant/billing/gateways/efsnet.rb +230 -0
  39. data/lib/active_merchant/billing/gateways/elavon.rb +312 -0
  40. data/lib/active_merchant/billing/gateways/epay.rb +275 -0
  41. data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
  42. data/lib/active_merchant/billing/gateways/eway.rb +225 -0
  43. data/lib/active_merchant/billing/gateways/eway_managed.rb +291 -0
  44. data/lib/active_merchant/billing/gateways/eway_rapid.rb +320 -0
  45. data/lib/active_merchant/billing/gateways/exact.rb +218 -0
  46. data/lib/active_merchant/billing/gateways/fat_zebra.rb +173 -0
  47. data/lib/active_merchant/billing/gateways/federated_canada.rb +167 -0
  48. data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
  49. data/lib/active_merchant/billing/gateways/first_pay.rb +176 -0
  50. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
  51. data/lib/active_merchant/billing/gateways/garanti.rb +257 -0
  52. data/lib/active_merchant/billing/gateways/hdfc.rb +207 -0
  53. data/lib/active_merchant/billing/gateways/iats_payments.rb +35 -0
  54. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +249 -0
  55. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
  56. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
  57. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +66 -0
  58. data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
  59. data/lib/active_merchant/billing/gateways/instapay.rb +163 -0
  60. data/lib/active_merchant/billing/gateways/iridium.rb +262 -0
  61. data/lib/active_merchant/billing/gateways/itransact.rb +448 -0
  62. data/lib/active_merchant/billing/gateways/jetpay.rb +275 -0
  63. data/lib/active_merchant/billing/gateways/linkpoint.rb +447 -0
  64. data/lib/active_merchant/billing/gateways/litle.rb +554 -0
  65. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +176 -0
  66. data/lib/active_merchant/billing/gateways/merchant_one.rb +115 -0
  67. data/lib/active_merchant/billing/gateways/merchant_ware.rb +322 -0
  68. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +275 -0
  69. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +191 -0
  70. data/lib/active_merchant/billing/gateways/mercury.rb +311 -0
  71. data/lib/active_merchant/billing/gateways/metrics_global.rb +322 -0
  72. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
  73. data/lib/active_merchant/billing/gateways/migs.rb +265 -0
  74. data/lib/active_merchant/billing/gateways/modern_payments.rb +37 -0
  75. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +219 -0
  76. data/lib/active_merchant/billing/gateways/moneris.rb +244 -0
  77. data/lib/active_merchant/billing/gateways/moneris_us.rb +208 -0
  78. data/lib/active_merchant/billing/gateways/nab_transact.rb +277 -0
  79. data/lib/active_merchant/billing/gateways/net_registry.rb +193 -0
  80. data/lib/active_merchant/billing/gateways/netaxept.rb +181 -0
  81. data/lib/active_merchant/billing/gateways/netbilling.rb +197 -0
  82. data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
  83. data/lib/active_merchant/billing/gateways/nmi.rb +20 -0
  84. data/lib/active_merchant/billing/gateways/ogone.rb +421 -0
  85. data/lib/active_merchant/billing/gateways/optimal_payment.rb +297 -0
  86. data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +93 -0
  87. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
  88. data/lib/active_merchant/billing/gateways/orbital.rb +633 -0
  89. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +261 -0
  90. data/lib/active_merchant/billing/gateways/pay_junction.rb +396 -0
  91. data/lib/active_merchant/billing/gateways/pay_secure.rb +119 -0
  92. data/lib/active_merchant/billing/gateways/paybox_direct.rb +196 -0
  93. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +209 -0
  94. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +39 -0
  95. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
  96. data/lib/active_merchant/billing/gateways/payflow.rb +268 -0
  97. data/lib/active_merchant/billing/gateways/payflow_express.rb +224 -0
  98. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +15 -0
  99. data/lib/active_merchant/billing/gateways/payflow_uk.rb +21 -0
  100. data/lib/active_merchant/billing/gateways/payment_express.rb +353 -0
  101. data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
  102. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +670 -0
  103. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +61 -0
  104. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +248 -0
  105. data/lib/active_merchant/billing/gateways/paypal.rb +106 -0
  106. data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
  107. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
  108. data/lib/active_merchant/billing/gateways/paypal_express.rb +239 -0
  109. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
  110. data/lib/active_merchant/billing/gateways/paystation.rb +199 -0
  111. data/lib/active_merchant/billing/gateways/payway.rb +207 -0
  112. data/lib/active_merchant/billing/gateways/pin.rb +165 -0
  113. data/lib/active_merchant/billing/gateways/plugnpay.rb +294 -0
  114. data/lib/active_merchant/billing/gateways/psigate.rb +227 -0
  115. data/lib/active_merchant/billing/gateways/psl_card.rb +303 -0
  116. data/lib/active_merchant/billing/gateways/qbms.rb +292 -0
  117. data/lib/active_merchant/billing/gateways/quantum.rb +276 -0
  118. data/lib/active_merchant/billing/gateways/quickpay.rb +335 -0
  119. data/lib/active_merchant/billing/gateways/realex.rb +303 -0
  120. data/lib/active_merchant/billing/gateways/redsys.rb +394 -0
  121. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +93 -0
  122. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +114 -0
  123. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +102 -0
  124. data/lib/active_merchant/billing/gateways/sage.rb +152 -0
  125. data/lib/active_merchant/billing/gateways/sage_pay.rb +324 -0
  126. data/lib/active_merchant/billing/gateways/sallie_mae.rb +143 -0
  127. data/lib/active_merchant/billing/gateways/samurai.rb +118 -0
  128. data/lib/active_merchant/billing/gateways/secure_net.rb +261 -0
  129. data/lib/active_merchant/billing/gateways/secure_pay.rb +28 -0
  130. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +279 -0
  131. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +112 -0
  132. data/lib/active_merchant/billing/gateways/skip_jack.rb +453 -0
  133. data/lib/active_merchant/billing/gateways/smart_ps.rb +272 -0
  134. data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
  135. data/lib/active_merchant/billing/gateways/stripe.rb +316 -0
  136. data/lib/active_merchant/billing/gateways/trans_first.rb +126 -0
  137. data/lib/active_merchant/billing/gateways/transax.rb +23 -0
  138. data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
  139. data/lib/active_merchant/billing/gateways/trust_commerce.rb +421 -0
  140. data/lib/active_merchant/billing/gateways/usa_epay.rb +25 -0
  141. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1501 -0
  142. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +201 -0
  143. data/lib/active_merchant/billing/gateways/verifi.rb +232 -0
  144. data/lib/active_merchant/billing/gateways/viaklix.rb +189 -0
  145. data/lib/active_merchant/billing/gateways/vindicia.rb +361 -0
  146. data/lib/active_merchant/billing/gateways/webpay.rb +57 -0
  147. data/lib/active_merchant/billing/gateways/wirecard.rb +313 -0
  148. data/lib/active_merchant/billing/gateways/worldpay.rb +303 -0
  149. data/lib/active_merchant/billing/gateways.rb +17 -0
  150. data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +31 -0
  151. data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +186 -0
  152. data/lib/active_merchant/billing/integrations/a1agregator/status.rb +38 -0
  153. data/lib/active_merchant/billing/integrations/a1agregator.rb +26 -0
  154. data/lib/active_merchant/billing/integrations/action_view_helper.rb +73 -0
  155. data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +229 -0
  156. data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +340 -0
  157. data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +38 -0
  158. data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
  159. data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
  160. data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
  161. data/lib/active_merchant/billing/integrations/bogus.rb +23 -0
  162. data/lib/active_merchant/billing/integrations/chronopay/helper.rb +120 -0
  163. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +158 -0
  164. data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
  165. data/lib/active_merchant/billing/integrations/chronopay.rb +23 -0
  166. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
  167. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
  168. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
  169. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
  170. data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
  171. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
  172. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
  173. data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
  174. data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
  175. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
  176. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
  177. data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
  178. data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
  179. data/lib/active_merchant/billing/integrations/dwolla/common.rb +23 -0
  180. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +43 -0
  181. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +64 -0
  182. data/lib/active_merchant/billing/integrations/dwolla/return.rb +49 -0
  183. data/lib/active_merchant/billing/integrations/dwolla.rb +23 -0
  184. data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +34 -0
  185. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +84 -0
  186. data/lib/active_merchant/billing/integrations/e_payment_plans.rb +48 -0
  187. data/lib/active_merchant/billing/integrations/easy_pay/common.rb +40 -0
  188. data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +36 -0
  189. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +59 -0
  190. data/lib/active_merchant/billing/integrations/easy_pay.rb +30 -0
  191. data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
  192. data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
  193. data/lib/active_merchant/billing/integrations/epay.rb +21 -0
  194. data/lib/active_merchant/billing/integrations/first_data/helper.rb +61 -0
  195. data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
  196. data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
  197. data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
  198. data/lib/active_merchant/billing/integrations/gestpay/helper.rb +70 -0
  199. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +85 -0
  200. data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
  201. data/lib/active_merchant/billing/integrations/gestpay.rb +25 -0
  202. data/lib/active_merchant/billing/integrations/helper.rb +117 -0
  203. data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
  204. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +59 -0
  205. data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
  206. data/lib/active_merchant/billing/integrations/hi_trust.rb +27 -0
  207. data/lib/active_merchant/billing/integrations/ipay88/helper.rb +114 -0
  208. data/lib/active_merchant/billing/integrations/ipay88/return.rb +95 -0
  209. data/lib/active_merchant/billing/integrations/ipay88.rb +19 -0
  210. data/lib/active_merchant/billing/integrations/liqpay/helper.rb +43 -0
  211. data/lib/active_merchant/billing/integrations/liqpay/notification.rb +89 -0
  212. data/lib/active_merchant/billing/integrations/liqpay/return.rb +83 -0
  213. data/lib/active_merchant/billing/integrations/liqpay.rb +30 -0
  214. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
  215. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
  216. data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
  217. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +75 -0
  218. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
  219. data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
  220. data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
  221. data/lib/active_merchant/billing/integrations/nochex/notification.rb +94 -0
  222. data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
  223. data/lib/active_merchant/billing/integrations/nochex.rb +88 -0
  224. data/lib/active_merchant/billing/integrations/notification.rb +71 -0
  225. data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
  226. data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
  227. data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
  228. data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
  229. data/lib/active_merchant/billing/integrations/pay_fast/common.rb +42 -0
  230. data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +50 -0
  231. data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +134 -0
  232. data/lib/active_merchant/billing/integrations/pay_fast/return.rb +10 -0
  233. data/lib/active_merchant/billing/integrations/pay_fast.rb +70 -0
  234. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +116 -0
  235. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
  236. data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
  237. data/lib/active_merchant/billing/integrations/paypal/helper.rb +119 -0
  238. data/lib/active_merchant/billing/integrations/paypal/notification.rb +227 -0
  239. data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
  240. data/lib/active_merchant/billing/integrations/paypal.rb +39 -0
  241. data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +15 -0
  242. data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +20 -0
  243. data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +15 -0
  244. data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +28 -0
  245. data/lib/active_merchant/billing/integrations/paysbuy.rb +36 -0
  246. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
  247. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +165 -0
  248. data/lib/active_merchant/billing/integrations/payu_in/return.rb +36 -0
  249. data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
  250. data/lib/active_merchant/billing/integrations/platron/helper.rb +32 -0
  251. data/lib/active_merchant/billing/integrations/platron/notification.rb +113 -0
  252. data/lib/active_merchant/billing/integrations/platron.rb +28 -0
  253. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +112 -0
  254. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
  255. data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
  256. data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
  257. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +74 -0
  258. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +137 -0
  259. data/lib/active_merchant/billing/integrations/quickpay.rb +21 -0
  260. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
  261. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
  262. data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
  263. data/lib/active_merchant/billing/integrations/return.rb +42 -0
  264. data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
  265. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
  266. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
  267. data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
  268. data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
  269. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
  270. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +136 -0
  271. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
  272. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
  273. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
  274. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +91 -0
  275. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +139 -0
  276. data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
  277. data/lib/active_merchant/billing/integrations/two_checkout.rb +44 -0
  278. data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
  279. data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
  280. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +97 -0
  281. data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
  282. data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
  283. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +88 -0
  284. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
  285. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
  286. data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
  287. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
  288. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
  289. data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
  290. data/lib/active_merchant/billing/integrations/webmoney/common.rb +17 -0
  291. data/lib/active_merchant/billing/integrations/webmoney/helper.rb +40 -0
  292. data/lib/active_merchant/billing/integrations/webmoney/notification.rb +47 -0
  293. data/lib/active_merchant/billing/integrations/webmoney.rb +43 -0
  294. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +101 -0
  295. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
  296. data/lib/active_merchant/billing/integrations/world_pay.rb +34 -0
  297. data/lib/active_merchant/billing/integrations.rb +17 -0
  298. data/lib/active_merchant/billing/response.rb +77 -0
  299. data/lib/active_merchant/billing.rb +9 -0
  300. data/lib/active_merchant/version.rb +3 -0
  301. data/lib/active_merchant.rb +63 -0
  302. data/lib/activemerchant.rb +1 -0
  303. data/lib/support/gateway_support.rb +65 -0
  304. data/lib/support/outbound_hosts.rb +25 -0
  305. data/lib/support/ssl_verify.rb +93 -0
  306. metadata +506 -0
@@ -0,0 +1,421 @@
1
+ begin
2
+ require 'tclink'
3
+ rescue LoadError
4
+ # Falls back to an SSL post to TrustCommerce
5
+ end
6
+
7
+ module ActiveMerchant #:nodoc:
8
+ module Billing #:nodoc:
9
+ # TO USE:
10
+ # First, make sure you have everything setup correctly and all of your dependencies in place with:
11
+ #
12
+ # require 'rubygems'
13
+ # require 'active_merchant'
14
+ #
15
+ # ActiveMerchant expects amounts to be Integer values in cents
16
+ #
17
+ # tendollar = 1000
18
+ #
19
+ # Next, create a credit card object using a TC approved test card.
20
+ #
21
+ # creditcard = ActiveMerchant::Billing::CreditCard.new(
22
+ # :number => '4111111111111111',
23
+ # :month => 8,
24
+ # :year => 2006,
25
+ # :first_name => 'Longbob',
26
+ # :last_name => 'Longsen'
27
+ # )
28
+ #
29
+ # To finish setting up, create the active_merchant object you will be using, with the TrustCommerce gateway. If you have a
30
+ # functional TrustCommerce account, replace login and password with your account info. Otherwise the defaults will work for
31
+ # testing.
32
+ #
33
+ # gateway = ActiveMerchant::Billing::Base.gateway(:trust_commerce).new(:login => "TestMerchant", :password => "password")
34
+ #
35
+ # Now we are ready to process our transaction
36
+ #
37
+ # response = gateway.purchase(tendollar, creditcard)
38
+ #
39
+ # Sending a transaction to TrustCommerce with active_merchant returns a Response object, which consistently allows you to:
40
+ #
41
+ # 1) Check whether the transaction was successful
42
+ #
43
+ # response.success?
44
+ #
45
+ # 2) Retrieve any message returned by TrustCommerce, either a "transaction was successful" note or an explanation of why the
46
+ # transaction was rejected.
47
+ #
48
+ # response.message
49
+ #
50
+ # 3) Retrieve and store the unique transaction ID returned by Trust Commerece, for use in referencing the transaction in the future.
51
+ #
52
+ # response.params["transid"]
53
+ #
54
+ # For higher performance and failover with the TrustCommerceGateway you can install the TCLink library from http://www.trustcommerce.com/tclink.html.
55
+ # Follow the instructions available there to get it working on your system. ActiveMerchant will automatically use tclink if available.
56
+ #
57
+ # The TCLink library has the following added benefits:
58
+ # * Good transaction times. Transaction duration under 1.2 seconds are common.
59
+ # * Fail-over to geographically distributed servers for extreme reliability
60
+ #
61
+ # Once it is installed, you should be able to make sure
62
+ # that it is visible to your ruby install by opening irb and typing "require 'tclink'", which should return "true".
63
+ #
64
+ # This should be enough to get you started with Trust Commerce and active_merchant. For further information, review the methods
65
+ # below and the rest of active_merchant's documentation, as well as Trust Commerce's user and developer documentation.
66
+
67
+ class TrustCommerceGateway < Gateway
68
+ self.live_url = self.test_url = 'https://vault.trustcommerce.com/trans/'
69
+
70
+ SUCCESS_TYPES = ["approved", "accepted"]
71
+
72
+ DECLINE_CODES = {
73
+ "decline" => "The credit card was declined",
74
+ "avs" => "AVS failed; the address entered does not match the billing address on file at the bank",
75
+ "cvv" => "CVV failed; the number provided is not the correct verification number for the card",
76
+ "call" => "The card must be authorized manually over the phone",
77
+ "expiredcard" => "Issuer was not certified for card verification",
78
+ "carderror" => "Card number is invalid",
79
+ "authexpired" => "Attempt to postauth an expired (more than 14 days old) preauth",
80
+ "fraud" => "CrediGuard fraud score was below requested threshold",
81
+ "blacklist" => "CrediGuard blacklist value was triggered",
82
+ "velocity" => "CrediGuard velocity control value was triggered",
83
+ "dailylimit" => "Daily limit in transaction count or amount as been reached",
84
+ "weeklylimit" => "Weekly limit in transaction count or amount as been reached",
85
+ "monthlylimit" => "Monthly limit in transaction count or amount as been reached"
86
+ }
87
+
88
+ BADDATA_CODES = {
89
+ "missingfields" => "One or more parameters required for this transaction type were not sent",
90
+ "extrafields" => "Parameters not allowed for this transaction type were sent",
91
+ "badformat" => "A field was improperly formatted, such as non-digit characters in a number field",
92
+ "badlength" => "A field was longer or shorter than the server allows",
93
+ "merchantcantaccept" => "The merchant can't accept data passed in this field",
94
+ "mismatch" => "Data in one of the offending fields did not cross-check with the other offending field"
95
+ }
96
+
97
+ ERROR_CODES = {
98
+ "cantconnect" => "Couldn't connect to the TrustCommerce gateway",
99
+ "dnsfailure" => "The TCLink software was unable to resolve DNS hostnames",
100
+ "linkfailure" => "The connection was established, but was severed before the transaction could complete",
101
+ "failtoprocess" => "The bank servers are offline and unable to authorize transactions"
102
+ }
103
+
104
+ TEST_LOGIN = 'TestMerchant'
105
+ TEST_PASSWORD = 'password'
106
+
107
+ self.money_format = :cents
108
+ self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club, :jcb]
109
+ self.supported_countries = ['US']
110
+ self.homepage_url = 'http://www.trustcommerce.com/'
111
+ self.display_name = 'TrustCommerce'
112
+
113
+ def self.tclink?
114
+ defined?(TCLink)
115
+ end
116
+
117
+ # Creates a new TrustCommerceGateway
118
+ #
119
+ # The gateway requires that a valid login and password be passed
120
+ # in the +options+ hash.
121
+ #
122
+ # ==== Options
123
+ #
124
+ # * <tt>:login</tt> -- The TrustCommerce account login.
125
+ # * <tt>:password</tt> -- The TrustCommerce account password.
126
+ # * <tt>:test => +true+ or +false+</tt> -- Perform test transactions
127
+ #
128
+ # ==== Test Account Credentials
129
+ # * <tt>:login</tt> -- TestMerchant
130
+ # * <tt>:password</tt> -- password
131
+ def initialize(options = {})
132
+ requires!(options, :login, :password)
133
+
134
+ super
135
+ end
136
+
137
+ def tclink?
138
+ self.class.tclink?
139
+ end
140
+
141
+ def test?
142
+ ((@options[:login] == TEST_LOGIN && @options[:password] == TEST_PASSWORD) || super)
143
+ end
144
+
145
+ # authorize() is the first half of the preauth(authorize)/postauth(capture) model. The TC API docs call this
146
+ # preauth, we preserve active_merchant's nomenclature of authorize() for consistency with the rest of the library. This
147
+ # method simply checks to make sure funds are available for a transaction, and returns a transid that can be used later to
148
+ # postauthorize (capture) the funds.
149
+
150
+ def authorize(money, creditcard_or_billing_id, options = {})
151
+ parameters = {
152
+ :amount => amount(money),
153
+ }
154
+
155
+ add_order_id(parameters, options)
156
+ add_customer_data(parameters, options)
157
+ add_payment_source(parameters, creditcard_or_billing_id)
158
+ add_addresses(parameters, options)
159
+ commit('preauth', parameters)
160
+ end
161
+
162
+ # purchase() is a simple sale. This is one of the most common types of transactions, and is extremely simple. All that you need
163
+ # to process a purchase are an amount in cents or a money object and a creditcard object or billingid string.
164
+ def purchase(money, creditcard_or_billing_id, options = {})
165
+ parameters = {
166
+ :amount => amount(money),
167
+ }
168
+
169
+ add_order_id(parameters, options)
170
+ add_customer_data(parameters, options)
171
+ add_payment_source(parameters, creditcard_or_billing_id)
172
+ add_addresses(parameters, options)
173
+ commit('sale', parameters)
174
+ end
175
+
176
+ # capture() is the second half of the preauth(authorize)/postauth(capture) model. The TC API docs call this
177
+ # postauth, we preserve active_merchant's nomenclature of capture() for consistency with the rest of the library. To process
178
+ # a postauthorization with TC, you need an amount in cents or a money object, and a TC transid.
179
+ def capture(money, authorization, options = {})
180
+ parameters = {
181
+ :amount => amount(money),
182
+ :transid => authorization,
183
+ }
184
+
185
+ commit('postauth', parameters)
186
+ end
187
+
188
+ # refund() allows you to return money to a card that was previously billed. You need to supply the amount, in cents or a money object,
189
+ # that you want to refund, and a TC transid for the transaction that you are refunding.
190
+ def refund(money, identification, options = {})
191
+ parameters = {
192
+ :amount => amount(money),
193
+ :transid => identification
194
+ }
195
+
196
+ commit('credit', parameters)
197
+ end
198
+
199
+ def credit(money, identification, options = {})
200
+ deprecated CREDIT_DEPRECATION_MESSAGE
201
+ refund(money, identification, options)
202
+ end
203
+
204
+ # void() clears an existing authorization and releases the reserved fund
205
+ # s back to the cardholder. The TC API refers to this transaction as a
206
+ # reversal. After voiding, you will no longer be able to capture funds
207
+ # from this authorization. TrustCommerce seems to always return a status
208
+ # of "accepted" even if the transid you are trying to deauthorize has
209
+ # already been captured. Note: Your account needs to be configured by
210
+ # TrustCommerce to allow for reversal transactions before you can use this
211
+ # method.
212
+ #
213
+ # NOTE: AMEX preauth's cannot be reversed. If you want to clear it more
214
+ # quickly than the automatic expiration (7-10 days), you will have to
215
+ # capture it and then immediately issue a credit for the same amount
216
+ # which should clear the customers credit card with 48 hours according to
217
+ # TC.
218
+ def void(authorization, options = {})
219
+ parameters = {
220
+ :transid => authorization,
221
+ }
222
+
223
+ commit('reversal', parameters)
224
+ end
225
+
226
+ # recurring() a TrustCommerce account that is activated for Citatdel, TrustCommerce's
227
+ # hosted customer billing info database.
228
+ #
229
+ # Recurring billing uses the same TC action as a plain-vanilla 'store', but we have a separate method for clarity. It can be called
230
+ # like store, with the addition of a required 'periodicity' parameter:
231
+ #
232
+ # The parameter :periodicity should be specified as either :bimonthly, :monthly, :biweekly, :weekly, :yearly or :daily
233
+ #
234
+ # gateway.recurring(tendollar, creditcard, :periodicity => :weekly)
235
+ #
236
+ # You can optionally specify how long you want payments to continue using 'payments'
237
+ def recurring(money, creditcard, options = {})
238
+ requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily] )
239
+
240
+ cycle = case options[:periodicity]
241
+ when :monthly
242
+ '1m'
243
+ when :bimonthly
244
+ '2m'
245
+ when :weekly
246
+ '1w'
247
+ when :biweekly
248
+ '2w'
249
+ when :yearly
250
+ '1y'
251
+ when :daily
252
+ '1d'
253
+ end
254
+
255
+ parameters = {
256
+ :amount => amount(money),
257
+ :cycle => cycle,
258
+ :verify => options[:verify] || 'y',
259
+ :billingid => options[:billingid] || nil,
260
+ :payments => options[:payments] || nil,
261
+ }
262
+
263
+ add_creditcard(parameters, creditcard)
264
+
265
+ commit('store', parameters)
266
+ end
267
+
268
+ # store() requires a TrustCommerce account that is activated for Citatdel. You can call it with a credit card and a billing ID
269
+ # you would like to use to reference the stored credit card info for future captures. Use 'verify' to specify whether you want
270
+ # to simply store the card in the DB, or you want TC to verify the data first.
271
+
272
+ def store(creditcard, options = {})
273
+ parameters = {
274
+ :verify => options[:verify] || 'y',
275
+ :billingid => options[:billingid] || options[:billing_id] || nil,
276
+ }
277
+
278
+ add_creditcard(parameters, creditcard)
279
+ add_addresses(parameters, options)
280
+ commit('store', parameters)
281
+ end
282
+
283
+ # To unstore a creditcard stored in Citadel using store() or recurring(), all that is required is the billing id. When you run
284
+ # unstore() the information will be removed and a Response object will be returned indicating the success of the action.
285
+ def unstore(identification, options = {})
286
+ parameters = {
287
+ :billingid => identification,
288
+ }
289
+
290
+ commit('unstore', parameters)
291
+ end
292
+
293
+ private
294
+ def add_payment_source(params, source)
295
+ if source.is_a?(String)
296
+ add_billing_id(params, source)
297
+ else
298
+ add_creditcard(params, source)
299
+ end
300
+ end
301
+
302
+ def expdate(creditcard)
303
+ year = sprintf("%.4i", creditcard.year)
304
+ month = sprintf("%.2i", creditcard.month)
305
+
306
+ "#{month}#{year[-2..-1]}"
307
+ end
308
+
309
+ def add_creditcard(params, creditcard)
310
+ params[:media] = "cc"
311
+ params[:name] = creditcard.name
312
+ params[:cc] = creditcard.number
313
+ params[:exp] = expdate(creditcard)
314
+ params[:cvv] = creditcard.verification_value if creditcard.verification_value?
315
+ end
316
+
317
+ def add_order_id(params, options)
318
+ params[:ticket] = options[:order_id] unless options[:order_id].blank?
319
+ end
320
+
321
+ def add_billing_id(params, billingid)
322
+ params[:billingid] = billingid
323
+ end
324
+
325
+ def add_customer_data(params, options)
326
+ params[:email] = options[:email] unless options[:email].blank?
327
+ params[:ip] = options[:ip] unless options[:ip].blank?
328
+ end
329
+
330
+ def add_addresses(params, options)
331
+ address = options[:billing_address] || options[:address]
332
+
333
+ if address
334
+ params[:address1] = address[:address1] unless address[:address1].blank?
335
+ params[:address2] = address[:address2] unless address[:address2].blank?
336
+ params[:city] = address[:city] unless address[:city].blank?
337
+ params[:state] = address[:state] unless address[:state].blank?
338
+ params[:zip] = address[:zip] unless address[:zip].blank?
339
+ params[:country] = address[:country] unless address[:country].blank?
340
+ params[:avs] = 'n'
341
+ end
342
+
343
+ if shipping_address = options[:shipping_address]
344
+ params[:shipto_name] = shipping_address[:name] unless shipping_address[:name].blank?
345
+ params[:shipto_address1] = shipping_address[:address1] unless shipping_address[:address1].blank?
346
+ params[:shipto_address2] = shipping_address[:address2] unless shipping_address[:address2].blank?
347
+ params[:shipto_city] = shipping_address[:city] unless shipping_address[:city].blank?
348
+ params[:shipto_state] = shipping_address[:state] unless shipping_address[:state].blank?
349
+ params[:shipto_zip] = shipping_address[:zip] unless shipping_address[:zip].blank?
350
+ params[:shipto_country] = shipping_address[:country] unless shipping_address[:country].blank?
351
+ end
352
+ end
353
+
354
+ def clean_and_stringify_params(parameters)
355
+ # TCLink wants us to send a hash with string keys, and activemerchant pushes everything around with
356
+ # symbol keys. Before sending our input to TCLink, we convert all our keys to strings and dump the symbol keys.
357
+ # We also remove any pairs with nil values, as these confuse TCLink.
358
+ parameters.keys.reverse.each do |key|
359
+ if parameters[key]
360
+ parameters[key.to_s] = parameters[key]
361
+ end
362
+ parameters.delete(key)
363
+ end
364
+ end
365
+
366
+ def post_data(parameters)
367
+ parameters.collect { |key, value| "#{key}=#{ CGI.escape(value.to_s)}" }.join("&")
368
+ end
369
+
370
+ def commit(action, parameters)
371
+ parameters[:custid] = @options[:login]
372
+ parameters[:password] = @options[:password]
373
+ parameters[:demo] = test? ? 'y' : 'n'
374
+ parameters[:action] = action
375
+
376
+ clean_and_stringify_params(parameters)
377
+
378
+ data = if tclink?
379
+ TCLink.send(parameters)
380
+ else
381
+ parse( ssl_post(self.live_url, post_data(parameters)) )
382
+ end
383
+
384
+ # to be considered successful, transaction status must be either "approved" or "accepted"
385
+ success = SUCCESS_TYPES.include?(data["status"])
386
+ message = message_from(data)
387
+ Response.new(success, message, data,
388
+ :test => test?,
389
+ :authorization => data["transid"],
390
+ :cvv_result => data["cvv"],
391
+ :avs_result => { :code => data["avs"] }
392
+ )
393
+ end
394
+
395
+ def parse(body)
396
+ results = {}
397
+
398
+ body.split(/\n/).each do |pair|
399
+ key,val = pair.split(/=/)
400
+ results[key] = val
401
+ end
402
+
403
+ results
404
+ end
405
+
406
+ def message_from(data)
407
+ status = case data["status"]
408
+ when "decline"
409
+ return DECLINE_CODES[data["declinetype"]]
410
+ when "baddata"
411
+ return BADDATA_CODES[data["error"]]
412
+ when "error"
413
+ return ERROR_CODES[data["errortype"]]
414
+ else
415
+ return "The transaction was successful"
416
+ end
417
+ end
418
+
419
+ end
420
+ end
421
+ end
@@ -0,0 +1,25 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ ##
4
+ # Delegates to the appropriate gateway, either the Transaction or Advanced
5
+ # depending on options passed to new.
6
+ #
7
+ class UsaEpayGateway < Gateway
8
+
9
+ self.abstract_class = true
10
+
11
+ ##
12
+ # Creates an instance of UsaEpayTransactionGateway by default, but if
13
+ # :software id or :live_url are passed in the options hash it will
14
+ # create an instance of UsaEpayAdvancedGateway.
15
+ #
16
+ def self.new(options={})
17
+ unless options.has_key?(:software_id) || options.has_key?(:live_url)
18
+ UsaEpayTransactionGateway.new(options)
19
+ else
20
+ UsaEpayAdvancedGateway.new(options)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end