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,276 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ # ActiveMerchant Implementation for Quantum Gateway XML Requester Service
4
+ # Based on API Doc from 8/6/2009
5
+ #
6
+ # Important Notes
7
+ # * Support is included for a customer id via the :customer option, invoice number via :invoice option, invoice description via :merchant option and memo via :description option
8
+ # * You can force email of receipt with :email_receipt => true
9
+ # * You can force email of merchant receipt with :merchant_receipt => true
10
+ # * You can exclude CVV with :ignore_cvv => true
11
+ # * All transactions use dollar values.
12
+ class QuantumGateway < Gateway
13
+ self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
14
+
15
+ # visa, master, american_express, discover
16
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
17
+ self.supported_countries = ['US']
18
+ self.default_currency = 'USD'
19
+ self.money_format = :dollars
20
+ self.homepage_url = 'http://www.quantumgateway.com'
21
+ self.display_name = 'Quantum Gateway'
22
+
23
+ # These are the options that can be used when creating a new Quantum Gateway object.
24
+ #
25
+ # :login => Your Quantum Gateway Gateway ID
26
+ #
27
+ # :password => Your Quantum Gateway Vault Key or Restrict Key
28
+ #
29
+ # NOTE: For testing supply your test GatewayLogin and GatewayKey
30
+ #
31
+ # :email_receipt => true if you want a receipt sent to the customer (false be default)
32
+ #
33
+ # :merchant_receipt => true if you want to override receiving the merchant receipt
34
+ #
35
+ # :ignore_avs => true ignore both AVS and CVV verification
36
+ # :ignore_cvv => true don't want to use CVV so continue processing even if CVV would have failed
37
+ #
38
+ def initialize(options = {})
39
+ requires!(options, :login, :password)
40
+ super
41
+ end
42
+
43
+ # Request an authorization for an amount from CyberSource
44
+ #
45
+ def authorize(money, creditcard, options = {})
46
+ setup_address_hash(options)
47
+ commit(build_auth_request(money, creditcard, options), options )
48
+ end
49
+
50
+ # Capture an authorization that has previously been requested
51
+ def capture(money, authorization, options = {})
52
+ setup_address_hash(options)
53
+ commit(build_capture_request(money, authorization, options), options)
54
+ end
55
+
56
+ # Purchase is an auth followed by a capture
57
+ # You must supply an order_id in the options hash
58
+ def purchase(money, creditcard, options = {})
59
+ setup_address_hash(options)
60
+ commit(build_purchase_request(money, creditcard, options), options)
61
+ end
62
+
63
+ def void(identification, options = {})
64
+ commit(build_void_request(identification, options), options)
65
+ end
66
+
67
+ def refund(money, identification, options = {})
68
+ commit(build_credit_request(money, identification, options), options)
69
+ end
70
+
71
+ def credit(money, identification, options = {})
72
+ deprecated CREDIT_DEPRECATION_MESSAGE
73
+ refund(money, identification, options)
74
+ end
75
+
76
+ private
77
+
78
+ def setup_address_hash(options)
79
+ options[:billing_address] = options[:billing_address] || options[:address] || {}
80
+ end
81
+
82
+ def build_auth_request(money, creditcard, options)
83
+ xml = Builder::XmlMarkup.new
84
+ add_common_credit_card_info(xml,'AUTH_ONLY')
85
+ add_purchase_data(xml, money)
86
+ add_creditcard(xml, creditcard)
87
+ add_address(xml, creditcard, options[:billing_address], options)
88
+ add_invoice_details(xml, options)
89
+ add_customer_details(xml, options)
90
+ add_memo(xml, options)
91
+ add_business_rules_data(xml)
92
+ xml.target!
93
+ end
94
+
95
+ def build_capture_request(money, authorization, options)
96
+ xml = Builder::XmlMarkup.new
97
+ add_common_credit_card_info(xml,'PREVIOUS_SALE')
98
+ transaction_id, _ = authorization_parts_from(authorization)
99
+ add_transaction_id(xml, transaction_id)
100
+ xml.target!
101
+ end
102
+
103
+ def build_purchase_request(money, creditcard, options)
104
+ xml = Builder::XmlMarkup.new
105
+ add_common_credit_card_info(xml, @options[:ignore_avs] || @options[:ignore_cvv] ? 'SALES' : 'AUTH_CAPTURE')
106
+ add_address(xml, creditcard, options[:billing_address], options)
107
+ add_purchase_data(xml, money)
108
+ add_creditcard(xml, creditcard)
109
+ add_invoice_details(xml, options)
110
+ add_customer_details(xml, options)
111
+ add_memo(xml, options)
112
+ add_business_rules_data(xml)
113
+ xml.target!
114
+ end
115
+
116
+ def build_void_request(authorization, options)
117
+ xml = Builder::XmlMarkup.new
118
+ add_common_credit_card_info(xml,'VOID')
119
+ transaction_id, _ = authorization_parts_from(authorization)
120
+ add_transaction_id(xml, transaction_id)
121
+ xml.target!
122
+ end
123
+
124
+ def build_credit_request(money, authorization, options)
125
+ xml = Builder::XmlMarkup.new
126
+ add_common_credit_card_info(xml,'RETURN')
127
+ add_purchase_data(xml, money)
128
+ transaction_id, cc = authorization_parts_from(authorization)
129
+ add_transaction_id(xml, transaction_id)
130
+ xml.tag! 'CreditCardNumber', cc
131
+ xml.target!
132
+ end
133
+
134
+ def add_common_credit_card_info(xml, process_type)
135
+ xml.tag! 'RequestType', 'ProcessSingleTransaction'
136
+ xml.tag! 'TransactionType', 'CREDIT'
137
+ xml.tag! 'PaymentType', 'CC'
138
+ xml.tag! 'ProcessType', process_type
139
+ end
140
+
141
+ def add_business_rules_data(xml)
142
+ xml.tag!('CustomerEmail', @options[:email_receipt] ? 'Y' : 'N')
143
+ xml.tag!('MerchantEmail', @options[:merchant_receipt] ? 'Y' : 'N')
144
+ end
145
+
146
+ def add_invoice_details(xml, options)
147
+ xml.tag! 'InvoiceNumber', options[:invoice]
148
+ xml.tag! 'InvoiceDescription', options[:merchant]
149
+ end
150
+
151
+ def add_customer_details(xml, options)
152
+ xml.tag! 'CustomerID', options[:customer]
153
+ end
154
+
155
+ def add_transaction_id(xml, transaction_id)
156
+ xml.tag! 'TransactionID', transaction_id
157
+ end
158
+
159
+ def add_memo(xml, options)
160
+ xml.tag! 'Memo', options[:description]
161
+ end
162
+
163
+ def add_purchase_data(xml, money = 0)
164
+ xml.tag! 'Amount', amount(money)
165
+ xml.tag! 'TransactionDate', Time.now
166
+ end
167
+
168
+ def add_address(xml, creditcard, address, options, shipTo = false)
169
+ xml.tag! 'FirstName', creditcard.first_name
170
+ xml.tag! 'LastName', creditcard.last_name
171
+ xml.tag! 'Address', address[:address1] # => there is no support for address2 in quantum
172
+ xml.tag! 'City', address[:city]
173
+ xml.tag! 'State', address[:state]
174
+ xml.tag! 'ZipCode', address[:zip]
175
+ xml.tag! 'Country', address[:country]
176
+ xml.tag! 'EmailAddress', options[:email]
177
+ xml.tag! 'IPAddress', options[:ip]
178
+ end
179
+
180
+ def add_creditcard(xml, creditcard)
181
+ xml.tag! 'PaymentType', 'CC'
182
+ xml.tag! 'CreditCardNumber', creditcard.number
183
+ xml.tag! 'ExpireMonth', format(creditcard.month, :two_digits)
184
+ xml.tag! 'ExpireYear', format(creditcard.year, :four_digits)
185
+ xml.tag!('CVV2', creditcard.verification_value) unless (@options[:ignore_cvv] || creditcard.verification_value.blank? )
186
+ end
187
+
188
+ # Where we actually build the full SOAP request using builder
189
+ def build_request(body, options)
190
+ xml = Builder::XmlMarkup.new
191
+ xml.instruct!
192
+ xml.tag! 'QGWRequest' do
193
+ xml.tag! 'Authentication' do
194
+ xml.tag! 'GatewayLogin', @options[:login]
195
+ xml.tag! 'GatewayKey', @options[:password]
196
+ end
197
+ xml.tag! 'Request' do
198
+ xml << body
199
+ end
200
+ end
201
+ xml.target!
202
+ end
203
+
204
+ # Contact CyberSource, make the SOAP request, and parse the reply into a Response object
205
+ def commit(request, options)
206
+ headers = { 'Content-Type' => 'text/xml' }
207
+ response = parse(ssl_post(self.live_url, build_request(request, options), headers))
208
+
209
+ success = response[:request_status] == "Success"
210
+ message = response[:request_message]
211
+
212
+ if success # => checking for connectivity success first
213
+ success = %w(APPROVED FORCED VOIDED).include?(response[:Status])
214
+ message = response[:StatusDescription]
215
+ authorization = success ? authorization_for(response) : nil
216
+ end
217
+
218
+ Response.new(success, message, response,
219
+ :test => test?,
220
+ :authorization => authorization,
221
+ :avs_result => { :code => response[:AVSResponseCode] },
222
+ :cvv_result => response[:CVV2ResponseCode]
223
+ )
224
+ end
225
+
226
+ # Parse the SOAP response
227
+ # Technique inspired by the Paypal Gateway
228
+ def parse(xml)
229
+ reply = {}
230
+
231
+ begin
232
+ xml = REXML::Document.new(xml)
233
+
234
+ root = REXML::XPath.first(xml, "//QGWRequest/ResponseSummary")
235
+ parse_element(reply, root)
236
+ reply[:request_status] = reply[:Status]
237
+ reply[:request_message] = "#{reply[:Status]}: #{reply[:StatusDescription]}"
238
+
239
+ if root = REXML::XPath.first(xml, "//QGWRequest/Result")
240
+ root.elements.to_a.each do |node|
241
+ parse_element(reply, node)
242
+ end
243
+ end
244
+ rescue Exception => e
245
+ reply[:request_status] = 'Failure'
246
+ reply[:request_message] = "Failure: There was a problem parsing the response XML"
247
+ end
248
+
249
+ return reply
250
+ end
251
+
252
+ def parse_element(reply, node)
253
+ if node.has_elements?
254
+ node.elements.each{|e| parse_element(reply, e) }
255
+ else
256
+ if node.parent.name =~ /item/
257
+ parent = node.parent.name + (node.parent.attributes["id"] ? "_" + node.parent.attributes["id"] : '')
258
+ reply[(parent + '_' + node.name).to_sym] = node.text
259
+ else
260
+ reply[node.name.to_sym] = node.text
261
+ end
262
+ end
263
+ return reply
264
+ end
265
+
266
+ def authorization_for(reply)
267
+ "#{reply[:TransactionID]};#{reply[:CreditCardNumber]}"
268
+ end
269
+
270
+ def authorization_parts_from(authorization)
271
+ authorization.split(/;/)
272
+ end
273
+
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,335 @@
1
+ require 'rexml/document'
2
+ require 'digest/md5'
3
+
4
+ module ActiveMerchant #:nodoc:
5
+ module Billing #:nodoc:
6
+ class QuickpayGateway < Gateway
7
+ self.live_url = self.test_url = 'https://secure.quickpay.dk/api'
8
+
9
+ self.default_currency = 'DKK'
10
+ self.money_format = :cents
11
+ self.supported_cardtypes = [:dankort, :forbrugsforeningen, :visa, :master, :american_express, :diners_club, :jcb, :maestro]
12
+ self.supported_countries = ['DK', 'SE']
13
+ self.homepage_url = 'http://quickpay.dk/'
14
+ self.display_name = 'Quickpay'
15
+
16
+ MD5_CHECK_FIELDS = {
17
+ 3 => {
18
+ :authorize => %w(protocol msgtype merchant ordernumber amount
19
+ currency autocapture cardnumber expirationdate
20
+ cvd cardtypelock testmode),
21
+
22
+ :capture => %w(protocol msgtype merchant amount transaction),
23
+
24
+ :cancel => %w(protocol msgtype merchant transaction),
25
+
26
+ :refund => %w(protocol msgtype merchant amount transaction),
27
+
28
+ :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
29
+ expirationdate cvd cardtypelock description testmode),
30
+
31
+ :recurring => %w(protocol msgtype merchant ordernumber amount
32
+ currency autocapture transaction),
33
+
34
+ :status => %w(protocol msgtype merchant transaction),
35
+
36
+ :chstatus => %w(protocol msgtype merchant)
37
+ },
38
+
39
+ 4 => {
40
+ :authorize => %w(protocol msgtype merchant ordernumber amount
41
+ currency autocapture cardnumber expirationdate cvd
42
+ cardtypelock testmode fraud_remote_addr
43
+ fraud_http_accept fraud_http_accept_language
44
+ fraud_http_accept_encoding fraud_http_accept_charset
45
+ fraud_http_referer fraud_http_user_agent apikey),
46
+
47
+ :capture => %w(protocol msgtype merchant amount transaction apikey),
48
+
49
+ :cancel => %w(protocol msgtype merchant transaction apikey),
50
+
51
+ :refund => %w(protocol msgtype merchant amount transaction apikey),
52
+
53
+ :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
54
+ expirationdate cvd cardtypelock description testmode
55
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
56
+ fraud_http_accept_encoding fraud_http_accept_charset
57
+ fraud_http_referer fraud_http_user_agent apikey),
58
+
59
+ :recurring => %w(protocol msgtype merchant ordernumber amount currency
60
+ autocapture transaction apikey),
61
+
62
+ :status => %w(protocol msgtype merchant transaction apikey),
63
+
64
+ :chstatus => %w(protocol msgtype merchant apikey)
65
+ },
66
+
67
+ 5 => {
68
+ :authorize => %w(protocol msgtype merchant ordernumber amount
69
+ currency autocapture cardnumber expirationdate cvd
70
+ cardtypelock testmode fraud_remote_addr
71
+ fraud_http_accept fraud_http_accept_language
72
+ fraud_http_accept_encoding fraud_http_accept_charset
73
+ fraud_http_referer fraud_http_user_agent apikey),
74
+
75
+ :capture => %w(protocol msgtype merchant amount transaction apikey),
76
+
77
+ :cancel => %w(protocol msgtype merchant transaction apikey),
78
+
79
+ :refund => %w(protocol msgtype merchant amount transaction apikey),
80
+
81
+ :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
82
+ expirationdate cvd cardtypelock description testmode
83
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
84
+ fraud_http_accept_encoding fraud_http_accept_charset
85
+ fraud_http_referer fraud_http_user_agent apikey),
86
+
87
+ :recurring => %w(protocol msgtype merchant ordernumber amount currency
88
+ autocapture transaction apikey),
89
+
90
+ :status => %w(protocol msgtype merchant transaction apikey),
91
+
92
+ :chstatus => %w(protocol msgtype merchant apikey)
93
+ },
94
+
95
+ 6 => {
96
+ :authorize => %w(protocol msgtype merchant ordernumber amount
97
+ currency autocapture cardnumber expirationdate cvd
98
+ cardtypelock testmode fraud_remote_addr
99
+ fraud_http_accept fraud_http_accept_language
100
+ fraud_http_accept_encoding fraud_http_accept_charset
101
+ fraud_http_referer fraud_http_user_agent apikey),
102
+
103
+ :capture => %w(protocol msgtype merchant amount transaction
104
+ apikey),
105
+
106
+ :cancel => %w(protocol msgtype merchant transaction apikey),
107
+
108
+ :refund => %w(protocol msgtype merchant amount transaction apikey),
109
+
110
+ :subscribe => %w(protocol msgtype merchant ordernumber cardnumber
111
+ expirationdate cvd cardtypelock description testmode
112
+ fraud_remote_addr fraud_http_accept fraud_http_accept_language
113
+ fraud_http_accept_encoding fraud_http_accept_charset
114
+ fraud_http_referer fraud_http_user_agent apikey),
115
+
116
+ :recurring => %w(protocol msgtype merchant ordernumber amount currency
117
+ autocapture transaction apikey),
118
+
119
+ :status => %w(protocol msgtype merchant transaction apikey),
120
+
121
+ :chstatus => %w(protocol msgtype merchant apikey)
122
+ }
123
+ }
124
+
125
+ APPROVED = '000'
126
+
127
+ # The login is the QuickpayId
128
+ # The password is the md5checkword from the Quickpay manager
129
+ # To use the API-key from the Quickpay manager, specify :api-key
130
+ # Using the API-key, requires that you use version 4+. Specify :version => 4/5/6 in options.
131
+ def initialize(options = {})
132
+ requires!(options, :login, :password)
133
+ @protocol = options.delete(:version) || 3 # default to protocol version 3
134
+ super
135
+ end
136
+
137
+ def authorize(money, credit_card_or_reference, options = {})
138
+ post = {}
139
+
140
+ action = recurring_or_authorize(credit_card_or_reference)
141
+
142
+ add_amount(post, money, options)
143
+ add_invoice(post, options)
144
+ add_creditcard_or_reference(post, credit_card_or_reference, options)
145
+ add_autocapture(post, false)
146
+ add_fraud_parameters(post, options) if action.eql?(:authorize)
147
+ add_testmode(post)
148
+
149
+ commit(action, post)
150
+ end
151
+
152
+ def purchase(money, credit_card_or_reference, options = {})
153
+ post = {}
154
+
155
+ action = recurring_or_authorize(credit_card_or_reference)
156
+
157
+ add_amount(post, money, options)
158
+ add_creditcard_or_reference(post, credit_card_or_reference, options)
159
+ add_invoice(post, options)
160
+ add_fraud_parameters(post, options) if action.eql?(:authorize)
161
+ add_autocapture(post, true)
162
+
163
+ commit(action, post)
164
+ end
165
+
166
+ def capture(money, authorization, options = {})
167
+ post = {}
168
+
169
+ add_reference(post, authorization)
170
+ add_amount_without_currency(post, money)
171
+ commit(:capture, post)
172
+ end
173
+
174
+ def void(identification, options = {})
175
+ post = {}
176
+
177
+ add_reference(post, identification)
178
+
179
+ commit(:cancel, post)
180
+ end
181
+
182
+ def refund(money, identification, options = {})
183
+ post = {}
184
+
185
+ add_amount_without_currency(post, money)
186
+ add_reference(post, identification)
187
+
188
+ commit(:refund, post)
189
+ end
190
+
191
+ def credit(money, identification, options = {})
192
+ deprecated CREDIT_DEPRECATION_MESSAGE
193
+ refund(money, identification, options)
194
+ end
195
+
196
+ def store(creditcard, options = {})
197
+ post = {}
198
+
199
+ add_creditcard(post, creditcard, options)
200
+ add_invoice(post, options)
201
+ add_description(post, options)
202
+ add_fraud_parameters(post, options)
203
+ add_testmode(post)
204
+
205
+ commit(:subscribe, post)
206
+ end
207
+
208
+ private
209
+
210
+ def add_amount(post, money, options = {})
211
+ post[:amount] = amount(money)
212
+ post[:currency] = options[:currency] || currency(money)
213
+ end
214
+
215
+ def add_amount_without_currency(post, money, options = {})
216
+ post[:amount] = amount(money)
217
+ end
218
+
219
+ def add_invoice(post, options)
220
+ post[:ordernumber] = format_order_number(options[:order_id])
221
+ end
222
+
223
+ def add_creditcard(post, credit_card, options)
224
+ post[:cardnumber] = credit_card.number
225
+ post[:cvd] = credit_card.verification_value
226
+ post[:expirationdate] = expdate(credit_card)
227
+ post[:cardtypelock] = options[:cardtypelock] unless options[:cardtypelock].blank?
228
+ end
229
+
230
+ def add_reference(post, identification)
231
+ post[:transaction] = identification
232
+ end
233
+
234
+ def add_creditcard_or_reference(post, credit_card_or_reference, options)
235
+ if credit_card_or_reference.is_a?(String)
236
+ add_reference(post, credit_card_or_reference)
237
+ else
238
+ add_creditcard(post, credit_card_or_reference, options)
239
+ end
240
+ end
241
+
242
+ def add_autocapture(post, autocapture)
243
+ post[:autocapture] = autocapture ? 1 : 0
244
+ end
245
+
246
+ def recurring_or_authorize(credit_card_or_reference)
247
+ credit_card_or_reference.is_a?(String) ? :recurring : :authorize
248
+ end
249
+
250
+ def add_description(post, options)
251
+ post[:description] = options[:description]
252
+ end
253
+
254
+ def add_testmode(post)
255
+ return if post[:transaction].present?
256
+ post[:testmode] = test? ? '1' : '0'
257
+ end
258
+
259
+ def add_fraud_parameters(post, options)
260
+ if @protocol >= 4
261
+ post[:fraud_remote_addr] = options[:fraud_remote_addr] if options[:fraud_remote_addr]
262
+ post[:fraud_http_accept] = options[:fraud_http_accept] if options[:fraud_http_accept]
263
+ post[:fraud_http_accept_language] = options[:fraud_http_accept_language] if options[:fraud_http_accept_language]
264
+ post[:fraud_http_accept_encoding] = options[:fraud_http_accept_encoding] if options[:fraud_http_accept_encoding]
265
+ post[:fraud_http_accept_charset] = options[:fraud_http_accept_charset] if options[:fraud_http_accept_charset]
266
+ post[:fraud_http_referer] = options[:fraud_http_referer] if options[:fraud_http_referer]
267
+ post[:fraud_http_user_agent] = options[:fraud_http_user_agent] if options[:fraud_http_user_agent]
268
+ end
269
+ end
270
+
271
+ def commit(action, params)
272
+ response = parse(ssl_post(self.live_url, post_data(action, params)))
273
+
274
+ Response.new(successful?(response), message_from(response), response,
275
+ :test => test?,
276
+ :authorization => response[:transaction]
277
+ )
278
+ end
279
+
280
+ def successful?(response)
281
+ response[:qpstat] == APPROVED
282
+ end
283
+
284
+ def parse(data)
285
+ response = {}
286
+
287
+ doc = REXML::Document.new(data)
288
+
289
+ doc.root.elements.each do |element|
290
+ response[element.name.to_sym] = element.text
291
+ end
292
+
293
+ response
294
+ end
295
+
296
+ def message_from(response)
297
+ response[:qpstatmsg].to_s
298
+ end
299
+
300
+ def post_data(action, params = {})
301
+ params[:protocol] = @protocol
302
+ params[:msgtype] = action.to_s
303
+ params[:merchant] = @options[:login]
304
+ params[:apikey] = @options[:apikey] if @options[:apikey]
305
+ params[:md5check] = generate_check_hash(action, params)
306
+
307
+ params.collect { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join("&")
308
+ end
309
+
310
+ def generate_check_hash(action, params)
311
+ string = MD5_CHECK_FIELDS[@protocol][action].collect do |key|
312
+ params[key.to_sym]
313
+ end.join('')
314
+
315
+ # Add the md5checkword
316
+ string << @options[:password].to_s
317
+
318
+ Digest::MD5.hexdigest(string)
319
+ end
320
+
321
+ def expdate(credit_card)
322
+ year = format(credit_card.year, :two_digits)
323
+ month = format(credit_card.month, :two_digits)
324
+
325
+ "#{year}#{month}"
326
+ end
327
+
328
+ # Limited to 20 digits max
329
+ def format_order_number(number)
330
+ number.to_s.gsub(/[^\w_]/, '').rjust(4, "0")[0...20]
331
+ end
332
+ end
333
+ end
334
+ end
335
+