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,61 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ class PaypalExpressResponse < Response
4
+ def email
5
+ info['Payer']
6
+ end
7
+
8
+ def info
9
+ (@params['PayerInfo']||{})
10
+ end
11
+
12
+ def details
13
+ (@params['PaymentDetails']||{})
14
+ end
15
+
16
+ def name
17
+ payer = (info['PayerName']||{})
18
+ [payer['FirstName'], payer['MiddleName'], payer['LastName']].compact.join(' ')
19
+ end
20
+
21
+ def token
22
+ @params['Token']
23
+ end
24
+
25
+ def payer_id
26
+ info['PayerID']
27
+ end
28
+
29
+ def payer_country
30
+ info['PayerCountry']
31
+ end
32
+
33
+ # PayPal returns a contact telephone number only if your Merchant account
34
+ # profile settings require that the buyer enter one.
35
+ def contact_phone
36
+ @params['ContactPhone']
37
+ end
38
+
39
+ def address
40
+ address = (details['ShipToAddress']||{})
41
+ { 'name' => address['Name'],
42
+ 'company' => info['PayerBusiness'],
43
+ 'address1' => address['Street1'],
44
+ 'address2' => address['Street2'],
45
+ 'city' => address['CityName'],
46
+ 'state' => address['StateOrProvince'],
47
+ 'country' => address['Country'],
48
+ 'zip' => address['PostalCode'],
49
+ 'phone' => (contact_phone || address['Phone'])
50
+ }
51
+ end
52
+
53
+ def shipping
54
+ shipping = (@params['UserSelectedOptions']||{})
55
+ { 'amount' => shipping['ShippingOptionAmount'],
56
+ 'name' => shipping['ShippingOptionName']
57
+ }
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,248 @@
1
+ require File.dirname(__FILE__) + '/paypal_common_api'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ # This module is included in both PaypalGateway and PaypalExpressGateway
6
+ module PaypalRecurringApi
7
+ PAYPAL_NAMESPACE = ActiveMerchant::Billing::PaypalCommonAPI::PAYPAL_NAMESPACE
8
+ API_VERSION = ActiveMerchant::Billing::PaypalCommonAPI::API_VERSION
9
+ EBAY_NAMESPACE = ActiveMerchant::Billing::PaypalCommonAPI::EBAY_NAMESPACE
10
+ # Create a recurring payment.
11
+ #
12
+ # This transaction creates a recurring payment profile
13
+ # ==== Parameters
14
+ #
15
+ # * <tt>money</tt> -- The amount to be charged to the customer at each interval as an Integer value in cents.
16
+ # * <tt>credit_card</tt> -- The CreditCard details for the transaction.
17
+ # * <tt>options</tt> -- A hash of parameters.
18
+ #
19
+ # ==== Options
20
+ #
21
+ # * <tt>:period</tt> -- [Day, Week, SemiMonth, Month, Year] default: Month
22
+ # * <tt>:frequency</tt> -- a number
23
+ # * <tt>:cycles</tt> -- Limit to certain # of cycles (OPTIONAL)
24
+ # * <tt>:start_date</tt> -- When does the charging starts (REQUIRED)
25
+ # * <tt>:description</tt> -- The description to appear in the profile (REQUIRED)
26
+
27
+ def recurring(amount, credit_card, options = {})
28
+ options[:credit_card] = credit_card
29
+ options[:amount] = amount
30
+ requires!(options, :description, :start_date, :period, :frequency, :amount)
31
+ commit 'CreateRecurringPaymentsProfile', build_create_profile_request(options)
32
+ end
33
+
34
+ # Update a recurring payment's details.
35
+ #
36
+ # This transaction updates an existing Recurring Billing Profile
37
+ # and the subscription must have already been created previously
38
+ # by calling +recurring()+. The ability to change certain
39
+ # details about a recurring payment is dependent on transaction history
40
+ # and the type of plan you're subscribed with paypal. Web Payment Pro
41
+ # seems to have the ability to update the most field.
42
+ #
43
+ # ==== Parameters
44
+ #
45
+ # * <tt>options</tt> -- A hash of parameters.
46
+ #
47
+ # ==== Options
48
+ #
49
+ # * <tt>:profile_id</tt> -- A string containing the <tt>:profile_id</tt>
50
+ # of the recurring payment already in place for a given credit card. (REQUIRED)
51
+ def update_recurring(options={})
52
+ requires!(options, :profile_id)
53
+ opts = options.dup
54
+ commit 'UpdateRecurringPaymentsProfile', build_change_profile_request(opts.delete(:profile_id), opts)
55
+ end
56
+
57
+ # Cancel a recurring payment.
58
+ #
59
+ # This transaction cancels an existing recurring billing profile. Your account must have recurring billing enabled
60
+ # and the subscription must have already been created previously by calling recurring()
61
+ #
62
+ # ==== Parameters
63
+ #
64
+ # * <tt>profile_id</tt> -- A string containing the +profile_id+ of the
65
+ # recurring payment already in place for a given credit card. (REQUIRED)
66
+ # * <tt>options</tt> -- A hash with extra info ('note' for ex.)
67
+ def cancel_recurring(profile_id, options = {})
68
+ raise_error_if_blank('profile_id', profile_id)
69
+ commit 'ManageRecurringPaymentsProfileStatus', build_manage_profile_request(profile_id, 'Cancel', options)
70
+ end
71
+
72
+ # Get Subscription Status of a recurring payment profile.
73
+ #
74
+ # ==== Parameters
75
+ #
76
+ # * <tt>profile_id</tt> -- A string containing the +profile_id+ of the
77
+ # recurring payment already in place for a given credit card. (REQUIRED)
78
+ def status_recurring(profile_id)
79
+ raise_error_if_blank('profile_id', profile_id)
80
+ commit 'GetRecurringPaymentsProfileDetails', build_get_profile_details_request(profile_id)
81
+ end
82
+
83
+ # Suspends a recurring payment profile.
84
+ #
85
+ # ==== Parameters
86
+ #
87
+ # * <tt>profile_id</tt> -- A string containing the +profile_id+ of the
88
+ # recurring payment already in place for a given credit card. (REQUIRED)
89
+ def suspend_recurring(profile_id, options = {})
90
+ raise_error_if_blank('profile_id', profile_id)
91
+ commit 'ManageRecurringPaymentsProfileStatus', build_manage_profile_request(profile_id, 'Suspend', options)
92
+ end
93
+
94
+ # Reactivates a suspended recurring payment profile.
95
+ #
96
+ # ==== Parameters
97
+ #
98
+ # * <tt>profile_id</tt> -- A string containing the +profile_id+ of the
99
+ # recurring payment already in place for a given credit card. (REQUIRED)
100
+ def reactivate_recurring(profile_id, options = {})
101
+ raise_error_if_blank('profile_id', profile_id)
102
+ commit 'ManageRecurringPaymentsProfileStatus', build_manage_profile_request(profile_id, 'Reactivate', options)
103
+ end
104
+
105
+ # Bills outstanding amount to a recurring payment profile.
106
+ #
107
+ # ==== Parameters
108
+ #
109
+ # * <tt>profile_id</tt> -- A string containing the +profile_id+ of the
110
+ # recurring payment already in place for a given credit card. (REQUIRED)
111
+ def bill_outstanding_amount(profile_id, options = {})
112
+ raise_error_if_blank('profile_id', profile_id)
113
+ commit 'BillOutstandingAmount', build_bill_outstanding_amount(profile_id, options)
114
+ end
115
+
116
+ private
117
+ def raise_error_if_blank(field_name, field)
118
+ raise ArgumentError.new("Missing required parameter: #{field_name}") if field.blank?
119
+ end
120
+ def build_create_profile_request(options)
121
+ xml = Builder::XmlMarkup.new :indent => 2
122
+ xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' => PAYPAL_NAMESPACE do
123
+ xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' => EBAY_NAMESPACE do
124
+ xml.tag! 'n2:Version', API_VERSION
125
+ xml.tag! 'n2:CreateRecurringPaymentsProfileRequestDetails' do
126
+ xml.tag! 'Token', options[:token] unless options[:token].blank?
127
+ if options[:credit_card]
128
+ add_credit_card(xml, options[:credit_card], (options[:billing_address] || options[:address]), options)
129
+ end
130
+ xml.tag! 'n2:RecurringPaymentsProfileDetails' do
131
+ xml.tag! 'n2:BillingStartDate', (options[:start_date].is_a?(Date) ? options[:start_date].to_time : options[:start_date]).utc.iso8601
132
+ xml.tag! 'n2:ProfileReference', options[:profile_reference] unless options[:profile_reference].blank?
133
+ end
134
+ xml.tag! 'n2:ScheduleDetails' do
135
+ xml.tag! 'n2:Description', options[:description]
136
+ xml.tag! 'n2:PaymentPeriod' do
137
+ xml.tag! 'n2:BillingPeriod', options[:period] || 'Month'
138
+ xml.tag! 'n2:BillingFrequency', options[:frequency]
139
+ xml.tag! 'n2:TotalBillingCycles', options[:total_billing_cycles] unless options[:total_billing_cycles].blank?
140
+ xml.tag! 'n2:Amount', amount(options[:amount]), 'currencyID' => options[:currency] || 'USD'
141
+ xml.tag! 'n2:TaxAmount', amount(options[:tax_amount] || 0), 'currencyID' => options[:currency] || 'USD' unless options[:tax_amount].blank?
142
+ xml.tag! 'n2:ShippingAmount', amount(options[:shipping_amount] || 0), 'currencyID' => options[:currency] || 'USD' unless options[:shipping_amount].blank?
143
+ end
144
+ if !options[:trial_amount].blank?
145
+ xml.tag! 'n2:TrialPeriod' do
146
+ xml.tag! 'n2:BillingPeriod', options[:trial_period] || 'Month'
147
+ xml.tag! 'n2:BillingFrequency', options[:trial_frequency]
148
+ xml.tag! 'n2:TotalBillingCycles', options[:trial_cycles] || 1
149
+ xml.tag! 'n2:Amount', amount(options[:trial_amount]), 'currencyID' => options[:currency] || 'USD'
150
+ xml.tag! 'n2:TaxAmount', amount(options[:trial_tax_amount] || 0), 'currencyID' => options[:currency] || 'USD' unless options[:trial_tax_amount].blank?
151
+ xml.tag! 'n2:ShippingAmount', amount(options[:trial_shipping_amount] || 0), 'currencyID' => options[:currency] || 'USD' unless options[:trial_shipping_amount].blank?
152
+ end
153
+ end
154
+ if !options[:initial_amount].blank?
155
+ xml.tag! 'n2:ActivationDetails' do
156
+ xml.tag! 'n2:InitialAmount', amount(options[:initial_amount]), 'currencyID' => options[:currency] || 'USD'
157
+ xml.tag! 'n2:FailedInitialAmountAction', options[:continue_on_failure] ? 'ContinueOnFailure' : 'CancelOnFailure'
158
+ end
159
+ end
160
+ xml.tag! 'n2:MaxFailedPayments', options[:max_failed_payments] unless options[:max_failed_payments].blank?
161
+ xml.tag! 'n2:AutoBillOutstandingAmount', options[:auto_bill_outstanding] ? 'AddToNextBilling' : 'NoAutoBill'
162
+ end
163
+ end
164
+ end
165
+ end
166
+ xml.target!
167
+ end
168
+
169
+ def build_get_profile_details_request(profile_id)
170
+ xml = Builder::XmlMarkup.new :indent => 2
171
+ xml.tag! 'GetRecurringPaymentsProfileDetailsReq', 'xmlns' => PAYPAL_NAMESPACE do
172
+ xml.tag! 'GetRecurringPaymentsProfileDetailsRequest', 'xmlns:n2' => EBAY_NAMESPACE do
173
+ xml.tag! 'n2:Version', API_VERSION
174
+ xml.tag! 'ProfileID', profile_id
175
+ end
176
+ end
177
+ xml.target!
178
+ end
179
+
180
+ def build_change_profile_request(profile_id, options)
181
+ xml = Builder::XmlMarkup.new :indent => 2
182
+ xml.tag! 'UpdateRecurringPaymentsProfileReq', 'xmlns' => PAYPAL_NAMESPACE do
183
+ xml.tag! 'UpdateRecurringPaymentsProfileRequest', 'xmlns:n2' => EBAY_NAMESPACE do
184
+ xml.tag! 'n2:Version', API_VERSION
185
+ xml.tag! 'n2:UpdateRecurringPaymentsProfileRequestDetails' do
186
+ xml.tag! 'ProfileID', profile_id
187
+ if options[:credit_card]
188
+ add_credit_card(xml, options[:credit_card], options[:address], options)
189
+ end
190
+ xml.tag! 'n2:Note', options[:note] unless options[:note].blank?
191
+ xml.tag! 'n2:Description', options[:description] unless options[:description].blank?
192
+ xml.tag! 'n2:ProfileReference', options[:reference] unless options[:reference].blank?
193
+ xml.tag! 'n2:AdditionalBillingCycles', options[:additional_billing_cycles] unless options[:additional_billing_cycles].blank?
194
+ xml.tag! 'n2:MaxFailedPayments', options[:max_failed_payments] unless options[:max_failed_payments].blank?
195
+ xml.tag! 'n2:AutoBillOutstandingAmount', options[:auto_bill_outstanding] ? 'AddToNextBilling' : 'NoAutoBill'
196
+ if options.has_key?(:amount)
197
+ xml.tag! 'n2:Amount', amount(options[:amount]), 'currencyID' => options[:currency] || 'USD'
198
+ end
199
+ if options.has_key?(:tax_amount)
200
+ xml.tag! 'n2:TaxAmount', amount(options[:tax_amount] || 0), 'currencyID' => options[:currency] || 'USD'
201
+ end
202
+ if options.has_key?(:start_date)
203
+ xml.tag! 'n2:BillingStartDate', (options[:start_date].is_a?(Date) ? options[:start_date].to_time : options[:start_date]).utc.iso8601
204
+ end
205
+ if options.has_key?(:outstanding_balance)
206
+ xml.tag! 'n2:OutstandingBalance', amount(options[:outstanding_balance]), 'currencyID' => options[:currency] || 'USD'
207
+ end
208
+ end
209
+ end
210
+ end
211
+ xml.target!
212
+ end
213
+
214
+ def build_manage_profile_request(profile_id, action, options)
215
+ xml = Builder::XmlMarkup.new :indent => 2
216
+ xml.tag! 'ManageRecurringPaymentsProfileStatusReq', 'xmlns' => PAYPAL_NAMESPACE do
217
+ xml.tag! 'ManageRecurringPaymentsProfileStatusRequest', 'xmlns:n2' => EBAY_NAMESPACE do
218
+ xml.tag! 'n2:Version', API_VERSION
219
+ xml.tag! 'n2:ManageRecurringPaymentsProfileStatusRequestDetails' do
220
+ xml.tag! 'ProfileID', profile_id
221
+ xml.tag! 'n2:Action', action
222
+ xml.tag! 'n2:Note', options[:note] unless options[:note].blank?
223
+ end
224
+ end
225
+ end
226
+ xml.target!
227
+ end
228
+
229
+ def build_bill_outstanding_amount(profile_id, options)
230
+ xml = Builder::XmlMarkup.new :indent => 2
231
+ xml.tag! 'BillOutstandingAmountReq', 'xmlns' => PAYPAL_NAMESPACE do
232
+ xml.tag! 'BillOutstandingAmountRequest', 'xmlns:n2' => EBAY_NAMESPACE do
233
+ xml.tag! 'n2:Version', API_VERSION
234
+ xml.tag! 'n2:BillOutstandingAmountRequestDetails' do
235
+ xml.tag! 'ProfileID', profile_id
236
+ if options.has_key?(:amount)
237
+ xml.tag! 'n2:Amount', amount(options[:amount]), 'currencyID' => options[:currency] || 'USD'
238
+ end
239
+ xml.tag! 'n2:Note', options[:note] unless options[:note].blank?
240
+ end
241
+ end
242
+ end
243
+ xml.target!
244
+ end
245
+
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,106 @@
1
+ require File.dirname(__FILE__) + '/paypal/paypal_common_api'
2
+ require File.dirname(__FILE__) + '/paypal/paypal_recurring_api'
3
+ require File.dirname(__FILE__) + '/paypal_express'
4
+
5
+ module ActiveMerchant #:nodoc:
6
+ module Billing #:nodoc:
7
+ class PaypalGateway < Gateway
8
+ include PaypalCommonAPI
9
+ include PaypalRecurringApi
10
+
11
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
+ self.supported_countries = ['US']
13
+ self.homepage_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside'
14
+ self.display_name = 'PayPal Website Payments Pro (US)'
15
+
16
+ def authorize(money, credit_card_or_referenced_id, options = {})
17
+ requires!(options, :ip)
18
+ commit define_transaction_type(credit_card_or_referenced_id), build_sale_or_authorization_request('Authorization', money, credit_card_or_referenced_id, options)
19
+ end
20
+
21
+ def purchase(money, credit_card_or_referenced_id, options = {})
22
+ requires!(options, :ip)
23
+ commit define_transaction_type(credit_card_or_referenced_id), build_sale_or_authorization_request('Sale', money, credit_card_or_referenced_id, options)
24
+ end
25
+
26
+ def express
27
+ @express ||= PaypalExpressGateway.new(@options)
28
+ end
29
+
30
+ private
31
+
32
+ def define_transaction_type(transaction_arg)
33
+ if transaction_arg.is_a?(String)
34
+ return 'DoReferenceTransaction'
35
+ else
36
+ return 'DoDirectPayment'
37
+ end
38
+ end
39
+
40
+ def build_sale_or_authorization_request(action, money, credit_card_or_referenced_id, options)
41
+ transaction_type = define_transaction_type(credit_card_or_referenced_id)
42
+ reference_id = credit_card_or_referenced_id if transaction_type == "DoReferenceTransaction"
43
+
44
+ billing_address = options[:billing_address] || options[:address]
45
+ currency_code = options[:currency] || currency(money)
46
+
47
+ xml = Builder::XmlMarkup.new :indent => 2
48
+ xml.tag! transaction_type + 'Req', 'xmlns' => PAYPAL_NAMESPACE do
49
+ xml.tag! transaction_type + 'Request', 'xmlns:n2' => EBAY_NAMESPACE do
50
+ xml.tag! 'n2:Version', API_VERSION
51
+ xml.tag! 'n2:' + transaction_type + 'RequestDetails' do
52
+ xml.tag! 'n2:ReferenceID', reference_id if transaction_type == 'DoReferenceTransaction'
53
+ xml.tag! 'n2:PaymentAction', action
54
+ add_payment_details(xml, money, currency_code, options)
55
+ add_credit_card(xml, credit_card_or_referenced_id, billing_address, options) unless transaction_type == 'DoReferenceTransaction'
56
+ xml.tag! 'n2:IPAddress', options[:ip]
57
+ end
58
+ end
59
+ end
60
+
61
+ xml.target!
62
+ end
63
+
64
+ def add_credit_card(xml, credit_card, address, options)
65
+ xml.tag! 'n2:CreditCard' do
66
+ xml.tag! 'n2:CreditCardType', credit_card_type(card_brand(credit_card))
67
+ xml.tag! 'n2:CreditCardNumber', credit_card.number
68
+ xml.tag! 'n2:ExpMonth', format(credit_card.month, :two_digits)
69
+ xml.tag! 'n2:ExpYear', format(credit_card.year, :four_digits)
70
+ xml.tag! 'n2:CVV2', credit_card.verification_value
71
+
72
+ if [ 'switch', 'solo' ].include?(card_brand(credit_card).to_s)
73
+ xml.tag! 'n2:StartMonth', format(credit_card.start_month, :two_digits) unless credit_card.start_month.blank?
74
+ xml.tag! 'n2:StartYear', format(credit_card.start_year, :four_digits) unless credit_card.start_year.blank?
75
+ xml.tag! 'n2:IssueNumber', format(credit_card.issue_number, :two_digits) unless credit_card.issue_number.blank?
76
+ end
77
+
78
+ xml.tag! 'n2:CardOwner' do
79
+ xml.tag! 'n2:PayerName' do
80
+ xml.tag! 'n2:FirstName', credit_card.first_name
81
+ xml.tag! 'n2:LastName', credit_card.last_name
82
+ end
83
+
84
+ xml.tag! 'n2:Payer', options[:email]
85
+ add_address(xml, 'n2:Address', address)
86
+ end
87
+ end
88
+ end
89
+
90
+ def credit_card_type(type)
91
+ case type
92
+ when 'visa' then 'Visa'
93
+ when 'master' then 'MasterCard'
94
+ when 'discover' then 'Discover'
95
+ when 'american_express' then 'Amex'
96
+ when 'switch' then 'Switch'
97
+ when 'solo' then 'Solo'
98
+ end
99
+ end
100
+
101
+ def build_response(success, message, response, options = {})
102
+ Response.new(success, message, response, options)
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + '/paypal'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ # The PayPal gateway for PayPal Website Payments Pro Canada only supports Visa and MasterCard
6
+ class PaypalCaGateway < PaypalGateway
7
+ self.supported_cardtypes = [:visa, :master]
8
+ self.supported_countries = ['CA']
9
+ self.homepage_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside'
10
+ self.display_name = 'PayPal Website Payments Pro (CA)'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,43 @@
1
+ require File.dirname(__FILE__) + '/paypal/paypal_common_api'
2
+ require File.dirname(__FILE__) + '/paypal/paypal_express_response'
3
+ require File.dirname(__FILE__) + '/paypal_express_common'
4
+
5
+ module ActiveMerchant #:nodoc:
6
+ module Billing #:nodoc:
7
+ class PaypalDigitalGoodsGateway < PaypalExpressGateway
8
+ self.test_redirect_url = 'https://www.sandbox.paypal.com/incontext'
9
+ self.live_redirect_url = 'https://www.paypal.com/incontext'
10
+
11
+ self.supported_countries = %w(AU CA CN FI GB ID IN IT MY NO NZ PH PL SE SG TH VN)
12
+ self.homepage_url = 'https://www.x.com/community/ppx/xspaces/digital_goods'
13
+ self.display_name = 'PayPal Express Checkout for Digital Goods'
14
+
15
+ def redirect_url_for(token, options = {})
16
+ "#{redirect_url}?token=#{token}&useraction=commit"
17
+ end
18
+
19
+ # GATEWAY.setup_purchase(100,
20
+ # :ip => "127.0.0.1",
21
+ # :description => "Test Title",
22
+ # :return_url => "http://return.url",
23
+ # :cancel_return_url => "http://cancel.url",
24
+ # :items => [ { :name => "Charge",
25
+ # :number => "1",
26
+ # :quantity => "1",
27
+ # :amount => 100,
28
+ # :description => "Description",
29
+ # :category => "Digital" } ] )
30
+ def build_setup_request(action, money, options)
31
+ requires!(options, :items)
32
+ raise ArgumentError, "Must include at least 1 Item" unless options[:items].length > 0
33
+ options[:items].each do |item|
34
+ requires!(item, :name, :number, :quantity, :amount, :description, :category)
35
+ raise ArgumentError, "Each of the items must have the category 'Digital'" unless item[:category] == 'Digital'
36
+ end
37
+
38
+ super
39
+ end
40
+
41
+ end
42
+ end
43
+ end