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,448 @@
1
+ require 'nokogiri'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ # iTransact, Inc. is an authorized reseller of the PaymentClearing gateway. If your merchant service provider uses PaymentClearing.com to process payments, you can use this module.
6
+ #
7
+ #
8
+ # Please note, the username and API Access Key are not what you use to log into the Merchant Control Panel.
9
+ #
10
+ # ==== How to get your GatewayID and API Access Key
11
+ #
12
+ # 1. If you don't already have a Gateway Account, go to http://www.itransact.com/merchant/test.html to sign up.
13
+ # 2. Go to http://support.paymentclearing.com and login or register, if necessary.
14
+ # 3. Click on "Submit a Ticket."
15
+ # 4. Select "Merchant Support" as the department and click "Next"
16
+ # 5. Enter *both* your company name and GatewayID. Put "API Access Key" in the subject. In the body, you can request a username, but it may already be in use.
17
+ #
18
+ # ==== Initialization
19
+ #
20
+ # Once you have the username, API Access Key, and your GatewayId, you're ready
21
+ # to begin. You initialize the Gateway like so:
22
+ #
23
+ # gateway = ActiveMerchant::Billing::ItransactGateway.new(
24
+ # :login => "#{THE_USERNAME}",
25
+ # :password => "#{THE_API_ACCESS_KEY}",
26
+ # :gateway_id => "#{THE_GATEWAY_ID}"
27
+ # )
28
+ #
29
+ # ==== Important Notes
30
+ # 1. Recurring is not implemented
31
+ # 1. CreditTransactions are not implemented (these are credits not related to a previously run transaction).
32
+ # 1. TransactionStatus is not implemented
33
+ #
34
+ class ItransactGateway < Gateway
35
+ self.live_url = self.test_url = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
36
+
37
+ # The countries the gateway supports merchants from as 2 digit ISO country codes
38
+ self.supported_countries = ['US']
39
+
40
+ # The card types supported by the payment gateway
41
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
42
+
43
+ # The homepage URL of the gateway
44
+ self.homepage_url = 'http://www.itransact.com/'
45
+
46
+ # The name of the gateway
47
+ self.display_name = 'iTransact'
48
+
49
+ #
50
+ # Creates a new instance of the iTransact Gateway.
51
+ #
52
+ # ==== Parameters
53
+ # * <tt>options</tt> - A Hash of options
54
+ #
55
+ # ==== Options Hash
56
+ # * <tt>:login</tt> - A String containing your PaymentClearing assigned API Access Username
57
+ # * <tt>:password</tt> - A String containing your PaymentClearing assigned API Access Key
58
+ # * <tt>:gateway_id</tt> - A String containing your PaymentClearing assigned GatewayID
59
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Run *all* transactions with the 'TestMode' element set to 'TRUE'.
60
+ #
61
+ def initialize(options = {})
62
+ requires!(options, :login, :password, :gateway_id)
63
+ super
64
+ end
65
+
66
+ # Performs an authorize transaction. In PaymentClearing's documentation
67
+ # this is known as a "PreAuth" transaction.
68
+ #
69
+ # ==== Parameters
70
+ # * <tt>money</tt> - The amount to be captured. Should be an Integer amount in cents.
71
+ # * <tt>creditcard</tt> - The CreditCard details for the transaction
72
+ # * <tt>options</tt> - A Hash of options
73
+ #
74
+ # ==== Options Hash
75
+ # The standard options apply here (:order_id, :ip, :customer, :invoice, :merchant, :description, :email, :currency, :address, :billing_address, :shipping_address), as well as:
76
+ # * <tt>:order_items</tt> - An Array of Hash objects with the keys <tt>:description</tt>, <tt>:cost</tt> (in cents!), and <tt>:quantity</tt>. If this is provided, <tt>:description</tt> and <tt>money</tt> will be ignored.
77
+ # * <tt>:vendor_data</tt> - An Array of Hash objects with the keys being the name of the VendorData element and value being the value.
78
+ # * <tt>:send_customer_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendCustomerEmail' element set to 'TRUE' or 'FALSE'.
79
+ # * <tt>:send_merchant_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendMerchantEmail' element set to 'TRUE' or 'FALSE'.
80
+ # * <tt>:email_text</tt> - An Array of (up to ten (10)) String objects to be included in emails
81
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'TestMode' element set to 'TRUE' or 'FALSE'.
82
+ #
83
+ # ==== Examples
84
+ # response = gateway.authorize(1000, creditcard,
85
+ # :order_id => '1212', :address => {...}, :email => 'test@test.com',
86
+ # :order_items => [
87
+ # {:description => 'Line Item 1', :cost => '8.98', :quantity => '6'},
88
+ # {:description => 'Line Item 2', :cost => '6.99', :quantity => '4'}
89
+ # ],
90
+ # :vendor_data => [{'repId' => '1234567'}, {'customerId' => '9886'}],
91
+ # :send_customer_email => true,
92
+ # :send_merchant_email => true,
93
+ # :email_text => ['line1', 'line2', 'line3'],
94
+ # :test_mode => true
95
+ # )
96
+ #
97
+ def authorize(money, payment_source, options = {})
98
+ payload = Nokogiri::XML::Builder.new do |xml|
99
+ xml.AuthTransaction {
100
+ xml.Preauth
101
+ add_customer_data(xml, payment_source, options)
102
+ add_invoice(xml, money, options)
103
+ add_payment_source(xml, payment_source)
104
+ add_transaction_control(xml, options)
105
+ add_vendor_data(xml, options)
106
+ }
107
+ end.doc
108
+
109
+ commit(payload)
110
+ end
111
+
112
+ # Performs an authorize and capture in single transaction. In PaymentClearing's
113
+ # documentation this is known as an "Auth" or a "Sale" transaction
114
+ #
115
+ # ==== Parameters
116
+ # * <tt>money</tt> - The amount to be captured. Should be <tt>nil</tt> or an Integer amount in cents.
117
+ # * <tt>creditcard</tt> - The CreditCard details for the transaction
118
+ # * <tt>options</tt> - A Hash of options
119
+ #
120
+ # ==== Options Hash
121
+ # The standard options apply here (:order_id, :ip, :customer, :invoice, :merchant, :description, :email, :currency, :address, :billing_address, :shipping_address), as well as:
122
+ # * <tt>:order_items</tt> - An Array of Hash objects with the keys <tt>:description</tt>, <tt>:cost</tt> (in cents!), and <tt>:quantity</tt>. If this is provided, <tt>:description</tt> and <tt>money</tt> will be ignored.
123
+ # * <tt>:vendor_data</tt> - An Array of Hash objects with the keys being the name of the VendorData element and value being the value.
124
+ # * <tt>:send_customer_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendCustomerEmail' element set to 'TRUE' or 'FALSE'.
125
+ # * <tt>:send_merchant_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendMerchantEmail' element set to 'TRUE' or 'FALSE'.
126
+ # * <tt>:email_text</tt> - An Array of (up to ten (10)) String objects to be included in emails
127
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'TestMode' element set to 'TRUE' or 'FALSE'.
128
+ #
129
+ # ==== Examples
130
+ # response = gateway.purchase(1000, creditcard,
131
+ # :order_id => '1212', :address => {...}, :email => 'test@test.com',
132
+ # :order_items => [
133
+ # {:description => 'Line Item 1', :cost => '8.98', :quantity => '6'},
134
+ # {:description => 'Line Item 2', :cost => '6.99', :quantity => '4'}
135
+ # ],
136
+ # :vendor_data => [{'repId' => '1234567'}, {'customerId' => '9886'}],
137
+ # :send_customer_email => true,
138
+ # :send_merchant_email => true,
139
+ # :email_text => ['line1', 'line2', 'line3'],
140
+ # :test_mode => true
141
+ # )
142
+ #
143
+ def purchase(money, payment_source, options = {})
144
+ payload = Nokogiri::XML::Builder.new do |xml|
145
+ xml.AuthTransaction {
146
+ add_customer_data(xml, payment_source, options)
147
+ add_invoice(xml, money, options)
148
+ add_payment_source(xml, payment_source)
149
+ add_transaction_control(xml, options)
150
+ add_vendor_data(xml, options)
151
+ }
152
+ end.doc
153
+
154
+ commit(payload)
155
+ end
156
+
157
+ # Captures the funds from an authorize transaction. In PaymentClearing's
158
+ # documentation this is known as a "PostAuth" transaction.
159
+ #
160
+ # ==== Parameters
161
+ # * <tt>money</tt> - The amount to be captured. Should be an Integer amount in cents
162
+ # * <tt>authorization</tt> - The authorization returned from the previous capture or purchase request
163
+ # * <tt>options</tt> - A Hash of options, all are optional.
164
+ #
165
+ # ==== Options Hash
166
+ # The standard options apply here (:order_id, :ip, :customer, :invoice, :merchant, :description, :email, :currency, :address, :billing_address, :shipping_address), as well as:
167
+ # * <tt>:vendor_data</tt> - An Array of Hash objects with the keys being the name of the VendorData element and value being the value.
168
+ # * <tt>:send_customer_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendCustomerEmail' element set to 'TRUE' or 'FALSE'.
169
+ # * <tt>:send_merchant_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendMerchantEmail' element set to 'TRUE' or 'FALSE'.
170
+ # * <tt>:email_text</tt> - An Array of (up to ten (10)) String objects to be included in emails
171
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'TestMode' element set to 'TRUE' or 'FALSE'.
172
+ #
173
+ # ==== Examples
174
+ # response = gateway.capture(1000, creditcard,
175
+ # :vendor_data => [{'repId' => '1234567'}, {'customerId' => '9886'}],
176
+ # :send_customer_email => true,
177
+ # :send_merchant_email => true,
178
+ # :email_text => ['line1', 'line2', 'line3'],
179
+ # :test_mode => true
180
+ # )
181
+ #
182
+ def capture(money, authorization, options = {})
183
+ payload = Nokogiri::XML::Builder.new do |xml|
184
+ xml.PostAuthTransaction {
185
+ xml.OperationXID(authorization)
186
+ add_invoice(xml, money, options)
187
+ add_transaction_control(xml, options)
188
+ add_vendor_data(xml, options)
189
+ }
190
+ end.doc
191
+
192
+ commit(payload)
193
+ end
194
+
195
+ # This will reverse a previously run transaction which *has* *not* settled.
196
+ #
197
+ # ==== Parameters
198
+ # * <tt>authorization</tt> - The authorization returned from the previous capture or purchase request
199
+ # * <tt>options</tt> - A Hash of options, all are optional
200
+ #
201
+ # ==== Options Hash
202
+ # The standard options (:order_id, :ip, :customer, :invoice, :merchant, :description, :email, :currency, :address, :billing_address, :shipping_address) are ignored.
203
+ # * <tt>:vendor_data</tt> - An Array of Hash objects with the keys being the name of the VendorData element and value being the value.
204
+ # * <tt>:send_customer_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendCustomerEmail' element set to 'TRUE' or 'FALSE'.
205
+ # * <tt>:send_merchant_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendMerchantEmail' element set to 'TRUE' or 'FALSE'.
206
+ # * <tt>:email_text</tt> - An Array of (up to ten (10)) String objects to be included in emails
207
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'TestMode' element set to 'TRUE' or 'FALSE'.
208
+ #
209
+ # ==== Examples
210
+ # response = gateway.void('9999999999',
211
+ # :vendor_data => [{'repId' => '1234567'}, {'customerId' => '9886'}],
212
+ # :send_customer_email => true,
213
+ # :send_merchant_email => true,
214
+ # :email_text => ['line1', 'line2', 'line3'],
215
+ # :test_mode => true
216
+ # )
217
+ #
218
+ def void(authorization, options = {})
219
+ payload = Nokogiri::XML::Builder.new do |xml|
220
+ xml.VoidTransaction {
221
+ xml.OperationXID(authorization)
222
+ add_transaction_control(xml, options)
223
+ add_vendor_data(xml, options)
224
+ }
225
+ end.doc
226
+
227
+ commit(payload)
228
+ end
229
+
230
+ # This will reverse a previously run transaction which *has* settled.
231
+ #
232
+ # ==== Parameters
233
+ # * <tt>money</tt> - The amount to be credited. Should be an Integer amount in cents
234
+ # * <tt>authorization</tt> - The authorization returned from the previous capture or purchase request
235
+ # * <tt>options</tt> - A Hash of options, all are optional
236
+ #
237
+ # ==== Options Hash
238
+ # The standard options (:order_id, :ip, :customer, :invoice, :merchant, :description, :email, :currency, :address, :billing_address, :shipping_address) are ignored.
239
+ # * <tt>:vendor_data</tt> - An Array of Hash objects with the keys being the name of the VendorData element and value being the value.
240
+ # * <tt>:send_customer_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendCustomerEmail' element set to 'TRUE' or 'FALSE'.
241
+ # * <tt>:send_merchant_email</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'SendMerchantEmail' element set to 'TRUE' or 'FALSE'.
242
+ # * <tt>:email_text</tt> - An Array of (up to ten (10)) String objects to be included in emails
243
+ # * <tt>:test_mode</tt> - <tt>true</tt> or <tt>false</tt>. Runs the transaction with the 'TestMode' element set to 'TRUE' or 'FALSE'.
244
+ #
245
+ # ==== Examples
246
+ # response = gateway.refund(555, '9999999999',
247
+ # :vendor_data => [{'repId' => '1234567'}, {'customerId' => '9886'}],
248
+ # :send_customer_email => true,
249
+ # :send_merchant_email => true,
250
+ # :email_text => ['line1', 'line2', 'line3'],
251
+ # :test_mode => true
252
+ # )
253
+ #
254
+ def refund(money, authorization, options = {})
255
+ payload = Nokogiri::XML::Builder.new do |xml|
256
+ xml.TranCredTransaction {
257
+ xml.OperationXID(authorization)
258
+ add_invoice(xml, money, options)
259
+ add_transaction_control(xml, options)
260
+ add_vendor_data(xml, options)
261
+ }
262
+ end.doc
263
+
264
+ commit(payload)
265
+ end
266
+
267
+ private
268
+
269
+ def add_customer_data(xml, payment_source, options)
270
+ billing_address = options[:billing_address] || options[:address]
271
+ shipping_address = options[:shipping_address] || options[:address]
272
+
273
+ xml.CustomerData {
274
+ xml.Email(options[:email]) unless options[:email].blank?
275
+ xml.CustId(options[:order_id]) unless options[:order_id].blank?
276
+ xml.BillingAddress {
277
+ xml.FirstName(payment_source.first_name || parse_first_name(billing_address[:name]))
278
+ xml.LastName(payment_source.last_name || parse_last_name(billing_address[:name]))
279
+ xml.Address1(billing_address[:address1])
280
+ xml.Address2(billing_address[:address2]) unless billing_address[:address2].blank?
281
+ xml.City(billing_address[:city])
282
+ xml.State(billing_address[:state])
283
+ xml.Zip(billing_address[:zip])
284
+ xml.Country(billing_address[:country])
285
+ xml.Phone(billing_address[:phone])
286
+ }
287
+ xml.ShippingAddress {
288
+ xml.FirstName(payment_source.first_name || parse_first_name(shipping_address[:name]))
289
+ xml.LastName(payment_source.last_name || parse_last_name(shipping_address[:name]))
290
+ xml.Address1(shipping_address[:address1])
291
+ xml.Address2(shipping_address[:address2]) unless shipping_address[:address2].blank?
292
+ xml.City(shipping_address[:city])
293
+ xml.State(shipping_address[:state])
294
+ xml.Zip(shipping_address[:zip])
295
+ xml.Country(shipping_address[:country])
296
+ xml.Phone(shipping_address[:phone])
297
+ } unless shipping_address.blank?
298
+ }
299
+ end
300
+
301
+ def add_invoice(xml, money, options)
302
+ xml.AuthCode options[:force] if options[:force]
303
+ if options[:order_items].blank?
304
+ xml.Total(amount(money)) unless(money.nil? || money < 0.01)
305
+ xml.Description(options[:description]) unless( options[:description].blank?)
306
+ else
307
+ xml.OrderItems {
308
+ options[:order_items].each do |item|
309
+ xml.Item {
310
+ xml.Description(item[:description])
311
+ xml.Cost(amount(item[:cost]))
312
+ xml.Qty(item[:quantity].to_s)
313
+ }
314
+ end
315
+ }
316
+ end
317
+ end
318
+
319
+ def add_payment_source(xml, source)
320
+ case determine_funding_source(source)
321
+ when :credit_card then add_creditcard(xml, source)
322
+ when :check then add_check(xml, source)
323
+ end
324
+ end
325
+
326
+ def determine_funding_source(payment_source)
327
+ case payment_source
328
+ when ActiveMerchant::Billing::CreditCard
329
+ :credit_card
330
+ when ActiveMerchant::Billing::Check
331
+ :check
332
+ end
333
+ end
334
+
335
+ def add_creditcard(xml, creditcard)
336
+ xml.AccountInfo {
337
+ xml.CardAccount {
338
+ xml.AccountNumber(creditcard.number.to_s)
339
+ xml.ExpirationMonth(creditcard.month.to_s.rjust(2,'0'))
340
+ xml.ExpirationYear(creditcard.year.to_s)
341
+ xml.CVVNumber(creditcard.verification_value.to_s) unless creditcard.verification_value.blank?
342
+ }
343
+ }
344
+ end
345
+
346
+ def add_check(xml, check)
347
+ xml.AccountInfo {
348
+ xml.ABA(check.routing_number.to_s)
349
+ xml.AccountNumber(check.account_number.to_s)
350
+ xml.AccountSource(check.account_type.to_s)
351
+ xml.AccountType(check.account_holder_type.to_s)
352
+ xml.CheckNumber(check.number.to_s)
353
+ }
354
+ end
355
+
356
+ def add_transaction_control(xml, options)
357
+ xml.TransactionControl {
358
+ # if there was a 'global' option set...
359
+ xml.TestMode(@options[:test_mode].upcase) if !@options[:test_mode].blank?
360
+ # allow the global option to be overridden...
361
+ xml.TestMode(options[:test_mode].upcase) if !options[:test_mode].blank?
362
+ xml.SendCustomerEmail(options[:send_customer_email].upcase) unless options[:send_customer_email].blank?
363
+ xml.SendMerchantEmail(options[:send_merchant_email].upcase) unless options[:send_merchant_email].blank?
364
+ xml.EmailText {
365
+ options[:email_text].each do |item|
366
+ xml.EmailTextItem(item)
367
+ end
368
+ } if options[:email_text]
369
+ }
370
+ end
371
+
372
+ def add_vendor_data(xml, options)
373
+ return if options[:vendor_data].blank?
374
+ xml.VendorData {
375
+ options[:vendor_data].each do |k,v|
376
+ xml.Element {
377
+ xml.Name(k)
378
+ xml.Key(v)
379
+ }
380
+ end
381
+ }
382
+ end
383
+
384
+ def commit(payload)
385
+ # Set the Content-Type header -- otherwise the URL decoding messes up
386
+ # the Base64 encoded payload signature!
387
+ response = parse(ssl_post(self.live_url, post_data(payload), 'Content-Type' => 'text/xml'))
388
+
389
+ Response.new(successful?(response), response[:error_message], response,
390
+ :test => test?,
391
+ :authorization => response[:xid],
392
+ :avs_result => { :code => response[:avs_response] },
393
+ :cvv_result => response[:cvv_response])
394
+ end
395
+
396
+ def post_data(payload)
397
+ payload_xml = payload.root.to_xml(:indent => 0)
398
+
399
+ payload_signature = sign_payload(payload_xml)
400
+
401
+ request = Nokogiri::XML::Builder.new do |xml|
402
+ xml.GatewayInterface {
403
+ xml.APICredentials {
404
+ xml.Username(@options[:login])
405
+ xml.PayloadSignature(payload_signature)
406
+ xml.TargetGateway(@options[:gateway_id])
407
+ }
408
+ }
409
+ end.doc
410
+
411
+ request.root.children.first.after payload.root
412
+ request.to_xml(:indent => 0)
413
+ end
414
+
415
+ def parse(raw_xml)
416
+ doc = REXML::Document.new(raw_xml)
417
+ response = Hash.new
418
+ transaction_result = doc.root.get_elements('TransactionResponse/TransactionResult/*')
419
+ transaction_result.each do |e|
420
+ response[e.name.to_s.underscore.to_sym] = e.text unless e.text.blank?
421
+ end
422
+ response
423
+ end
424
+
425
+ def successful?(response)
426
+ # Turns out the PaymentClearing gateway is not consistent...
427
+ response[:status].downcase =='ok'
428
+ end
429
+
430
+ def test_mode?(response)
431
+ # The '1' is a legacy thing; most of the time it should be 'TRUE'...
432
+ response[:test_mode] == 'TRUE' || response[:test_mode] == '1'
433
+ end
434
+
435
+ def message_from(response)
436
+ response[:error_message]
437
+ end
438
+
439
+ def sign_payload(payload)
440
+ key = @options[:password].to_s
441
+ digest=OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new(key), key, payload)
442
+ signature = Base64.encode64(digest)
443
+ signature.chomp!
444
+ end
445
+ end
446
+ end
447
+ end
448
+