tanga_activemerchant 1.37.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +1202 -0
  3. data/CONTRIBUTORS +414 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.md +221 -0
  6. data/gem-public_cert.pem +20 -0
  7. data/lib/active_merchant/billing/avs_result.rb +98 -0
  8. data/lib/active_merchant/billing/base.rb +57 -0
  9. data/lib/active_merchant/billing/check.rb +69 -0
  10. data/lib/active_merchant/billing/credit_card.rb +283 -0
  11. data/lib/active_merchant/billing/credit_card_formatting.rb +21 -0
  12. data/lib/active_merchant/billing/credit_card_methods.rb +143 -0
  13. data/lib/active_merchant/billing/cvv_result.rb +38 -0
  14. data/lib/active_merchant/billing/expiry_date.rb +34 -0
  15. data/lib/active_merchant/billing/gateway.rb +181 -0
  16. data/lib/active_merchant/billing/gateways/authorize_net.rb +725 -0
  17. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +956 -0
  18. data/lib/active_merchant/billing/gateways/balanced.rb +468 -0
  19. data/lib/active_merchant/billing/gateways/banwire.rb +105 -0
  20. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +314 -0
  21. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +15 -0
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +393 -0
  23. data/lib/active_merchant/billing/gateways/beanstream.rb +169 -0
  24. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +54 -0
  25. data/lib/active_merchant/billing/gateways/blue_pay.rb +501 -0
  26. data/lib/active_merchant/billing/gateways/bogus.rb +142 -0
  27. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
  28. data/lib/active_merchant/billing/gateways/braintree.rb +19 -0
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +401 -0
  30. data/lib/active_merchant/billing/gateways/braintree_orange.rb +19 -0
  31. data/lib/active_merchant/billing/gateways/card_save.rb +23 -0
  32. data/lib/active_merchant/billing/gateways/card_stream.rb +225 -0
  33. data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
  34. data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
  35. data/lib/active_merchant/billing/gateways/certo_direct.rb +277 -0
  36. data/lib/active_merchant/billing/gateways/cyber_source.rb +639 -0
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +591 -0
  38. data/lib/active_merchant/billing/gateways/efsnet.rb +230 -0
  39. data/lib/active_merchant/billing/gateways/elavon.rb +312 -0
  40. data/lib/active_merchant/billing/gateways/epay.rb +275 -0
  41. data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
  42. data/lib/active_merchant/billing/gateways/eway.rb +225 -0
  43. data/lib/active_merchant/billing/gateways/eway_managed.rb +291 -0
  44. data/lib/active_merchant/billing/gateways/eway_rapid.rb +320 -0
  45. data/lib/active_merchant/billing/gateways/exact.rb +218 -0
  46. data/lib/active_merchant/billing/gateways/fat_zebra.rb +173 -0
  47. data/lib/active_merchant/billing/gateways/federated_canada.rb +167 -0
  48. data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
  49. data/lib/active_merchant/billing/gateways/first_pay.rb +176 -0
  50. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
  51. data/lib/active_merchant/billing/gateways/garanti.rb +257 -0
  52. data/lib/active_merchant/billing/gateways/hdfc.rb +207 -0
  53. data/lib/active_merchant/billing/gateways/iats_payments.rb +35 -0
  54. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +249 -0
  55. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
  56. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
  57. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +66 -0
  58. data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
  59. data/lib/active_merchant/billing/gateways/instapay.rb +163 -0
  60. data/lib/active_merchant/billing/gateways/iridium.rb +262 -0
  61. data/lib/active_merchant/billing/gateways/itransact.rb +448 -0
  62. data/lib/active_merchant/billing/gateways/jetpay.rb +275 -0
  63. data/lib/active_merchant/billing/gateways/linkpoint.rb +447 -0
  64. data/lib/active_merchant/billing/gateways/litle.rb +554 -0
  65. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +176 -0
  66. data/lib/active_merchant/billing/gateways/merchant_one.rb +115 -0
  67. data/lib/active_merchant/billing/gateways/merchant_ware.rb +322 -0
  68. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +275 -0
  69. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +191 -0
  70. data/lib/active_merchant/billing/gateways/mercury.rb +311 -0
  71. data/lib/active_merchant/billing/gateways/metrics_global.rb +322 -0
  72. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
  73. data/lib/active_merchant/billing/gateways/migs.rb +265 -0
  74. data/lib/active_merchant/billing/gateways/modern_payments.rb +37 -0
  75. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +219 -0
  76. data/lib/active_merchant/billing/gateways/moneris.rb +244 -0
  77. data/lib/active_merchant/billing/gateways/moneris_us.rb +208 -0
  78. data/lib/active_merchant/billing/gateways/nab_transact.rb +277 -0
  79. data/lib/active_merchant/billing/gateways/net_registry.rb +193 -0
  80. data/lib/active_merchant/billing/gateways/netaxept.rb +181 -0
  81. data/lib/active_merchant/billing/gateways/netbilling.rb +197 -0
  82. data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
  83. data/lib/active_merchant/billing/gateways/nmi.rb +20 -0
  84. data/lib/active_merchant/billing/gateways/ogone.rb +421 -0
  85. data/lib/active_merchant/billing/gateways/optimal_payment.rb +297 -0
  86. data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +93 -0
  87. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
  88. data/lib/active_merchant/billing/gateways/orbital.rb +633 -0
  89. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +261 -0
  90. data/lib/active_merchant/billing/gateways/pay_junction.rb +396 -0
  91. data/lib/active_merchant/billing/gateways/pay_secure.rb +119 -0
  92. data/lib/active_merchant/billing/gateways/paybox_direct.rb +196 -0
  93. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +209 -0
  94. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +39 -0
  95. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +13 -0
  96. data/lib/active_merchant/billing/gateways/payflow.rb +268 -0
  97. data/lib/active_merchant/billing/gateways/payflow_express.rb +224 -0
  98. data/lib/active_merchant/billing/gateways/payflow_express_uk.rb +15 -0
  99. data/lib/active_merchant/billing/gateways/payflow_uk.rb +21 -0
  100. data/lib/active_merchant/billing/gateways/payment_express.rb +353 -0
  101. data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
  102. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +670 -0
  103. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +61 -0
  104. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +248 -0
  105. data/lib/active_merchant/billing/gateways/paypal.rb +106 -0
  106. data/lib/active_merchant/billing/gateways/paypal_ca.rb +13 -0
  107. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
  108. data/lib/active_merchant/billing/gateways/paypal_express.rb +239 -0
  109. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +30 -0
  110. data/lib/active_merchant/billing/gateways/paystation.rb +199 -0
  111. data/lib/active_merchant/billing/gateways/payway.rb +207 -0
  112. data/lib/active_merchant/billing/gateways/pin.rb +165 -0
  113. data/lib/active_merchant/billing/gateways/plugnpay.rb +294 -0
  114. data/lib/active_merchant/billing/gateways/psigate.rb +227 -0
  115. data/lib/active_merchant/billing/gateways/psl_card.rb +303 -0
  116. data/lib/active_merchant/billing/gateways/qbms.rb +292 -0
  117. data/lib/active_merchant/billing/gateways/quantum.rb +276 -0
  118. data/lib/active_merchant/billing/gateways/quickpay.rb +335 -0
  119. data/lib/active_merchant/billing/gateways/realex.rb +303 -0
  120. data/lib/active_merchant/billing/gateways/redsys.rb +394 -0
  121. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +93 -0
  122. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +114 -0
  123. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +102 -0
  124. data/lib/active_merchant/billing/gateways/sage.rb +152 -0
  125. data/lib/active_merchant/billing/gateways/sage_pay.rb +324 -0
  126. data/lib/active_merchant/billing/gateways/sallie_mae.rb +143 -0
  127. data/lib/active_merchant/billing/gateways/samurai.rb +118 -0
  128. data/lib/active_merchant/billing/gateways/secure_net.rb +261 -0
  129. data/lib/active_merchant/billing/gateways/secure_pay.rb +28 -0
  130. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +279 -0
  131. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +112 -0
  132. data/lib/active_merchant/billing/gateways/skip_jack.rb +453 -0
  133. data/lib/active_merchant/billing/gateways/smart_ps.rb +272 -0
  134. data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
  135. data/lib/active_merchant/billing/gateways/stripe.rb +316 -0
  136. data/lib/active_merchant/billing/gateways/trans_first.rb +126 -0
  137. data/lib/active_merchant/billing/gateways/transax.rb +23 -0
  138. data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
  139. data/lib/active_merchant/billing/gateways/trust_commerce.rb +421 -0
  140. data/lib/active_merchant/billing/gateways/usa_epay.rb +25 -0
  141. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +1501 -0
  142. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +201 -0
  143. data/lib/active_merchant/billing/gateways/verifi.rb +232 -0
  144. data/lib/active_merchant/billing/gateways/viaklix.rb +189 -0
  145. data/lib/active_merchant/billing/gateways/vindicia.rb +361 -0
  146. data/lib/active_merchant/billing/gateways/webpay.rb +57 -0
  147. data/lib/active_merchant/billing/gateways/wirecard.rb +313 -0
  148. data/lib/active_merchant/billing/gateways/worldpay.rb +303 -0
  149. data/lib/active_merchant/billing/gateways.rb +17 -0
  150. data/lib/active_merchant/billing/integrations/a1agregator/helper.rb +31 -0
  151. data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +186 -0
  152. data/lib/active_merchant/billing/integrations/a1agregator/status.rb +38 -0
  153. data/lib/active_merchant/billing/integrations/a1agregator.rb +26 -0
  154. data/lib/active_merchant/billing/integrations/action_view_helper.rb +73 -0
  155. data/lib/active_merchant/billing/integrations/authorize_net_sim/helper.rb +229 -0
  156. data/lib/active_merchant/billing/integrations/authorize_net_sim/notification.rb +340 -0
  157. data/lib/active_merchant/billing/integrations/authorize_net_sim.rb +38 -0
  158. data/lib/active_merchant/billing/integrations/bogus/helper.rb +17 -0
  159. data/lib/active_merchant/billing/integrations/bogus/notification.rb +11 -0
  160. data/lib/active_merchant/billing/integrations/bogus/return.rb +10 -0
  161. data/lib/active_merchant/billing/integrations/bogus.rb +23 -0
  162. data/lib/active_merchant/billing/integrations/chronopay/helper.rb +120 -0
  163. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +158 -0
  164. data/lib/active_merchant/billing/integrations/chronopay/return.rb +10 -0
  165. data/lib/active_merchant/billing/integrations/chronopay.rb +23 -0
  166. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
  167. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
  168. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
  169. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
  170. data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
  171. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
  172. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
  173. data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
  174. data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
  175. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
  176. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
  177. data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
  178. data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
  179. data/lib/active_merchant/billing/integrations/dwolla/common.rb +23 -0
  180. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +43 -0
  181. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +64 -0
  182. data/lib/active_merchant/billing/integrations/dwolla/return.rb +49 -0
  183. data/lib/active_merchant/billing/integrations/dwolla.rb +23 -0
  184. data/lib/active_merchant/billing/integrations/e_payment_plans/helper.rb +34 -0
  185. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +84 -0
  186. data/lib/active_merchant/billing/integrations/e_payment_plans.rb +48 -0
  187. data/lib/active_merchant/billing/integrations/easy_pay/common.rb +40 -0
  188. data/lib/active_merchant/billing/integrations/easy_pay/helper.rb +36 -0
  189. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +59 -0
  190. data/lib/active_merchant/billing/integrations/easy_pay.rb +30 -0
  191. data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
  192. data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
  193. data/lib/active_merchant/billing/integrations/epay.rb +21 -0
  194. data/lib/active_merchant/billing/integrations/first_data/helper.rb +61 -0
  195. data/lib/active_merchant/billing/integrations/first_data/notification.rb +56 -0
  196. data/lib/active_merchant/billing/integrations/first_data.rb +38 -0
  197. data/lib/active_merchant/billing/integrations/gestpay/common.rb +42 -0
  198. data/lib/active_merchant/billing/integrations/gestpay/helper.rb +70 -0
  199. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +85 -0
  200. data/lib/active_merchant/billing/integrations/gestpay/return.rb +10 -0
  201. data/lib/active_merchant/billing/integrations/gestpay.rb +25 -0
  202. data/lib/active_merchant/billing/integrations/helper.rb +117 -0
  203. data/lib/active_merchant/billing/integrations/hi_trust/helper.rb +58 -0
  204. data/lib/active_merchant/billing/integrations/hi_trust/notification.rb +59 -0
  205. data/lib/active_merchant/billing/integrations/hi_trust/return.rb +67 -0
  206. data/lib/active_merchant/billing/integrations/hi_trust.rb +27 -0
  207. data/lib/active_merchant/billing/integrations/ipay88/helper.rb +114 -0
  208. data/lib/active_merchant/billing/integrations/ipay88/return.rb +95 -0
  209. data/lib/active_merchant/billing/integrations/ipay88.rb +19 -0
  210. data/lib/active_merchant/billing/integrations/liqpay/helper.rb +43 -0
  211. data/lib/active_merchant/billing/integrations/liqpay/notification.rb +89 -0
  212. data/lib/active_merchant/billing/integrations/liqpay/return.rb +83 -0
  213. data/lib/active_merchant/billing/integrations/liqpay.rb +30 -0
  214. data/lib/active_merchant/billing/integrations/maksuturva/helper.rb +119 -0
  215. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +48 -0
  216. data/lib/active_merchant/billing/integrations/maksuturva.rb +86 -0
  217. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +75 -0
  218. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
  219. data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
  220. data/lib/active_merchant/billing/integrations/nochex/helper.rb +68 -0
  221. data/lib/active_merchant/billing/integrations/nochex/notification.rb +94 -0
  222. data/lib/active_merchant/billing/integrations/nochex/return.rb +10 -0
  223. data/lib/active_merchant/billing/integrations/nochex.rb +88 -0
  224. data/lib/active_merchant/billing/integrations/notification.rb +71 -0
  225. data/lib/active_merchant/billing/integrations/paxum/common.rb +24 -0
  226. data/lib/active_merchant/billing/integrations/paxum/helper.rb +42 -0
  227. data/lib/active_merchant/billing/integrations/paxum/notification.rb +33 -0
  228. data/lib/active_merchant/billing/integrations/paxum.rb +44 -0
  229. data/lib/active_merchant/billing/integrations/pay_fast/common.rb +42 -0
  230. data/lib/active_merchant/billing/integrations/pay_fast/helper.rb +50 -0
  231. data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +134 -0
  232. data/lib/active_merchant/billing/integrations/pay_fast/return.rb +10 -0
  233. data/lib/active_merchant/billing/integrations/pay_fast.rb +70 -0
  234. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +116 -0
  235. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +78 -0
  236. data/lib/active_merchant/billing/integrations/payflow_link.rb +21 -0
  237. data/lib/active_merchant/billing/integrations/paypal/helper.rb +119 -0
  238. data/lib/active_merchant/billing/integrations/paypal/notification.rb +227 -0
  239. data/lib/active_merchant/billing/integrations/paypal/return.rb +10 -0
  240. data/lib/active_merchant/billing/integrations/paypal.rb +39 -0
  241. data/lib/active_merchant/billing/integrations/paypal_payments_advanced/helper.rb +15 -0
  242. data/lib/active_merchant/billing/integrations/paypal_payments_advanced.rb +20 -0
  243. data/lib/active_merchant/billing/integrations/paysbuy/helper.rb +15 -0
  244. data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +28 -0
  245. data/lib/active_merchant/billing/integrations/paysbuy.rb +36 -0
  246. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
  247. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +165 -0
  248. data/lib/active_merchant/billing/integrations/payu_in/return.rb +36 -0
  249. data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
  250. data/lib/active_merchant/billing/integrations/platron/helper.rb +32 -0
  251. data/lib/active_merchant/billing/integrations/platron/notification.rb +113 -0
  252. data/lib/active_merchant/billing/integrations/platron.rb +28 -0
  253. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +112 -0
  254. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +157 -0
  255. data/lib/active_merchant/billing/integrations/pxpay/return.rb +25 -0
  256. data/lib/active_merchant/billing/integrations/pxpay.rb +31 -0
  257. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +74 -0
  258. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +137 -0
  259. data/lib/active_merchant/billing/integrations/quickpay.rb +21 -0
  260. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
  261. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
  262. data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
  263. data/lib/active_merchant/billing/integrations/return.rb +42 -0
  264. data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
  265. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
  266. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
  267. data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
  268. data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
  269. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
  270. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +136 -0
  271. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
  272. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
  273. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
  274. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +91 -0
  275. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +139 -0
  276. data/lib/active_merchant/billing/integrations/two_checkout/return.rb +17 -0
  277. data/lib/active_merchant/billing/integrations/two_checkout.rb +44 -0
  278. data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
  279. data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
  280. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +97 -0
  281. data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
  282. data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
  283. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +88 -0
  284. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
  285. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
  286. data/lib/active_merchant/billing/integrations/web_pay/common.rb +50 -0
  287. data/lib/active_merchant/billing/integrations/web_pay/helper.rb +68 -0
  288. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +51 -0
  289. data/lib/active_merchant/billing/integrations/web_pay.rb +45 -0
  290. data/lib/active_merchant/billing/integrations/webmoney/common.rb +17 -0
  291. data/lib/active_merchant/billing/integrations/webmoney/helper.rb +40 -0
  292. data/lib/active_merchant/billing/integrations/webmoney/notification.rb +47 -0
  293. data/lib/active_merchant/billing/integrations/webmoney.rb +43 -0
  294. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +101 -0
  295. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
  296. data/lib/active_merchant/billing/integrations/world_pay.rb +34 -0
  297. data/lib/active_merchant/billing/integrations.rb +17 -0
  298. data/lib/active_merchant/billing/response.rb +77 -0
  299. data/lib/active_merchant/billing.rb +9 -0
  300. data/lib/active_merchant/version.rb +3 -0
  301. data/lib/active_merchant.rb +63 -0
  302. data/lib/activemerchant.rb +1 -0
  303. data/lib/support/gateway_support.rb +65 -0
  304. data/lib/support/outbound_hosts.rb +25 -0
  305. data/lib/support/ssl_verify.rb +93 -0
  306. metadata +506 -0
@@ -0,0 +1,421 @@
1
+ # coding: utf-8
2
+ require 'rexml/document'
3
+
4
+ module ActiveMerchant #:nodoc:
5
+ module Billing #:nodoc:
6
+ # = Ogone DirectLink Gateway
7
+ #
8
+ # DirectLink is the API version of the Ogone Payment Platform. It allows server to server
9
+ # communication between Ogone systems and your e-commerce website.
10
+ #
11
+ # This implementation follows the specification provided in the DirectLink integration
12
+ # guide version 4.3.0 (25 April 2012), available here:
13
+ # https://secure.ogone.com/ncol/Ogone_DirectLink_EN.pdf
14
+ #
15
+ # It also features aliases, which allow to store/unstore credit cards, as specified in
16
+ # the Alias Manager Option guide version 3.2.1 (25 April 2012) available here:
17
+ # https://secure.ogone.com/ncol/Ogone_Alias_EN.pdf
18
+ #
19
+ # It also implements the 3-D Secure feature, as specified in the DirectLink with
20
+ # 3-D Secure guide version 3.0 (25 April 2012) available here:
21
+ # https://secure.ogone.com/ncol/Ogone_DirectLink-3-D_EN.pdf
22
+ #
23
+ # It was last tested on Release 4.92 of Ogone DirectLink + AliasManager + Direct Link 3D
24
+ # (25 April 2012).
25
+ #
26
+ # For any questions or comments, please contact one of the following:
27
+ # - Joel Cogen (joel.cogen@belighted.com)
28
+ # - Nicolas Jacobeus (nicolas.jacobeus@belighted.com),
29
+ # - Sébastien Grosjean (public@zencocoon.com),
30
+ # - Rémy Coutable (remy@jilion.com).
31
+ #
32
+ # == Usage
33
+ #
34
+ # gateway = ActiveMerchant::Billing::OgoneGateway.new(
35
+ # :login => "my_ogone_psp_id",
36
+ # :user => "my_ogone_user_id",
37
+ # :password => "my_ogone_pswd",
38
+ # :signature => "my_ogone_sha_signature", # Only if you configured your Ogone environment so.
39
+ # :signature_encryptor => "sha512", # Can be "none" (default), "sha1", "sha256" or "sha512".
40
+ # # Must be the same as the one configured in your Ogone account.
41
+ # )
42
+ #
43
+ # # set up credit card object as in main ActiveMerchant example
44
+ # creditcard = ActiveMerchant::Billing::CreditCard.new(
45
+ # :type => 'visa',
46
+ # :number => '4242424242424242',
47
+ # :month => 8,
48
+ # :year => 2009,
49
+ # :first_name => 'Bob',
50
+ # :last_name => 'Bobsen'
51
+ # )
52
+ #
53
+ # # run request
54
+ # response = gateway.purchase(1000, creditcard, :order_id => "1") # charge 10 EUR
55
+ #
56
+ # If you don't provide an :order_id, the gateway will generate a random one for you.
57
+ #
58
+ # puts response.success? # Check whether the transaction was successful
59
+ # puts response.message # Retrieve the message returned by Ogone
60
+ # puts response.authorization # Retrieve the unique transaction ID returned by Ogone
61
+ # puts response.order_id # Retrieve the order ID
62
+ #
63
+ # == Alias feature
64
+ #
65
+ # To use the alias feature, simply add :billing_id in the options hash:
66
+ #
67
+ # # Associate the alias to that credit card
68
+ # gateway.purchase(1000, creditcard, :order_id => "1", :billing_id => "myawesomecustomer")
69
+ #
70
+ # # You can use the alias instead of the credit card for subsequent orders
71
+ # gateway.purchase(2000, "myawesomecustomer", :order_id => "2")
72
+ #
73
+ # # You can also create an alias without making a purchase using store
74
+ # gateway.store(creditcard, :billing_id => "myawesomecustomer")
75
+ #
76
+ # # When using store, you can also let Ogone generate the alias for you
77
+ # response = gateway.store(creditcard)
78
+ # puts response.billing_id # Retrieve the generated alias
79
+ #
80
+ # == 3-D Secure feature
81
+ #
82
+ # To use the 3-D Secure feature, simply add :d3d => true in the options hash:
83
+ # gateway.purchase(2000, "myawesomecustomer", :order_id => "2", :d3d => true)
84
+ #
85
+ # Specific 3-D Secure request options are (please refer to the documentation for more infos about these options):
86
+ # :win_3ds => :main_window (default), :pop_up or :pop_ix.
87
+ # :http_accept => "*/*" (default), or any other HTTP_ACCEPT header value.
88
+ # :http_user_agent => The cardholder's User-Agent string
89
+ # :accept_url => URL of the web page to show the customer when the payment is authorized.
90
+ # (or waiting to be authorized).
91
+ # :decline_url => URL of the web page to show the customer when the acquirer rejects the authorization
92
+ # more than the maximum permitted number of authorization attempts (10 by default, but can
93
+ # be changed in the "Global transaction parameters" tab, "Payment retry" section of the
94
+ # Technical Information page).
95
+ # :exception_url => URL of the web page to show the customer when the payment result is uncertain.
96
+ # :paramplus => Field to submit the miscellaneous parameters and their values that you wish to be
97
+ # returned in the post sale request or final redirection.
98
+ # :complus => Field to submit a value you wish to be returned in the post sale request or output.
99
+ # :language => Customer's language, for example: "en_EN"
100
+ #
101
+ class OgoneGateway < Gateway
102
+ CVV_MAPPING = { 'OK' => 'M',
103
+ 'KO' => 'N',
104
+ 'NO' => 'P' }
105
+
106
+ AVS_MAPPING = { 'OK' => 'M',
107
+ 'KO' => 'N',
108
+ 'NO' => 'R' }
109
+
110
+ SUCCESS_MESSAGE = "The transaction was successful"
111
+
112
+ THREE_D_SECURE_DISPLAY_WAYS = { :main_window => 'MAINW', # display the identification page in the main window
113
+ # (default value).
114
+ :pop_up => 'POPUP', # display the identification page in a pop-up window
115
+ # and return to the main window at the end.
116
+ :pop_ix => 'POPIX' } # display the identification page in a pop-up window
117
+ # and remain in the pop-up window.
118
+
119
+ OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE = "Signature usage will be the default for a future release of ActiveMerchant. You should either begin using it, or update your configuration to explicitly disable it (signature_encryptor: none)"
120
+ OGONE_STORE_OPTION_DEPRECATION_MESSAGE = "The 'store' option has been renamed to 'billing_id', and its usage is deprecated."
121
+
122
+ self.test_url = "https://secure.ogone.com/ncol/test/"
123
+ self.live_url = "https://secure.ogone.com/ncol/prod/"
124
+
125
+ self.supported_countries = ['BE', 'DE', 'FR', 'NL', 'AT', 'CH']
126
+ # also supports Airplus and UATP
127
+ self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro]
128
+ self.homepage_url = 'http://www.ogone.com/'
129
+ self.display_name = 'Ogone'
130
+ self.default_currency = 'EUR'
131
+ self.money_format = :cents
132
+
133
+ def initialize(options = {})
134
+ requires!(options, :login, :user, :password)
135
+ super
136
+ end
137
+
138
+ # Verify and reserve the specified amount on the account, without actually doing the transaction.
139
+ def authorize(money, payment_source, options = {})
140
+ post = {}
141
+ add_invoice(post, options)
142
+ add_payment_source(post, payment_source, options)
143
+ add_address(post, payment_source, options)
144
+ add_customer_data(post, options)
145
+ add_money(post, money, options)
146
+ commit('RES', post)
147
+ end
148
+
149
+ # Verify and transfer the specified amount.
150
+ def purchase(money, payment_source, options = {})
151
+ post = {}
152
+ action = options[:action] || 'SAL'
153
+ add_invoice(post, options)
154
+ add_payment_source(post, payment_source, options)
155
+ add_address(post, payment_source, options)
156
+ add_customer_data(post, options)
157
+ add_money(post, money, options)
158
+ commit(action, post)
159
+ end
160
+
161
+ # Complete a previously authorized transaction.
162
+ def capture(money, authorization, options = {})
163
+ post = {}
164
+ action = options[:action] || 'SAL'
165
+ add_authorization(post, reference_from(authorization))
166
+ add_invoice(post, options)
167
+ add_customer_data(post, options)
168
+ add_money(post, money, options)
169
+ commit(action, post)
170
+ end
171
+
172
+ # Cancels a previously authorized transaction.
173
+ def void(identification, options = {})
174
+ post = {}
175
+ add_authorization(post, reference_from(identification))
176
+ commit('DES', post)
177
+ end
178
+
179
+ # Credit the specified account by a specific amount.
180
+ def credit(money, identification_or_credit_card, options = {})
181
+ if reference_transaction?(identification_or_credit_card)
182
+ deprecated CREDIT_DEPRECATION_MESSAGE
183
+ # Referenced credit: refund of a settled transaction
184
+ refund(money, identification_or_credit_card, options)
185
+ else # must be a credit card or card reference
186
+ perform_non_referenced_credit(money, identification_or_credit_card, options)
187
+ end
188
+ end
189
+
190
+ # Refund of a settled transaction
191
+ def refund(money, reference, options = {})
192
+ perform_reference_credit(money, reference, options)
193
+ end
194
+
195
+ # Store a credit card by creating an Ogone Alias
196
+ def store(payment_source, options = {})
197
+ options.merge!(:alias_operation => 'BYPSP') unless(options.has_key?(:billing_id) || options.has_key?(:store))
198
+ response = authorize(1, payment_source, options)
199
+ void(response.authorization) if response.success?
200
+ response
201
+ end
202
+
203
+ private
204
+
205
+ def reference_from(authorization)
206
+ authorization.split(";").first
207
+ end
208
+
209
+ def reference_transaction?(identifier)
210
+ return false unless identifier.is_a?(String)
211
+ _, action = identifier.split(";")
212
+ !action.nil?
213
+ end
214
+
215
+ def perform_reference_credit(money, payment_target, options = {})
216
+ post = {}
217
+ add_authorization(post, reference_from(payment_target))
218
+ add_money(post, money, options)
219
+ commit('RFD', post)
220
+ end
221
+
222
+ def perform_non_referenced_credit(money, payment_target, options = {})
223
+ # Non-referenced credit: acts like a reverse purchase
224
+ post = {}
225
+ add_invoice(post, options)
226
+ add_payment_source(post, payment_target, options)
227
+ add_address(post, payment_target, options)
228
+ add_customer_data(post, options)
229
+ add_money(post, money, options)
230
+ commit('RFD', post)
231
+ end
232
+
233
+ def add_payment_source(post, payment_source, options)
234
+ if payment_source.is_a?(String)
235
+ add_alias(post, payment_source, options[:alias_operation])
236
+ add_eci(post, options[:eci] || '9')
237
+ else
238
+ if options.has_key?(:store)
239
+ deprecated OGONE_STORE_OPTION_DEPRECATION_MESSAGE
240
+ options[:billing_id] ||= options[:store]
241
+ end
242
+ add_alias(post, options[:billing_id], options[:alias_operation])
243
+ add_eci(post, options[:eci] || '7')
244
+ add_d3d(post, options) if options[:d3d]
245
+ add_creditcard(post, payment_source)
246
+ end
247
+ end
248
+
249
+ def add_d3d(post, options)
250
+ add_pair post, 'FLAG3D', 'Y'
251
+ win_3ds = THREE_D_SECURE_DISPLAY_WAYS.key?(options[:win_3ds]) ?
252
+ THREE_D_SECURE_DISPLAY_WAYS[options[:win_3ds]] :
253
+ THREE_D_SECURE_DISPLAY_WAYS[:main_window]
254
+ add_pair post, 'WIN3DS', win_3ds
255
+
256
+ add_pair post, 'HTTP_ACCEPT', options[:http_accept] || "*/*"
257
+ add_pair post, 'HTTP_USER_AGENT', options[:http_user_agent] if options[:http_user_agent]
258
+ add_pair post, 'ACCEPTURL', options[:accept_url] if options[:accept_url]
259
+ add_pair post, 'DECLINEURL', options[:decline_url] if options[:decline_url]
260
+ add_pair post, 'EXCEPTIONURL', options[:exception_url] if options[:exception_url]
261
+ add_pair post, 'PARAMPLUS', options[:paramplus] if options[:paramplus]
262
+ add_pair post, 'COMPLUS', options[:complus] if options[:complus]
263
+ add_pair post, 'LANGUAGE', options[:language] if options[:language]
264
+ end
265
+
266
+ def add_eci(post, eci)
267
+ add_pair post, 'ECI', eci.to_s
268
+ end
269
+
270
+ def add_alias(post, _alias, alias_operation = nil)
271
+ add_pair post, 'ALIAS', _alias
272
+ add_pair post, 'ALIASOPERATION', alias_operation unless alias_operation.nil?
273
+ end
274
+
275
+ def add_authorization(post, authorization)
276
+ add_pair post, 'PAYID', authorization
277
+ end
278
+
279
+ def add_money(post, money, options)
280
+ add_pair post, 'currency', options[:currency] || @options[:currency] || currency(money)
281
+ add_pair post, 'amount', amount(money)
282
+ end
283
+
284
+ def add_customer_data(post, options)
285
+ add_pair post, 'EMAIL', options[:email]
286
+ add_pair post, 'REMOTE_ADDR', options[:ip]
287
+ end
288
+
289
+ def add_address(post, creditcard, options)
290
+ return unless options[:billing_address]
291
+ add_pair post, 'Owneraddress', options[:billing_address][:address1]
292
+ add_pair post, 'OwnerZip', options[:billing_address][:zip]
293
+ add_pair post, 'ownertown', options[:billing_address][:city]
294
+ add_pair post, 'ownercty', options[:billing_address][:country]
295
+ add_pair post, 'ownertelno', options[:billing_address][:phone]
296
+ end
297
+
298
+ def add_invoice(post, options)
299
+ add_pair post, 'orderID', options[:order_id] || generate_unique_id[0...30]
300
+ add_pair post, 'COM', options[:description]
301
+ end
302
+
303
+ def add_creditcard(post, creditcard)
304
+ add_pair post, 'CN', creditcard.name
305
+ add_pair post, 'CARDNO', creditcard.number
306
+ add_pair post, 'ED', "%02d%02s" % [creditcard.month, creditcard.year.to_s[-2..-1]]
307
+ add_pair post, 'CVC', creditcard.verification_value
308
+ end
309
+
310
+ def parse(body)
311
+ xml_root = REXML::Document.new(body).root
312
+ response = convert_attributes_to_hash(xml_root.attributes)
313
+
314
+ # Add HTML_ANSWER element (3-D Secure specific to the response's params)
315
+ # Note: HTML_ANSWER is not an attribute so we add it "by hand" to the response
316
+ if html_answer = REXML::XPath.first(xml_root, "//HTML_ANSWER")
317
+ response["HTML_ANSWER"] = html_answer.text
318
+ end
319
+
320
+ response
321
+ end
322
+
323
+ def commit(action, parameters)
324
+ add_pair parameters, 'PSPID', @options[:login]
325
+ add_pair parameters, 'USERID', @options[:user]
326
+ add_pair parameters, 'PSWD', @options[:password]
327
+
328
+ response = parse(ssl_post(url(parameters['PAYID']), post_data(action, parameters)))
329
+
330
+ options = {
331
+ :authorization => [response["PAYID"], action].join(";"),
332
+ :test => test?,
333
+ :avs_result => { :code => AVS_MAPPING[response["AAVCheck"]] },
334
+ :cvv_result => CVV_MAPPING[response["CVCCheck"]]
335
+ }
336
+ OgoneResponse.new(successful?(response), message_from(response), response, options)
337
+ end
338
+
339
+ def url(payid)
340
+ (test? ? test_url : live_url) + (payid ? "maintenancedirect.asp" : "orderdirect.asp")
341
+ end
342
+
343
+ def successful?(response)
344
+ response["NCERROR"] == "0"
345
+ end
346
+
347
+ def message_from(response)
348
+ if successful?(response)
349
+ SUCCESS_MESSAGE
350
+ else
351
+ format_error_message(response["NCERRORPLUS"])
352
+ end
353
+ end
354
+
355
+ def format_error_message(message)
356
+ raw_message = message.to_s.strip
357
+ case raw_message
358
+ when /\|/
359
+ raw_message.split("|").join(", ").capitalize
360
+ when /\//
361
+ raw_message.split("/").first.to_s.capitalize
362
+ else
363
+ raw_message.to_s.capitalize
364
+ end
365
+ end
366
+
367
+ def post_data(action, parameters = {})
368
+ add_pair parameters, 'Operation', action
369
+ add_signature(parameters)
370
+ parameters.to_query
371
+ end
372
+
373
+ def add_signature(parameters)
374
+ if @options[:signature].blank?
375
+ deprecated(OGONE_NO_SIGNATURE_DEPRECATION_MESSAGE) unless(@options[:signature_encryptor] == "none")
376
+ return
377
+ end
378
+
379
+ sha_encryptor = case @options[:signature_encryptor]
380
+ when 'sha256'
381
+ Digest::SHA256
382
+ when 'sha512'
383
+ Digest::SHA512
384
+ else
385
+ Digest::SHA1
386
+ end
387
+
388
+ string_to_digest = if @options[:signature_encryptor]
389
+ parameters.sort { |a, b| a[0].upcase <=> b[0].upcase }.map { |k, v| "#{k.upcase}=#{v}" }.join(@options[:signature])
390
+ else
391
+ %w[orderID amount currency CARDNO PSPID Operation ALIAS].map { |key| parameters[key] }.join
392
+ end
393
+ string_to_digest << @options[:signature]
394
+
395
+ add_pair parameters, 'SHASign', sha_encryptor.hexdigest(string_to_digest).upcase
396
+ end
397
+
398
+ def add_pair(post, key, value)
399
+ post[key] = value if !value.blank?
400
+ end
401
+
402
+ def convert_attributes_to_hash(rexml_attributes)
403
+ response_hash = {}
404
+ rexml_attributes.each do |key, value|
405
+ response_hash[key] = value
406
+ end
407
+ response_hash
408
+ end
409
+ end
410
+
411
+ class OgoneResponse < Response
412
+ def order_id
413
+ @params['orderID']
414
+ end
415
+
416
+ def billing_id
417
+ @params['ALIAS']
418
+ end
419
+ end
420
+ end
421
+ end