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,101 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ module Integrations #:nodoc:
4
+ module WorldPay
5
+ class Helper < ActiveMerchant::Billing::Integrations::Helper
6
+ mapping :account, 'instId'
7
+ mapping :amount, 'amount'
8
+ mapping :order, 'cartId'
9
+ mapping :currency, 'currency'
10
+
11
+ mapping :customer, :email => 'email',
12
+ :phone => 'tel'
13
+
14
+ mapping :billing_address, :zip => 'postcode',
15
+ :country => 'country'
16
+
17
+ mapping :description, 'desc'
18
+ mapping :notify_url, 'MC_callback'
19
+ mapping :return_url, 'MC_return'
20
+
21
+
22
+ # WorldPay supports two different test modes - :always_succeed and :always_fail
23
+ def initialize(order, account, options = {})
24
+ super
25
+
26
+ if ActiveMerchant::Billing::Base.integration_mode == :test || options[:test]
27
+ test_mode = case options[:test]
28
+ when :always_fail
29
+ 101
30
+ when false
31
+ 0
32
+ else
33
+ 100
34
+ end
35
+ add_field('testMode', test_mode.to_s)
36
+ elsif ActiveMerchant::Billing::Base.integration_mode == :always_succeed
37
+ add_field('testMode', '100')
38
+ elsif ActiveMerchant::Billing::Base.integration_mode == :always_fail
39
+ add_field('testMode', '101')
40
+ end
41
+ end
42
+
43
+ # WorldPay only supports a single address field so we
44
+ # have to concat together - lines are separated using &#10;
45
+ def billing_address(params={})
46
+ add_field(mappings[:billing_address][:zip], params[:zip])
47
+ add_field(mappings[:billing_address][:country], lookup_country_code(params[:country]))
48
+
49
+ address = [params[:address1], params[:address2], params[:city], params[:state]].compact
50
+ add_field('address', address.join('&#10;'))
51
+ end
52
+
53
+ # WorldPay only supports a single name field so we have to concat
54
+ def customer(params={})
55
+ add_field(mappings[:customer][:email], params[:email])
56
+ add_field(mappings[:customer][:phone], params[:phone])
57
+ add_field('name', "#{params[:first_name]} #{params[:last_name]}")
58
+ end
59
+
60
+ # Support for a MD5 hash of selected fields to prevent tampering
61
+ # For futher information read the tech note at the address below:
62
+ # http://support.worldpay.com/kb/integration_guides/junior/integration/help/tech_notes/sjig_tn_009.html
63
+ def encrypt(secret, fields = [:amount, :currency, :account, :order])
64
+ signature_fields = fields.collect{ |field| mappings[field] }
65
+ add_field('signatureFields', signature_fields.join(':'))
66
+
67
+ field_values = fields.collect{ |field| form_fields[mappings[field]] }
68
+ signature = "#{secret}:#{field_values.join(':')}"
69
+ add_field('signature', Digest::MD5.hexdigest(signature))
70
+ end
71
+
72
+ # Add a time window for which the payment can be completed. Read the link below for how they work
73
+ # http://support.worldpay.com/kb/integration_guides/junior/integration/help/appendicies/sjig_10100.html
74
+ def valid_from(from_time)
75
+ add_field('authValidFrom', from_time.to_i.to_s + '000')
76
+ end
77
+
78
+ def valid_to(to_time)
79
+ add_field('authValidTo', to_time.to_i.to_s + '000')
80
+ end
81
+
82
+ # WorldPay supports the passing of custom parameters prefixed with the following:
83
+ # C_ : These parameters can be used in the response pages hosted on WorldPay's site
84
+ # M_ : These parameters are passed through to the callback script (if enabled)
85
+ # MC_ or CM_ : These parameters are availble both in the response and callback contexts
86
+ def response_params(params={})
87
+ params.each{|k,v| add_field("C_#{k}",v)}
88
+ end
89
+
90
+ def callback_params(params={})
91
+ params.each{|k,v| add_field("M_#{k}",v)}
92
+ end
93
+
94
+ def combined_params(params={})
95
+ params.each{|k,v| add_field("MC_#{k}",v)}
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,160 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ module Integrations #:nodoc:
4
+ module WorldPay
5
+ class Notification < ActiveMerchant::Billing::Integrations::Notification
6
+ def complete?
7
+ status == 'Completed'
8
+ end
9
+
10
+ def account
11
+ params['instId']
12
+ end
13
+
14
+ def item_id
15
+ params['cartId']
16
+ end
17
+
18
+ def transaction_id
19
+ params['transId']
20
+ end
21
+
22
+ # Time this payment was received by the client in UTC time.
23
+ def received_at
24
+ Time.at(params['transTime'].to_i / 1000).utc
25
+ end
26
+
27
+ # Callback password set in the WorldPay CMS
28
+ def security_key
29
+ params['callbackPW']
30
+ end
31
+
32
+ # the money amount we received in X.2 decimal.
33
+ def gross
34
+ params['authAmount']
35
+ end
36
+
37
+ def currency
38
+ params['authCurrency']
39
+ end
40
+
41
+ # Was this a test transaction?
42
+ def test?
43
+ params.key?('testMode') && params['testMode'] != '0'
44
+ end
45
+
46
+ def status
47
+ params['transStatus'] == 'Y' ? 'Completed' : 'Cancelled'
48
+ end
49
+
50
+ def name
51
+ params['name']
52
+ end
53
+
54
+ def address
55
+ params['address']
56
+ end
57
+
58
+ def postcode
59
+ params['postcode']
60
+ end
61
+
62
+ def country
63
+ params['country']
64
+ end
65
+
66
+ def phone_number
67
+ params['tel']
68
+ end
69
+
70
+ def fax_number
71
+ params['fax']
72
+ end
73
+
74
+ def email_address
75
+ params['email']
76
+ end
77
+
78
+ def card_type
79
+ params['cardType']
80
+ end
81
+
82
+ # WorldPay extended fraud checks returned as a 4 character string
83
+ # 1st char: Credit card CVV check
84
+ # 2nd char: Postcode AVS check
85
+ # 3rd char: Address AVS check
86
+ # 4th char: Country comparison check
87
+ # Possible values are:
88
+ # :not_supported - 0
89
+ # :not_checked - 1
90
+ # :matched - 2
91
+ # :not_matched - 4
92
+ # :partial_match - 8
93
+ def cvv_status
94
+ return avs_value_to_symbol(params['AVS'][0].chr)
95
+ end
96
+
97
+ def postcode_status
98
+ return avs_value_to_symbol(params['AVS'][1].chr)
99
+ end
100
+
101
+ def address_status
102
+ return avs_value_to_symbol(params['AVS'][2].chr)
103
+ end
104
+
105
+ def country_status
106
+ return avs_value_to_symbol(params['AVS'][3].chr)
107
+ end
108
+
109
+ def acknowledge
110
+ return true
111
+ end
112
+
113
+ # WorldPay supports the passing of custom parameters through to the callback script
114
+ def custom_params
115
+ return @custom_params ||= read_custom_params
116
+ end
117
+
118
+
119
+ private
120
+
121
+ # Take the posted data and move the relevant data into a hash
122
+ def parse(post)
123
+ @raw = post
124
+ for line in post.split('&')
125
+ key, value = *line.scan( %r{^(\w+)\=(.*)$} ).flatten
126
+ params[key] = value
127
+ end
128
+ end
129
+
130
+ # Read the custom params into a hash
131
+ def read_custom_params
132
+ custom = {}
133
+ params.each do |key, value|
134
+ if /\A(M_|MC_|CM_)/ === key
135
+ custom[key.gsub(/\A(M_|MC_|CM_)/, '').to_sym] = value
136
+ end
137
+ end
138
+ custom
139
+ end
140
+
141
+ # Convert a AVS value to a symbol - see above for more about AVS
142
+ def avs_value_to_symbol(value)
143
+ case value.to_s
144
+ when '8'
145
+ :partial_match
146
+ when '4'
147
+ :no_match
148
+ when '2'
149
+ :matched
150
+ when '1'
151
+ :not_checked
152
+ else
153
+ :not_supported
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,34 @@
1
+ require File.dirname(__FILE__) + '/world_pay/helper.rb'
2
+ require File.dirname(__FILE__) + '/world_pay/notification.rb'
3
+
4
+ module ActiveMerchant #:nodoc:
5
+ module Billing #:nodoc:
6
+ module Integrations #:nodoc:
7
+ module WorldPay
8
+
9
+ mattr_accessor :production_url, :test_url
10
+ self.production_url = 'https://secure.worldpay.com/wcc/purchase'
11
+ self.test_url = 'https://secure-test.worldpay.com/wcc/purchase'
12
+
13
+ def self.service_url
14
+ case ActiveMerchant::Billing::Base.integration_mode
15
+ when :production
16
+ self.production_url
17
+ when :test
18
+ self.test_url
19
+ else
20
+ raise StandardError, "Integration mode set to an invalid value: #{mode}"
21
+ end
22
+ end
23
+
24
+ def self.notification(post, options = {})
25
+ Notification.new(post, options)
26
+ end
27
+
28
+ def self.return(post, options = {})
29
+ Return.new(post, options)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,17 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ module Integrations
4
+
5
+ Dir[File.dirname(__FILE__) + '/integrations/*.rb'].each do |f|
6
+
7
+ # Get camelized class name
8
+ filename = File.basename(f, '.rb')
9
+ # Camelize the string to get the class name
10
+ gateway_class = filename.camelize.to_sym
11
+
12
+ # Register for autoloading
13
+ autoload gateway_class, f
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,77 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class Error < ActiveMerchantError #:nodoc:
4
+ end
5
+
6
+ class Response
7
+ attr_reader :params, :message, :test, :authorization, :avs_result, :cvv_result
8
+
9
+ def success?
10
+ @success
11
+ end
12
+
13
+ def test?
14
+ @test
15
+ end
16
+
17
+ def fraud_review?
18
+ @fraud_review
19
+ end
20
+
21
+ def initialize(success, message, params = {}, options = {})
22
+ @success, @message, @params = success, message, params.stringify_keys
23
+ @test = options[:test] || false
24
+ @authorization = options[:authorization]
25
+ @fraud_review = options[:fraud_review]
26
+
27
+ @avs_result = if options[:avs_result].kind_of?(AVSResult)
28
+ options[:avs_result].to_hash
29
+ else
30
+ AVSResult.new(options[:avs_result]).to_hash
31
+ end
32
+
33
+ @cvv_result = if options[:cvv_result].kind_of?(CVVResult)
34
+ options[:cvv_result].to_hash
35
+ else
36
+ CVVResult.new(options[:cvv_result]).to_hash
37
+ end
38
+ end
39
+ end
40
+
41
+ class MultiResponse < Response
42
+ def self.run(&block)
43
+ new.tap(&block)
44
+ end
45
+
46
+ attr_reader :responses
47
+
48
+ def initialize
49
+ @responses = []
50
+ end
51
+
52
+ def process
53
+ self << yield if(responses.empty? || success?)
54
+ end
55
+
56
+ def <<(response)
57
+ if response.is_a?(MultiResponse)
58
+ response.responses.each{|r| @responses << r}
59
+ else
60
+ @responses << response
61
+ end
62
+ end
63
+
64
+ def success?
65
+ @responses.all?{|r| r.success?}
66
+ end
67
+
68
+ %w(params message test authorization avs_result cvv_result test? fraud_review?).each do |m|
69
+ class_eval %(
70
+ def #{m}
71
+ (@responses.empty? ? nil : @responses.last.#{m})
72
+ end
73
+ )
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,9 @@
1
+ require 'active_merchant/billing/avs_result'
2
+ require 'active_merchant/billing/cvv_result'
3
+ require 'active_merchant/billing/credit_card_methods'
4
+ require 'active_merchant/billing/credit_card_formatting'
5
+ require 'active_merchant/billing/credit_card'
6
+ require 'active_merchant/billing/base'
7
+ require 'active_merchant/billing/check'
8
+ require 'active_merchant/billing/response'
9
+ require 'active_merchant/billing/gateways'
@@ -0,0 +1,3 @@
1
+ module ActiveMerchant
2
+ VERSION = "1.37.0"
3
+ end
@@ -0,0 +1,63 @@
1
+ #--
2
+ # Copyright (c) 2005-2010 Tobias Luetke
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'active_support'
25
+ require 'active_support/core_ext/string/inflections'
26
+ require 'active_support/core_ext/hash/indifferent_access'
27
+ require 'active_support/core_ext/hash/conversions'
28
+ require 'active_support/core_ext/object/conversions'
29
+ require 'active_support/core_ext/class/attribute'
30
+ require 'active_support/core_ext/class/attribute_accessors'
31
+ require 'active_support/core_ext/class/delegating_attributes'
32
+ require 'active_support/core_ext/module/attribute_accessors'
33
+
34
+ begin
35
+ require 'active_support/base64'
36
+
37
+ unless defined?(Base64)
38
+ Base64 = ActiveSupport::Base64
39
+ end
40
+
41
+ unless Base64.respond_to?(:strict_encode64)
42
+ def Base64.strict_encode64(v)
43
+ ActiveSupport::Base64.encode64s(v)
44
+ end
45
+ end
46
+ rescue LoadError
47
+ require 'base64'
48
+ end
49
+
50
+ require 'securerandom'
51
+ require 'builder'
52
+ require 'cgi'
53
+ require 'rexml/document'
54
+
55
+ require 'active_utils'
56
+ require 'active_merchant/billing'
57
+ require 'active_merchant/version'
58
+
59
+ module ActiveMerchant #:nodoc:
60
+ module Billing #:nodoc:
61
+ autoload :Integrations, 'active_merchant/billing/integrations'
62
+ end
63
+ end
@@ -0,0 +1 @@
1
+ require 'active_merchant'
@@ -0,0 +1,65 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'active_merchant'
4
+
5
+
6
+ class GatewaySupport #:nodoc:
7
+ ACTIONS = [:purchase, :authorize, :capture, :void, :credit, :recurring]
8
+
9
+ include ActiveMerchant::Billing
10
+
11
+ attr_reader :gateways
12
+
13
+ def initialize
14
+ Dir[File.expand_path(File.dirname(__FILE__) + '/../active_merchant/billing/gateways/*.rb')].each do |f|
15
+ filename = File.basename(f, '.rb')
16
+ gateway_name = filename + '_gateway'
17
+ begin
18
+ gateway_class = ('ActiveMerchant::Billing::' + gateway_name.camelize).constantize
19
+ rescue NameError
20
+ puts "Could not load gateway " + gateway_name.camelize + " from " + f + "."
21
+ end
22
+ end
23
+ @gateways = Gateway.implementations.sort_by(&:name)
24
+ @gateways.delete(ActiveMerchant::Billing::BogusGateway)
25
+ end
26
+
27
+ def each_gateway
28
+ @gateways.each{|g| yield g }
29
+ end
30
+
31
+ def features
32
+ width = 15
33
+
34
+ print "Name".center(width + 20)
35
+ ACTIONS.each{|f| print "#{f.to_s.capitalize.center(width)}" }
36
+ puts
37
+
38
+ each_gateway do |g|
39
+ print "#{g.display_name.ljust(width + 20)}"
40
+ ACTIONS.each do |f|
41
+ print "#{(g.instance_methods.include?(f.to_s) ? "Y" : "N").center(width)}"
42
+ end
43
+ puts
44
+ end
45
+ end
46
+
47
+ def to_rdoc
48
+ each_gateway do |g|
49
+ puts "* {#{g.display_name}}[#{g.homepage_url}] - #{g.supported_countries.join(', ')}"
50
+ end
51
+ end
52
+
53
+ def to_textile
54
+ each_gateway do |g|
55
+ puts %/ * "#{g.display_name}":#{g.homepage_url} [#{g.supported_countries.join(', ')}]/
56
+ end
57
+ end
58
+
59
+ def to_s
60
+ each_gateway do |g|
61
+ puts "#{g.display_name} - #{g.homepage_url} [#{g.supported_countries.join(', ')}]"
62
+ end
63
+ end
64
+ end
65
+
@@ -0,0 +1,25 @@
1
+ require 'uri'
2
+ require 'set'
3
+
4
+ class OutboundHosts
5
+ def self.list
6
+ uris = Set.new
7
+
8
+ Dir['lib/**/*.rb'].each do |file|
9
+ content = File.read(file)
10
+
11
+ content.each_line do |line|
12
+ next if line =~ /homepage_url/
13
+
14
+ if line =~ /("|')(https:\/\/.*)("|')/
15
+ uri = URI.parse($2)
16
+ uris << [uri.host, uri.port]
17
+ end
18
+ end
19
+ end
20
+
21
+ uris.each do |uri|
22
+ puts "#{uri.first} #{uri.last}"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,93 @@
1
+ require 'active_merchant'
2
+ require 'support/gateway_support'
3
+
4
+ class SSLVerify
5
+
6
+ def initialize
7
+ @gateways = GatewaySupport.new.gateways
8
+ end
9
+
10
+ def test_gateways
11
+ success, failed, missing, errored, disabled = [], [], [], [], []
12
+
13
+ puts "Verifying #{@gateways.count} SSL certificates\n\n"
14
+
15
+ @gateways.each do |g|
16
+ if !g.live_url
17
+ missing << g unless g.abstract_class
18
+ next
19
+ end
20
+
21
+ if !g.ssl_strict
22
+ disabled << g
23
+ end
24
+
25
+ uri = URI.parse(g.live_url)
26
+ result,message = ssl_verify_peer?(uri)
27
+ case result
28
+ when :success
29
+ print "."
30
+ success << g
31
+ when :fail
32
+ print "F"
33
+ failed << {:gateway => g, :message => message}
34
+ when :error
35
+ print "E"
36
+ errored << {:gateway => g, :message => message}
37
+ end
38
+ end
39
+
40
+ puts "\n\n\nFailed Gateways:"
41
+ failed.each do |f|
42
+ puts "#{f[:gateway].name} - #{f[:message]}"
43
+ end
44
+
45
+ puts "\n\nError Gateways:"
46
+ errored.each do |e|
47
+ puts "#{e[:gateway].name} - #{e[:message]}"
48
+ end
49
+
50
+ if missing.size > 0
51
+ puts "\n\nGateways missing live_url:"
52
+ missing.each do |m|
53
+ puts m.name
54
+ end
55
+ end
56
+
57
+ if disabled.size > 0
58
+ puts "\n\nGateways with ssl_strict=false:"
59
+ disabled.each do |d|
60
+ puts d.name
61
+ end
62
+ end
63
+
64
+ end
65
+
66
+ def try_host(http, path)
67
+ http.get(path)
68
+ rescue Net::HTTPBadResponse, EOFError, SocketError
69
+ http.post(path, "")
70
+ end
71
+
72
+ def ssl_verify_peer?(uri)
73
+ http = Net::HTTP.new(uri.host, uri.port)
74
+ http.use_ssl = true
75
+ http.ca_file = File.dirname(__FILE__) + '/certs/cacert.pem'
76
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
77
+ http.open_timeout = 60
78
+ http.read_timeout = 60
79
+
80
+ if uri.path.blank?
81
+ try_host(http, "/")
82
+ else
83
+ try_host(http, uri.path)
84
+ end
85
+
86
+ return :success
87
+ rescue OpenSSL::SSL::SSLError => ex
88
+ return :fail, ex.inspect
89
+ rescue Net::HTTPBadResponse, Errno::EHOSTUNREACH, Errno::ETIMEDOUT, EOFError, SocketError, Errno::ECONNREFUSED, Timeout::Error => ex
90
+ return :error, ex.inspect
91
+ end
92
+
93
+ end