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,176 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class MerchantESolutionsGateway < Gateway
4
+ self.test_url = 'https://cert.merchante-solutions.com/mes-api/tridentApi'
5
+ self.live_url = 'https://api.merchante-solutions.com/mes-api/tridentApi'
6
+
7
+ # The countries the gateway supports merchants from as 2 digit ISO country codes
8
+ self.supported_countries = ['US']
9
+
10
+ # The card types supported by the payment gateway
11
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb]
12
+
13
+ # The homepage URL of the gateway
14
+ self.homepage_url = 'http://www.merchante-solutions.com/'
15
+
16
+ # The name of the gateway
17
+ self.display_name = 'Merchant e-Solutions'
18
+
19
+ def initialize(options = {})
20
+ requires!(options, :login, :password)
21
+ super
22
+ end
23
+
24
+ def authorize(money, creditcard_or_card_id, options = {})
25
+ post = {}
26
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
27
+ post[:moto_ecommerce_ind] = options[:moto_ecommerce_ind] if options.has_key?(:moto_ecommerce_ind)
28
+ add_invoice(post, options)
29
+ add_payment_source(post, creditcard_or_card_id, options)
30
+ add_address(post, options)
31
+ commit('P', money, post)
32
+ end
33
+
34
+ def purchase(money, creditcard_or_card_id, options = {})
35
+ post = {}
36
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
37
+ post[:moto_ecommerce_ind] = options[:moto_ecommerce_ind] if options.has_key?(:moto_ecommerce_ind)
38
+ add_invoice(post, options)
39
+ add_payment_source(post, creditcard_or_card_id, options)
40
+ add_address(post, options)
41
+ commit('D', money, post)
42
+ end
43
+
44
+ def capture(money, transaction_id, options = {})
45
+ post ={}
46
+ post[:transaction_id] = transaction_id
47
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
48
+ commit('S', money, post)
49
+ end
50
+
51
+ def store(creditcard, options = {})
52
+ post = {}
53
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
54
+ add_creditcard(post, creditcard, options)
55
+ commit('T', nil, post)
56
+ end
57
+
58
+ def unstore(card_id, options = {})
59
+ post = {}
60
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
61
+ post[:card_id] = card_id
62
+ commit('X', nil, post)
63
+ end
64
+
65
+ def refund(money, identification, options = {})
66
+ post = {}
67
+ post[:transaction_id] = identification
68
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
69
+ options.delete(:customer)
70
+ options.delete(:billing_address)
71
+ commit('U', money, options.merge(post))
72
+ end
73
+
74
+ def credit(money, creditcard_or_card_id, options = {})
75
+ post = {}
76
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
77
+ add_invoice(post, options)
78
+ add_payment_source(post, creditcard_or_card_id, options)
79
+ commit('C', money, post)
80
+ end
81
+
82
+ def void(transaction_id, options = {})
83
+ post = {}
84
+ post[:transaction_id] = transaction_id
85
+ post[:client_reference_number] = options[:customer] if options.has_key?(:customer)
86
+ options.delete(:customer)
87
+ options.delete(:billing_address)
88
+ commit('V', nil, options.merge(post))
89
+ end
90
+
91
+ private
92
+
93
+ def add_address(post, options)
94
+ if address = options[:billing_address] || options[:address]
95
+ post[:cardholder_street_address] = address[:address1].to_s.gsub(/[^\w.]/, '+')
96
+ post[:cardholder_zip] = address[:zip].to_s
97
+ end
98
+ end
99
+
100
+ def add_invoice(post, options)
101
+ if options.has_key? :order_id
102
+ post[:invoice_number] = options[:order_id].to_s.gsub(/[^\w.]/, '')
103
+ end
104
+ end
105
+
106
+ def add_payment_source(post, creditcard_or_card_id, options)
107
+ if creditcard_or_card_id.is_a?(String)
108
+ # using stored card
109
+ post[:card_id] = creditcard_or_card_id
110
+ post[:card_exp_date] = options[:expiration_date] if options[:expiration_date]
111
+ else
112
+ # card info is provided
113
+ add_creditcard(post, creditcard_or_card_id, options)
114
+ end
115
+ end
116
+
117
+ def add_creditcard(post, creditcard, options)
118
+ post[:card_number] = creditcard.number
119
+ post[:cvv2] = creditcard.verification_value if creditcard.verification_value?
120
+ post[:card_exp_date] = expdate(creditcard)
121
+ end
122
+
123
+ def parse(body)
124
+ results = {}
125
+ body.split(/&/).each do |pair|
126
+ key,val = pair.split(/=/)
127
+ results[key] = val
128
+ end
129
+ results
130
+ end
131
+
132
+ def commit(action, money, parameters)
133
+ url = test? ? self.test_url : self.live_url
134
+ parameters[:transaction_amount] = amount(money) if money unless action == 'V'
135
+
136
+
137
+ response = begin
138
+ parse( ssl_post(url, post_data(action,parameters)) )
139
+ rescue ActiveMerchant::ResponseError => e
140
+ { "error_code" => "404", "auth_response_text" => e.to_s }
141
+ end
142
+
143
+ Response.new(response["error_code"] == "000", message_from(response), response,
144
+ :authorization => response["transaction_id"],
145
+ :test => test?,
146
+ :cvv_result => response["cvv2_result"],
147
+ :avs_result => { :code => response["avs_result"] }
148
+ )
149
+ end
150
+
151
+ def expdate(creditcard)
152
+ year = sprintf("%.4i", creditcard.year)
153
+ month = sprintf("%.2i", creditcard.month)
154
+ "#{month}#{year[-2..-1]}"
155
+ end
156
+
157
+ def message_from(response)
158
+ if response["error_code"] == "000"
159
+ "This transaction has been approved"
160
+ else
161
+ response["auth_response_text"]
162
+ end
163
+ end
164
+
165
+ def post_data(action, parameters = {})
166
+ post = {}
167
+ post[:profile_id] = @options[:login]
168
+ post[:profile_key] = @options[:password]
169
+ post[:transaction_type] = action if action
170
+
171
+ request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join("&")
172
+ request
173
+ end
174
+ end
175
+ end
176
+ end
@@ -0,0 +1,115 @@
1
+ require "cgi"
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class MerchantOneGateway < Gateway
6
+
7
+ class MerchantOneSslConnection < ActiveMerchant::Connection
8
+ def configure_ssl(http)
9
+ super(http)
10
+ http.use_ssl = true
11
+ http.ssl_version = :SSLv3
12
+ end
13
+ end
14
+
15
+ BASE_URL = 'https://secure.merchantonegateway.com/api/transact.php'
16
+
17
+ self.supported_countries = ['US']
18
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
19
+ self.homepage_url = 'http://merchantone.com/'
20
+ self.display_name = 'Merchant One Gateway'
21
+ self.money_format = :dollars
22
+
23
+ def initialize(options = {})
24
+ requires!(options, :username, :password)
25
+ super
26
+ end
27
+
28
+ def authorize(money, creditcard, options = {})
29
+ post = {}
30
+ add_customer_data(post, options)
31
+ add_creditcard(post, creditcard)
32
+ add_address(post, creditcard, options)
33
+ add_customer_data(post, options)
34
+ add_amount(post, money, options)
35
+ commit('auth', money, post)
36
+ end
37
+
38
+ def purchase(money, creditcard, options = {})
39
+ post = {}
40
+ add_customer_data(post, options)
41
+ add_creditcard(post, creditcard)
42
+ add_address(post, creditcard, options)
43
+ add_customer_data(post, options)
44
+ add_amount(post, money, options)
45
+ commit('sale', money, post)
46
+ end
47
+
48
+ def capture(money, authorization, options = {})
49
+ post = {}
50
+ post.merge!(:transactionid => authorization)
51
+ add_amount(post, money, options)
52
+ commit('capture', money, post)
53
+ end
54
+
55
+ def new_connection(endpoint)
56
+ MerchantOneSslConnection.new(endpoint)
57
+ end
58
+
59
+ private
60
+
61
+ def add_customer_data(post, options)
62
+ post['firstname'] = options[:billing_address][:first_name]
63
+ post['lastname'] = options[:billing_address][:last_name]
64
+ end
65
+
66
+ def add_amount(post, money, options)
67
+ post['amount'] = amount(money)
68
+ end
69
+
70
+ def add_address(post, creditcard, options)
71
+ post['address1'] = options[:billing_address][:address1]
72
+ post['city'] = options[:billing_address][:city]
73
+ post['state'] = options[:billing_address][:state]
74
+ post['zip'] = options[:billing_address][:zip]
75
+ post['country'] = options[:billing_address][:country]
76
+ end
77
+
78
+ def add_creditcard(post, creditcard)
79
+ post['cvv'] = creditcard.verification_value
80
+ post['ccnumber'] = creditcard.number
81
+ post['ccexp'] = "#{sprintf("%02d", creditcard.month)}#{"#{creditcard.year}"[-2, 2]}"
82
+ end
83
+
84
+ def commit(action, money, parameters={})
85
+ parameters['username'] = @options[:username]
86
+ parameters['password'] = @options[:password]
87
+ parse(ssl_post(BASE_URL,post_data(action, parameters)))
88
+ end
89
+
90
+ def post_data(action, parameters = {})
91
+ parameters.merge!({:type => action})
92
+ ret = ""
93
+ for key in parameters.keys
94
+ ret += "#{key}=#{CGI.escape(parameters[key].to_s)}"
95
+ if key != parameters.keys.last
96
+ ret += "&"
97
+ end
98
+ end
99
+ ret.to_s
100
+ end
101
+
102
+ def parse(data)
103
+ responses = CGI.parse(data).inject({}){|h,(k, v)| h[k] = v.first; h}
104
+ Response.new(
105
+ (responses["response"].to_i == 1),
106
+ responses["responsetext"],
107
+ responses,
108
+ :test => test?,
109
+ :authorization => responses["transactionid"]
110
+ )
111
+ end
112
+ end
113
+ end
114
+ end
115
+
@@ -0,0 +1,322 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class MerchantWareGateway < Gateway
4
+ class_attribute :v4_live_url
5
+
6
+ self.live_url = self.test_url = 'https://ps1.merchantware.net/MerchantWARE/ws/RetailTransaction/TXRetail.asmx'
7
+ self.v4_live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
8
+
9
+ self.supported_countries = ['US']
10
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.homepage_url = 'http://merchantwarehouse.com/merchantware'
12
+ self.display_name = 'MerchantWARE'
13
+
14
+ ENV_NAMESPACES = { "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
15
+ "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
16
+ "xmlns:env" => "http://schemas.xmlsoap.org/soap/envelope/"
17
+ }
18
+ ENV_NAMESPACES_V4 = { "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
19
+ "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
20
+ "xmlns:soap" => "http://schemas.xmlsoap.org/soap/envelope/"
21
+ }
22
+
23
+ TX_NAMESPACE = "http://merchantwarehouse.com/MerchantWARE/Client/TransactionRetail"
24
+ TX_NAMESPACE_V4 = "http://schemas.merchantwarehouse.com/merchantware/40/Credit/"
25
+
26
+ ACTIONS = {
27
+ :purchase => "IssueKeyedSale",
28
+ :authorize => "IssueKeyedPreAuth",
29
+ :capture => "IssuePostAuth",
30
+ :void => "VoidPreAuthorization",
31
+ :credit => "IssueKeyedRefund",
32
+ :reference_credit => "IssueRefundByReference"
33
+ }
34
+
35
+ # Creates a new MerchantWareGateway
36
+ #
37
+ # The gateway requires that a valid login, password, and name be passed
38
+ # in the +options+ hash.
39
+ #
40
+ # ==== Options
41
+ #
42
+ # * <tt>:login</tt> - The MerchantWARE SiteID.
43
+ # * <tt>:password</tt> - The MerchantWARE Key.
44
+ # * <tt>:name</tt> - The MerchantWARE Name.
45
+ def initialize(options = {})
46
+ requires!(options, :login, :password, :name)
47
+ super
48
+ end
49
+
50
+ # Authorize a credit card for a given amount.
51
+ #
52
+ # ==== Parameters
53
+ # * <tt>money</tt> - The amount to be authorized as an Integer value in cents.
54
+ # * <tt>credit_card</tt> - The CreditCard details for the transaction.
55
+ # * <tt>options</tt>
56
+ # * <tt>:order_id</tt> - A unique reference for this order (required).
57
+ # * <tt>:billing_address</tt> - The billing address for the cardholder.
58
+ def authorize(money, credit_card, options = {})
59
+ request = build_purchase_request(:authorize, money, credit_card, options)
60
+ commit(:authorize, request)
61
+ end
62
+
63
+ # Authorize and immediately capture funds from a credit card.
64
+ #
65
+ # ==== Parameters
66
+ # * <tt>money</tt> - The amount to be authorized as anInteger value in cents.
67
+ # * <tt>credit_card</tt> - The CreditCard details for the transaction.
68
+ # * <tt>options</tt>
69
+ # * <tt>:order_id</tt> - A unique reference for this order (required).
70
+ # * <tt>:billing_address</tt> - The billing address for the cardholder.
71
+ def purchase(money, credit_card, options = {})
72
+ request = build_purchase_request(:purchase, money, credit_card, options)
73
+ commit(:purchase, request)
74
+ end
75
+
76
+ # Capture authorized funds from a credit card.
77
+ #
78
+ # ==== Parameters
79
+ # * <tt>money</tt> - The amount to be captured as anInteger value in cents.
80
+ # * <tt>authorization</tt> - The authorization string returned from the initial authorization.
81
+ def capture(money, authorization, options = {})
82
+ request = build_capture_request(:capture, money, authorization, options)
83
+ commit(:capture, request)
84
+ end
85
+
86
+ # Void a transaction.
87
+ #
88
+ # ==== Parameters
89
+ # * <tt>authorization</tt> - The authorization string returned from the initial authorization or purchase.
90
+ def void(authorization, options = {})
91
+ reference, options[:order_id] = split_reference(authorization)
92
+ request = v4_soap_request(:void) do |xml|
93
+ add_reference_token(xml, reference)
94
+ end
95
+ commit(:void, request, true)
96
+ end
97
+
98
+ # Refund an amount back a cardholder
99
+ #
100
+ # ==== Parameters
101
+ #
102
+ # * <tt>money</tt> - The amount to be refunded as an Integer value in cents.
103
+ # * <tt>identification</tt> - The credit card you want to refund or the authorization for the existing transaction you are refunding.
104
+ # * <tt>options</tt>
105
+ # * <tt>:order_id</tt> - A unique reference for this order (required when performing a non-referenced credit)
106
+ def credit(money, identification, options = {})
107
+ if identification.is_a?(String)
108
+ deprecated CREDIT_DEPRECATION_MESSAGE
109
+ refund(money, identification, options)
110
+ else
111
+ perform_credit(money, identification, options)
112
+ end
113
+ end
114
+
115
+ def refund(money, reference, options = {})
116
+ perform_reference_credit(money, reference, options)
117
+ end
118
+
119
+ private
120
+
121
+ def soap_request(action)
122
+ xml = Builder::XmlMarkup.new :indent => 2
123
+ xml.instruct!
124
+ xml.tag! "env:Envelope", ENV_NAMESPACES do
125
+ xml.tag! "env:Body" do
126
+ xml.tag! ACTIONS[action], "xmlns" => TX_NAMESPACE do
127
+ add_credentials(xml)
128
+ yield xml
129
+ end
130
+ end
131
+ end
132
+ xml.target!
133
+ end
134
+
135
+ def v4_soap_request(action)
136
+ xml = Builder::XmlMarkup.new :indent => 2
137
+ xml.instruct!
138
+ xml.tag! "soap:Envelope", ENV_NAMESPACES_V4 do
139
+ xml.tag! "soap:Body" do
140
+ xml.tag! ACTIONS[:void], "xmlns" => TX_NAMESPACE_V4 do
141
+ xml.tag! "merchantName", @options[:name]
142
+ xml.tag! "merchantSiteId", @options[:login]
143
+ xml.tag! "merchantKey", @options[:password]
144
+ yield xml
145
+ end
146
+ end
147
+ end
148
+ xml.target!
149
+ end
150
+
151
+ def build_purchase_request(action, money, credit_card, options)
152
+ requires!(options, :order_id)
153
+
154
+ request = soap_request(action) do |xml|
155
+ add_invoice(xml, options)
156
+ add_amount(xml, money)
157
+ add_credit_card(xml, credit_card)
158
+ add_address(xml, options)
159
+ end
160
+ end
161
+
162
+ def build_capture_request(action, money, identification, options)
163
+ reference, options[:order_id] = split_reference(identification)
164
+
165
+ request = soap_request(action) do |xml|
166
+ add_reference(xml, reference)
167
+ add_invoice(xml, options)
168
+ add_amount(xml, money)
169
+ end
170
+ end
171
+
172
+ def perform_reference_credit(money, identification, options)
173
+ reference, options[:order_id] = split_reference(identification)
174
+
175
+ request = soap_request(:reference_credit) do |xml|
176
+ add_reference(xml, reference)
177
+ add_invoice(xml, options)
178
+ add_amount(xml, money, "strOverrideAmount")
179
+ end
180
+
181
+ commit(:reference_credit, request)
182
+ end
183
+
184
+ def perform_credit(money, credit_card, options)
185
+ requires!(options, :order_id)
186
+
187
+ request = soap_request(:credit) do |xml|
188
+ add_invoice(xml, options)
189
+ add_amount(xml, money)
190
+ add_credit_card(xml, credit_card)
191
+ end
192
+
193
+ commit(:credit, request)
194
+ end
195
+
196
+ def add_credentials(xml)
197
+ xml.tag! "strSiteId", @options[:login]
198
+ xml.tag! "strKey", @options[:password]
199
+ xml.tag! "strName", @options[:name]
200
+ end
201
+
202
+ def expdate(credit_card)
203
+ year = sprintf("%.4i", credit_card.year)
204
+ month = sprintf("%.2i", credit_card.month)
205
+
206
+ "#{month}#{year[-2..-1]}"
207
+ end
208
+
209
+ def add_invoice(xml, options)
210
+ xml.tag! "strOrderNumber", options[:order_id].to_s.gsub(/[^\w]/, '').slice(0, 25)
211
+ end
212
+
213
+ def add_amount(xml, money, tag = "strAmount")
214
+ xml.tag! tag, amount(money)
215
+ end
216
+
217
+ def add_reference(xml, reference)
218
+ xml.tag! "strReferenceCode", reference
219
+ end
220
+
221
+ def add_reference_token(xml, reference)
222
+ xml.tag! "token", reference
223
+ end
224
+
225
+ def add_address(xml, options)
226
+ if address = options[:billing_address] || options[:address]
227
+ xml.tag! "strAVSStreetAddress", address[:address1]
228
+ xml.tag! "strAVSZipCode", address[:zip]
229
+ end
230
+ end
231
+
232
+ def add_credit_card(xml, credit_card)
233
+ xml.tag! "strPAN", credit_card.number
234
+ xml.tag! "strExpDate", expdate(credit_card)
235
+ xml.tag! "strCardHolder", credit_card.name
236
+ xml.tag! "strCVCode", credit_card.verification_value if credit_card.verification_value?
237
+ end
238
+
239
+ def split_reference(reference)
240
+ reference.to_s.split(";")
241
+ end
242
+
243
+ def parse(action, data)
244
+ response = {}
245
+ xml = REXML::Document.new(data)
246
+
247
+ root = REXML::XPath.first(xml, "//#{ACTIONS[action]}Response/#{ACTIONS[action]}Result")
248
+
249
+ root.elements.each do |element|
250
+ response[element.name] = element.text
251
+ end
252
+
253
+ status, code, message = response["ApprovalStatus"].split(";")
254
+ response[:status] = status
255
+
256
+ if response[:success] = status == "APPROVED"
257
+ response[:message] = status
258
+ else
259
+ response[:message] = message
260
+ response[:failure_code] = code
261
+ end
262
+
263
+ response
264
+ end
265
+
266
+ def parse_error(http_response)
267
+ response = {}
268
+ response[:http_code] = http_response.code
269
+ response[:http_message] = http_response.message
270
+ response[:success] = false
271
+
272
+ document = REXML::Document.new(http_response.body)
273
+
274
+ node = REXML::XPath.first(document, "//soap:Fault")
275
+
276
+ node.elements.each do |element|
277
+ response[element.name] = element.text
278
+ end
279
+
280
+ response[:message] = response["faultstring"].to_s.gsub("\n", " ")
281
+ response
282
+ rescue REXML::ParseException => e
283
+ response[:http_body] = http_response.body
284
+ response[:message] = "Failed to parse the failed response"
285
+ response
286
+ end
287
+
288
+ def soap_action(action, v4 = false)
289
+ v4 ? "#{TX_NAMESPACE_V4}#{ACTIONS[action]}" : "#{TX_NAMESPACE}/#{ACTIONS[action]}"
290
+ end
291
+
292
+ def url(v4 = false)
293
+ v4 ? v4_live_url : live_url
294
+ end
295
+
296
+ def commit(action, request, v4 = false)
297
+ begin
298
+ data = ssl_post(url(v4), request,
299
+ "Content-Type" => 'text/xml; charset=utf-8',
300
+ "SOAPAction" => soap_action(action, v4)
301
+ )
302
+ response = parse(action, data)
303
+ rescue ActiveMerchant::ResponseError => e
304
+ response = parse_error(e.response)
305
+ end
306
+
307
+ Response.new(response[:success], response[:message], response,
308
+ :test => test?,
309
+ :authorization => authorization_from(response),
310
+ :avs_result => { :code => response["AVSResponse"] },
311
+ :cvv_result => response["CVResponse"]
312
+ )
313
+ end
314
+
315
+ def authorization_from(response)
316
+ if response[:success]
317
+ [ response["ReferenceID"], response["OrderNumber"] ].join(";")
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end