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,173 @@
1
+ require 'json'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class FatZebraGateway < Gateway
6
+ self.live_url = "https://gateway.fatzebra.com.au/v1.0"
7
+ self.test_url = "https://gateway.sandbox.fatzebra.com.au/v1.0"
8
+
9
+ self.supported_countries = ['AU']
10
+ self.default_currency = 'AUD'
11
+ self.money_format = :cents
12
+ self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
13
+
14
+ self.homepage_url = 'https://www.fatzebra.com.au/'
15
+ self.display_name = 'Fat Zebra'
16
+
17
+ # Setup a new instance of the gateway.
18
+ #
19
+ # The options hash should include :username and :token
20
+ # You can find your username and token at https://dashboard.fatzebra.com.au
21
+ # Under the Your Account section
22
+ def initialize(options = {})
23
+ requires!(options, :username, :token)
24
+ @username = options[:username]
25
+ @token = options[:token]
26
+ super
27
+ end
28
+
29
+ # To create a purchase on a credit card use:
30
+ #
31
+ # purchase(money, creditcard)
32
+ #
33
+ # To charge a tokenized card
34
+ #
35
+ # purchase(money, "abzy87u", :cvv => "123")
36
+ def purchase(money, creditcard, options = {})
37
+ post = {}
38
+
39
+ add_amount(post, money, options)
40
+ add_creditcard(post, creditcard, options)
41
+ post[:reference] = options[:order_id]
42
+ post[:customer_ip] = options[:ip]
43
+
44
+ commit(:post, 'purchases', post)
45
+ end
46
+
47
+ # Refund a transaction
48
+ #
49
+ # amount - Integer - the amount to refund
50
+ # txn_id - String - the original transaction to be refunded
51
+ # reference - String - your transaction reference
52
+ def refund(money, txn_id, reference)
53
+ post = {}
54
+
55
+ post[:amount] = money
56
+ post[:transaction_id] = txn_id
57
+ post[:reference] = reference
58
+
59
+ commit(:post, "refunds", post)
60
+ end
61
+
62
+ # Tokenize a credit card
63
+ #
64
+ # The token is returned in the Response#authorization
65
+ def store(creditcard)
66
+ post = {}
67
+ add_creditcard(post, creditcard)
68
+
69
+ commit(:post, "credit_cards", post)
70
+ end
71
+
72
+ private
73
+
74
+ # Add the money details to the request
75
+ def add_amount(post, money, options)
76
+ post[:amount] = money
77
+ end
78
+
79
+ # Add the credit card details to the request
80
+ def add_creditcard(post, creditcard, options = {})
81
+ if creditcard.respond_to?(:number)
82
+ post[:card_number] = creditcard.number
83
+ post[:card_expiry] = "#{creditcard.month}/#{creditcard.year}"
84
+ post[:cvv] = creditcard.verification_value if creditcard.verification_value?
85
+ post[:card_holder] = creditcard.name if creditcard.name
86
+ elsif creditcard.is_a?(String)
87
+ post[:card_token] = creditcard
88
+ post[:cvv] = options[:cvv]
89
+ elsif creditcard.is_a?(Hash)
90
+ deprecated "Passing the credit card as a Hash is deprecated. Use a String and put the (optional) CVV in the options hash instead."
91
+ post[:card_token] = creditcard[:token]
92
+ post[:cvv] = creditcard[:cvv]
93
+ else
94
+ raise ArgumentError.new("Unknown credit card format #{creditcard.inspect}")
95
+ end
96
+ end
97
+
98
+ # Post the data to the gateway
99
+ def commit(method, uri, parameters=nil)
100
+ response = begin
101
+ parse(ssl_request(method, get_url(uri), parameters.to_json, headers))
102
+ rescue ResponseError => e
103
+ return Response.new(false, "Invalid Login") if(e.response.code == "401")
104
+ parse(e.response.body)
105
+ end
106
+
107
+ success = success_from(response)
108
+ Response.new(
109
+ success,
110
+ message_from(response),
111
+ response,
112
+ :test => response["test"],
113
+ :authorization => authorization_from(response, success)
114
+ )
115
+ end
116
+
117
+ def success_from(response)
118
+ (
119
+ response["successful"] &&
120
+ response["response"] &&
121
+ (response["response"]["successful"] || response["response"]["token"])
122
+ )
123
+ end
124
+
125
+ def authorization_from(response, success)
126
+ if success
127
+ (response["response"]["id"] || response["response"]["token"])
128
+ else
129
+ nil
130
+ end
131
+ end
132
+
133
+ def message_from(response)
134
+ if !response["errors"].empty?
135
+ response["errors"].join(", ")
136
+ elsif response["response"]["message"]
137
+ response["response"]["message"]
138
+ else
139
+ "Unknown Error"
140
+ end
141
+ end
142
+
143
+ # Parse the returned JSON, if parse errors are raised then return a detailed error.
144
+ def parse(response)
145
+ begin
146
+ JSON.parse(response)
147
+ rescue JSON::ParserError
148
+ msg = 'Invalid JSON response received from Fat Zebra. Please contact support@fatzebra.com.au if you continue to receive this message.'
149
+ msg += " (The raw response returned by the API was #{response.inspect})"
150
+ {
151
+ "successful" => false,
152
+ "response" => {},
153
+ "errors" => [msg]
154
+ }
155
+ end
156
+ end
157
+
158
+ # Build the URL based on the AM mode and the URI
159
+ def get_url(uri)
160
+ base = test? ? self.test_url : self.live_url
161
+ base + "/" + uri
162
+ end
163
+
164
+ # Builds the auth and U-A headers for the request
165
+ def headers
166
+ {
167
+ "Authorization" => "Basic " + Base64.strict_encode64(@username.to_s + ":" + @token.to_s).strip,
168
+ "User-Agent" => "Fat Zebra v1.0/ActiveMerchant #{ActiveMerchant::VERSION}"
169
+ }
170
+ end
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,167 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class FederatedCanadaGateway < Gateway
4
+ # Same URL for both test and live, testing is done by using the test username (demo) and password (password).
5
+ self.live_url = self.test_url = 'https://secure.federatedgateway.com/api/transact.php'
6
+
7
+ APPROVED, DECLINED, ERROR = 1, 2, 3
8
+
9
+ # The countries the gateway supports merchants from as 2 digit ISO country codes
10
+ self.supported_countries = ['CA']
11
+
12
+ self.default_currency = 'CAD'
13
+
14
+ # The card types supported by the payment gateway
15
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
16
+
17
+ # The homepage URL of the gateway
18
+ self.homepage_url = 'http://www.federatedcanada.com/'
19
+
20
+ # The name of the gateway
21
+ self.display_name = 'Federated Canada'
22
+
23
+ def initialize(options = {})
24
+ requires!(options, :login, :password)
25
+ super
26
+ end
27
+
28
+ def purchase(money, creditcard, options = {})
29
+ post = {}
30
+ add_invoice(post, options)
31
+ add_creditcard(post, creditcard)
32
+ add_address(post, options)
33
+ add_customer_data(post, options)
34
+ commit('sale', money, post)
35
+ end
36
+
37
+ def authorize(money, creditcard, options = {})
38
+ post = {}
39
+ add_invoice(post, options)
40
+ add_creditcard(post, creditcard)
41
+ add_address(post, options)
42
+ add_customer_data(post, options)
43
+ commit('auth', money, post)
44
+ end
45
+
46
+ def capture(money, authorization, options = {})
47
+ options[:transactionid] = authorization
48
+ commit('capture', money, options)
49
+ end
50
+
51
+ def void(authorization, options = {})
52
+ options[:transactionid] = authorization
53
+ commit('void', nil, options)
54
+ end
55
+
56
+ def refund(money, authorization, options = {})
57
+ commit('refund', money, options.merge(:transactionid => authorization))
58
+ end
59
+
60
+ def credit(money, authorization, options = {})
61
+ deprecated CREDIT_DEPRECATION_MESSAGE
62
+ refund(money, authorization, options)
63
+ end
64
+
65
+ private
66
+
67
+ def add_customer_data(post, options)
68
+ post[:firstname] = options[:first_name]
69
+ post[:lastname] = options[:last_name]
70
+
71
+ post[:email] = options[:email]
72
+ end
73
+
74
+ def add_address(post, options)
75
+ if address = (options[:billing_address] || options[:address])
76
+ post[:company] = address[:company]
77
+ post[:address1] = address[:address1]
78
+ post[:address2] = address[:address2]
79
+ post[:city] = address[:city]
80
+ post[:state] = address[:state]
81
+ post[:zip] = address[:zip]
82
+ post[:country] = address[:country]
83
+ post[:phone] = address[:phone]
84
+ end
85
+ if address = options[:shipping_address]
86
+ post[:shipping_firstname] = address[:first_name]
87
+ post[:shipping_lastname] = address[:last_name]
88
+ post[:shipping_company] = address[:company]
89
+ post[:shipping_address1] = address[:address1]
90
+ post[:shipping_address2] = address[:address2]
91
+ post[:shipping_city] = address[:city]
92
+ post[:shipping_state] = address[:state]
93
+ post[:shipping_zip] = address[:zip]
94
+ post[:shipping_country] = address[:country]
95
+ post[:shipping_email] = address[:email]
96
+ end
97
+ end
98
+
99
+ def add_invoice(post, options)
100
+ post[:orderid] = options[:order_id]
101
+ post[:orderdescription] = options[:description]
102
+ end
103
+
104
+ def add_creditcard(post, creditcard)
105
+ post[:ccnumber] = creditcard.number
106
+ post[:ccexp] = expdate(creditcard)
107
+ post[:cvv] = creditcard.verification_value
108
+ end
109
+
110
+ def expdate(creditcard)
111
+ year = sprintf("%.4i", creditcard.year)
112
+ month = sprintf("%.2i", creditcard.month)
113
+ "#{month}#{year[-2..-1]}"
114
+ end
115
+
116
+ def parse(body)
117
+ body.split('&').inject({}) do |memo, x|
118
+ k, v = x.split('=')
119
+ memo[k] = v
120
+ memo
121
+ end
122
+ end
123
+
124
+ def commit(action, money, parameters)
125
+ parameters[:amount] = amount(money)
126
+ data = ssl_post(self.live_url, post_data(action, parameters))
127
+ response = parse(data)
128
+ message = message_from(response)
129
+ test_mode = test?
130
+
131
+ Response.new(success?(response), message, response,
132
+ :test => test?,
133
+ :authorization => response['transactionid'],
134
+ :avs_result => {:code => response['avsresponse']},
135
+ :cvv_result => response['cvvresponse']
136
+ )
137
+ end
138
+
139
+ def success?(response)
140
+ response['response'] == '1'
141
+ end
142
+
143
+ def test?
144
+ (@options[:login].eql?('demo')) && (@options[:password].eql?('password'))
145
+ end
146
+
147
+ def message_from(response)
148
+ case response['response'].to_i
149
+ when APPROVED
150
+ "Transaction Approved"
151
+ when DECLINED
152
+ "Transaction Declined"
153
+ else
154
+ "Error in transaction data or system error"
155
+ end
156
+ end
157
+
158
+ def post_data(action, parameters = {})
159
+ parameters[:type] = action
160
+ parameters[:username] = @options[:login]
161
+ parameters[:password] = @options[:password]
162
+ parameters.map{|k, v| "#{k}=#{CGI.escape(v.to_s)}"}.join('&')
163
+ end
164
+ end
165
+ end
166
+ end
167
+
@@ -0,0 +1,22 @@
1
+ require File.dirname(__FILE__) + '/cc5'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class FinansbankGateway < CC5Gateway
6
+ self.live_url = self.test_url = 'https://www.fbwebpos.com/servlet/cc5ApiServer'
7
+
8
+ # The countries the gateway supports merchants from as 2 digit ISO country codes
9
+ self.supported_countries = ['US', 'TR']
10
+
11
+ # The card types supported by the payment gateway
12
+ self.supported_cardtypes = [:visa, :master]
13
+
14
+ # The homepage URL of the gateway
15
+ self.homepage_url = 'https://www.fbwebpos.com/'
16
+
17
+ # The name of the gateway
18
+ self.display_name = 'Finansbank WebPOS'
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,176 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class FirstPayGateway < Gateway
4
+ class FirstPayPostData < PostData
5
+ # Fields that will be sent even if they are blank
6
+ self.required_fields = [ :action, :amount, :trackid ]
7
+ end
8
+
9
+ # both URLs are IP restricted
10
+ self.test_url = 'https://apgcert.first-pay.com/AcqENGIN/SecureCapture'
11
+ self.live_url = 'https://acqengin.first-pay.com/AcqENGIN/SecureCapture'
12
+
13
+ # The countries the gateway supports merchants from as 2 digit ISO country codes
14
+ self.supported_countries = ['US']
15
+
16
+ # The card types supported by the payment gateway
17
+ self.supported_cardtypes = [:visa, :master]
18
+
19
+ # The homepage URL of the gateway
20
+ self.homepage_url = 'http://www.first-pay.com'
21
+
22
+ # The name of the gateway
23
+ self.display_name = 'First Pay'
24
+
25
+ # all transactions are in cents
26
+ self.money_format = :cents
27
+
28
+ ACTIONS = {
29
+ 'sale' => 1,
30
+ 'credit' => 2,
31
+ 'void' => 3
32
+ }
33
+
34
+ def initialize(options = {})
35
+ requires!(options, :login, :password)
36
+ super
37
+ end
38
+
39
+ def purchase(money, creditcard, options = {})
40
+ post = FirstPayPostData.new
41
+ add_invoice(post, options)
42
+ add_creditcard(post, creditcard)
43
+ add_address(post, options)
44
+ add_customer_data(post, options)
45
+
46
+ commit('sale', money, post)
47
+ end
48
+
49
+ def refund(money, reference, options = {})
50
+ requires!(options, :credit_card)
51
+
52
+ post = FirstPayPostData.new
53
+ add_invoice(post, options)
54
+ add_creditcard(post, options[:credit_card])
55
+ add_address(post, options)
56
+ add_customer_data(post, options)
57
+ add_credit_data(post, reference)
58
+
59
+ commit('credit', money, post)
60
+ end
61
+
62
+ def credit(money, reference, options = {})
63
+ deprecated CREDIT_DEPRECATION_MESSAGE
64
+ refund(money, reference, options)
65
+ end
66
+
67
+ def void(money, creditcard, options = {})
68
+ post = FirstPayPostData.new
69
+ add_creditcard(post, creditcard)
70
+ add_void_data(post, options)
71
+ add_invoice(post, options)
72
+ add_customer_data(post, options)
73
+
74
+ commit('void', money, post)
75
+ end
76
+
77
+
78
+ private
79
+
80
+ def add_customer_data(post, options)
81
+ post[:cardip] = options[:ip]
82
+ post[:email] = options[:email]
83
+ end
84
+
85
+ def add_address(post, options)
86
+ if billing_address = options[:billing_address] || options[:address]
87
+ post[:addr] = billing_address[:address1].to_s + ' ' + billing_address[:address2].to_s
88
+ post[:city] = billing_address[:city]
89
+ post[:state] = billing_address[:state]
90
+ post[:zip] = billing_address[:zip]
91
+ post[:country] = billing_address[:country]
92
+ end
93
+ end
94
+
95
+ def add_invoice(post, options)
96
+ post[:trackid] = rand(Time.now.to_i)
97
+ end
98
+
99
+ def add_creditcard(post, creditcard)
100
+ post[:member] = creditcard.first_name.to_s + " " + creditcard.last_name.to_s
101
+ post[:card] = creditcard.number
102
+ post[:exp] = expdate(creditcard)
103
+ end
104
+
105
+ def expdate(credit_card)
106
+ year = sprintf("%.4i", credit_card.year)
107
+ month = sprintf("%.2i", credit_card.month)
108
+
109
+ "#{month}#{year[-2..-1]}"
110
+ end
111
+
112
+ def add_credit_data(post, transaction_id)
113
+ post[:transid] = transaction_id
114
+ end
115
+
116
+ def add_void_data(post, options)
117
+ post[:transid] = options[:transactionid]
118
+ end
119
+
120
+ def commit(action, money, post)
121
+ response = parse( ssl_post(test? ? self.test_url : self.live_url, post_data(action, post, money)) )
122
+
123
+ Response.new(response[:response] == 'CAPTURED', response[:message], response,
124
+ :test => test?,
125
+ :authorization => response[:authorization],
126
+ :avs_result => { :code => response[:avsresponse] },
127
+ :cvv_result => response[:cvvresponse])
128
+ end
129
+
130
+ def parse(body)
131
+ response = {}
132
+
133
+ # check for an error first
134
+ if body.include?('!ERROR!')
135
+ response[:response] = 'ERROR'
136
+ response[:message] = error_message_from(body)
137
+ else
138
+ # a capture / not captured response will be : delimited
139
+ split = body.split(':')
140
+ response[:response] = split[0]
141
+
142
+ # FirstPay docs are worthless. turns out the transactionid is required for credits
143
+ # so we need to store that in authorization, not the actual auth.
144
+ if response[:response] == 'CAPTURED'
145
+ response[:message] = 'CAPTURED'
146
+ response[:authorization] = split[9] # actually the transactionid
147
+ response[:auth] = split[1]
148
+ response[:avsresponse] = split[3]
149
+ response[:cvvresponse] = split[17]
150
+ else
151
+ # NOT CAPTURED response
152
+ response[:message] = split[1]
153
+ response[:transactionid] = split[9]
154
+ end
155
+ end
156
+
157
+ return response
158
+ end
159
+
160
+ def error_message_from(response)
161
+ # error messages use this format - '!ERROR! 704-MISSING BASIC DATA TYPE:card, exp, zip, addr, member, amount\n'
162
+ response.split("! ")[1].chomp
163
+ end
164
+
165
+ def post_data(action, post, money)
166
+ post[:vid] = @options[:login]
167
+ post[:password] = @options[:password]
168
+ post[:action] = ACTIONS[action]
169
+ post[:amount] = amount(money)
170
+
171
+ return post.to_post_data
172
+ end
173
+ end
174
+ end
175
+ end
176
+