spree 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree might be problematic. Click here for more details.

Files changed (722) hide show
  1. data/CHANGELOG +457 -425
  2. data/{README.markdown → README.md} +4 -0
  3. data/Rakefile +2 -2
  4. data/app/controllers/admin/adjustments_controller.rb +8 -9
  5. data/app/controllers/admin/checkouts_controller.rb +10 -2
  6. data/app/controllers/admin/line_items_controller.rb +0 -1
  7. data/app/controllers/admin/payments_controller.rb +8 -7
  8. data/app/controllers/admin/shipments_controller.rb +1 -1
  9. data/app/controllers/checkouts_controller.rb +16 -5
  10. data/app/controllers/spree/base_controller.rb +2 -2
  11. data/app/helpers/admin/navigation_helper.rb +1 -1
  12. data/app/helpers/checkouts_helper.rb +1 -1
  13. data/app/helpers/products_helper.rb +1 -1
  14. data/app/helpers/taxons_helper.rb +1 -1
  15. data/app/models/address.rb +9 -0
  16. data/app/models/checkout.rb +13 -7
  17. data/app/models/creditcard.rb +2 -2
  18. data/app/models/model_cache_cleaner.rb +13 -0
  19. data/app/models/order.rb +6 -8
  20. data/app/models/payment.rb +18 -17
  21. data/app/models/payment_method.rb +2 -2
  22. data/app/models/product.rb +1 -2
  23. data/app/models/return_authorization.rb +3 -1
  24. data/app/models/shipping_method.rb +16 -6
  25. data/app/models/zone.rb +34 -3
  26. data/config/database.yml +4 -21
  27. data/config/environment.rb +6 -6
  28. data/config/environments/test.rb +1 -0
  29. data/config/locales/en_spree.yml +10 -9
  30. data/db/migrate/20100624110730_add_display_to_shipping_methods.rb +9 -0
  31. data/db/migrate/20100624123336_rename_payment_method_display.rb +9 -0
  32. data/db/sample/orders.yml +3 -3
  33. data/db/sample/payments.rb +6 -5
  34. data/db/sample/products.rb +2 -2
  35. data/db/schema.rb +9 -27
  36. data/lib/easy_role_requirement_system.rb +1 -1
  37. data/lib/generators/extension/extension_generator.rb +7 -22
  38. data/lib/generators/extension/templates/functional_test.rb +1 -1
  39. data/lib/generators/extension/templates/tasks.rake +2 -2
  40. data/lib/generators/extension_controller/extension_controller_generator.rb +1 -1
  41. data/lib/generators/extension_model/extension_model_generator.rb +1 -1
  42. data/lib/generators/instance/instance_generator.rb +24 -24
  43. data/lib/generators/instance/templates/instance_generate +1 -1
  44. data/lib/generators/theme/theme_generator.rb +6 -10
  45. data/lib/plugins/extension_patches/lib/asset_copy.rb +2 -2
  46. data/lib/spree.rb +1 -1
  47. data/lib/spree/initializer.rb +15 -15
  48. data/lib/spree/search.rb +1 -1
  49. data/lib/tasks/cucumber.rake +1 -1
  50. data/lib/tasks/extensions.rake +6 -6
  51. data/lib/tasks/framework.rake +1 -1
  52. data/lib/tasks/instance.rake +6 -6
  53. data/lib/validation_group.rb +16 -16
  54. data/script/extension +2 -2
  55. data/test/functional/products_controller_test.rb +13 -0
  56. data/test/test_helper.rb +1 -1
  57. data/test/unit/checkout_test.rb +18 -9
  58. data/vendor/extensions/README +1 -1
  59. data/vendor/extensions/api/Rakefile +2 -2
  60. data/vendor/extensions/api/lib/tasks/api_extension_tasks.rake +2 -2
  61. data/vendor/extensions/overview_dashboard/Rakefile +2 -2
  62. data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +5 -5
  63. data/vendor/extensions/overview_dashboard/lib/tasks/overview_dashboard_extension_tasks.rake +2 -2
  64. data/vendor/extensions/payment_gateway/Rakefile +2 -2
  65. data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +6 -2
  66. data/vendor/extensions/payment_gateway/app/models/gateway/braintree.rb +88 -0
  67. data/vendor/extensions/payment_gateway/config/locales/en.yml +2 -1
  68. data/vendor/extensions/payment_gateway/lib/active_merchant/billing/authorize_net_cim.rb +4 -2
  69. data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +1 -1
  70. data/vendor/extensions/payment_gateway/lib/tasks/payment_gateway_extension_tasks.rake +2 -2
  71. data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +1 -0
  72. data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +2 -1
  73. data/vendor/extensions/payment_gateway/test/unit/braintree_test.rb +200 -0
  74. data/vendor/extensions/theme_default/Rakefile +2 -2
  75. data/vendor/extensions/theme_default/app/stylesheets/_buttons.less +7 -2
  76. data/vendor/extensions/theme_default/app/stylesheets/_colors.less +1 -1
  77. data/vendor/extensions/theme_default/app/stylesheets/_layout.less +7 -2
  78. data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +3 -4
  79. data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +1 -1
  80. data/vendor/extensions/theme_default/app/views/admin/shared/_additional_field.html.erb +1 -1
  81. data/vendor/extensions/theme_default/app/views/admin/shared/_calculator_fields.html.erb +6 -6
  82. data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +13 -13
  83. data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
  84. data/vendor/extensions/theme_default/app/views/admin/shipping_methods/_form.html.erb +6 -0
  85. data/vendor/extensions/theme_default/app/views/admin/shipping_methods/index.html.erb +2 -0
  86. data/vendor/extensions/theme_default/app/views/checkouts/_address.html.erb +7 -9
  87. data/vendor/extensions/theme_default/app/views/checkouts/_payment.html.erb +4 -4
  88. data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +4 -4
  89. data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +36 -35
  90. data/vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb +1 -1
  91. data/vendor/extensions/theme_default/app/views/shared/_head.html.erb +2 -2
  92. data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +1 -1
  93. data/vendor/extensions/theme_default/app/views/states/index.js.erb +1 -1
  94. data/vendor/extensions/theme_default/lib/tasks/theme_default_extension_tasks.rake +2 -2
  95. data/vendor/extensions/theme_default/public/favicon.ico +0 -0
  96. data/vendor/extensions/theme_default/public/images/admin/bg/header.png +0 -0
  97. data/vendor/extensions/theme_default/public/javascripts/calculator.js +3 -1
  98. data/vendor/extensions/theme_default/public/javascripts/checkout.js +44 -18
  99. data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +29 -24
  100. data/vendor/extensions/theme_default/public/stylesheets/screen.css +9 -7
  101. data/vendor/plugins/attribute_fu/init.rb +2 -2
  102. data/vendor/plugins/delegate_belongs_to/spec/spec_helper.rb +1 -1
  103. data/vendor/plugins/jrails/install.rb +1 -1
  104. data/vendor/plugins/jrails/lib/tasks/jrails.rake +2 -2
  105. data/vendor/plugins/jrails_auto_complete/install.rb +1 -1
  106. data/vendor/plugins/jrails_auto_complete/uninstall.rb +1 -1
  107. data/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +1 -1
  108. metadata +59 -659
  109. data/lib/generators/extension/templates/RSpecRakefile +0 -137
  110. data/lib/generators/extension/templates/spec.opts +0 -6
  111. data/lib/generators/extension/templates/spec_helper.rb +0 -37
  112. data/lib/generators/extension_controller/templates/controller_spec.rb +0 -23
  113. data/lib/generators/extension_controller/templates/helper_spec.rb +0 -11
  114. data/lib/generators/extension_controller/templates/view_spec.rb +0 -12
  115. data/lib/generators/extension_model/templates/model_spec.rb +0 -11
  116. data/lib/tasks/rspec.rake +0 -182
  117. data/public/images/add-to-cart.png +0 -0
  118. data/public/images/admin/bg/active-tab.png +0 -0
  119. data/public/images/admin/bg/admin_tab_back.png +0 -0
  120. data/public/images/admin/bg/admin_tab_selected_back.png +0 -0
  121. data/public/images/admin/bg/content-back-blue.png +0 -0
  122. data/public/images/admin/bg/content-back-green.png +0 -0
  123. data/public/images/admin/bg/content-back.png +0 -0
  124. data/public/images/admin/bg/flash-error.png +0 -0
  125. data/public/images/admin/bg/flash-notice.png +0 -0
  126. data/public/images/admin/bg/green-stripes.gif +0 -0
  127. data/public/images/admin/bg/green-stripes.png +0 -0
  128. data/public/images/admin/bg/grid_header_back.png +0 -0
  129. data/public/images/admin/bg/grid_header_back_green.png +0 -0
  130. data/public/images/admin/bg/header-bg.png +0 -0
  131. data/public/images/admin/bg/header_bg.jpg +0 -0
  132. data/public/images/admin/bg/menu-current.png +0 -0
  133. data/public/images/admin/bg/red-stripes.gif +0 -0
  134. data/public/images/admin/bg/red-stripes.png +0 -0
  135. data/public/images/admin/bg/spree_50.png +0 -0
  136. data/public/images/admin/bg/subnav-divider.png +0 -0
  137. data/public/images/admin/bg/subnav.png +0 -0
  138. data/public/images/admin/bg/tab-back.png +0 -0
  139. data/public/images/admin/buttons/blue/left_01.png +0 -0
  140. data/public/images/admin/buttons/blue/right_01.png +0 -0
  141. data/public/images/admin/buttons/drag-handle-green.png +0 -0
  142. data/public/images/admin/buttons/green/left_01.png +0 -0
  143. data/public/images/admin/buttons/green/right_01.png +0 -0
  144. data/public/images/admin/buttons/left_01.png +0 -0
  145. data/public/images/admin/buttons/left_01_small.png +0 -0
  146. data/public/images/admin/buttons/orange/left_03.png +0 -0
  147. data/public/images/admin/buttons/orange/right_03.png +0 -0
  148. data/public/images/admin/buttons/right_01.png +0 -0
  149. data/public/images/admin/buttons/right_01_small.png +0 -0
  150. data/public/images/admin/icons/16x16/1.png +0 -0
  151. data/public/images/admin/icons/16x16/10.png +0 -0
  152. data/public/images/admin/icons/16x16/2.png +0 -0
  153. data/public/images/admin/icons/16x16/3.png +0 -0
  154. data/public/images/admin/icons/16x16/4.png +0 -0
  155. data/public/images/admin/icons/16x16/5.png +0 -0
  156. data/public/images/admin/icons/16x16/6.png +0 -0
  157. data/public/images/admin/icons/16x16/7.png +0 -0
  158. data/public/images/admin/icons/16x16/8.png +0 -0
  159. data/public/images/admin/icons/16x16/9.png +0 -0
  160. data/public/images/admin/icons/32x32/1.png +0 -0
  161. data/public/images/admin/icons/32x32/10.png +0 -0
  162. data/public/images/admin/icons/32x32/11.png +0 -0
  163. data/public/images/admin/icons/32x32/2.png +0 -0
  164. data/public/images/admin/icons/32x32/3.png +0 -0
  165. data/public/images/admin/icons/32x32/4.png +0 -0
  166. data/public/images/admin/icons/32x32/5.png +0 -0
  167. data/public/images/admin/icons/32x32/6.png +0 -0
  168. data/public/images/admin/icons/32x32/7.png +0 -0
  169. data/public/images/admin/icons/32x32/8.png +0 -0
  170. data/public/images/admin/icons/32x32/9.png +0 -0
  171. data/public/images/admin/icons/accept.png +0 -0
  172. data/public/images/admin/icons/add.gif +0 -0
  173. data/public/images/admin/icons/add.png +0 -0
  174. data/public/images/admin/icons/arrow-down.gif +0 -0
  175. data/public/images/admin/icons/cross.png +0 -0
  176. data/public/images/admin/icons/delete.gif +0 -0
  177. data/public/images/admin/icons/delete.png +0 -0
  178. data/public/images/admin/icons/drag.gif +0 -0
  179. data/public/images/admin/icons/edit.gif +0 -0
  180. data/public/images/admin/icons/edit.png +0 -0
  181. data/public/images/admin/icons/email.png +0 -0
  182. data/public/images/admin/icons/error.png +0 -0
  183. data/public/images/admin/icons/exclamation.png +0 -0
  184. data/public/images/admin/icons/feed.png +0 -0
  185. data/public/images/admin/icons/pdf.png +0 -0
  186. data/public/images/admin/icons/reorder.gif +0 -0
  187. data/public/images/admin/icons/search.gif +0 -0
  188. data/public/images/admin/icons/send-email.png +0 -0
  189. data/public/images/admin/icons/stop.png +0 -0
  190. data/public/images/admin/icons/tick.png +0 -0
  191. data/public/images/admin/icons/up.gif +0 -0
  192. data/public/images/admin/icons/xls.png +0 -0
  193. data/public/images/admin/tabs/off-left.png +0 -0
  194. data/public/images/admin/tabs/off-right.png +0 -0
  195. data/public/images/admin/tabs/on-left.png +0 -0
  196. data/public/images/admin/tabs/on-right.png +0 -0
  197. data/public/images/ajax_loader.gif +0 -0
  198. data/public/images/amex_cid.gif +0 -0
  199. data/public/images/bg-button-hover.png +0 -0
  200. data/public/images/bg-button-pressed.png +0 -0
  201. data/public/images/bg-button.gif +0 -0
  202. data/public/images/bg-button.png +0 -0
  203. data/public/images/blue/left_01.png +0 -0
  204. data/public/images/blue/right_01.png +0 -0
  205. data/public/images/body-back.png +0 -0
  206. data/public/images/bottom_shine.png +0 -0
  207. data/public/images/breadcrumb.gif +0 -0
  208. data/public/images/button-dark-hover.png +0 -0
  209. data/public/images/button-dark.png +0 -0
  210. data/public/images/buttons/bg-button-hover.png +0 -0
  211. data/public/images/buttons/bg-button-pressed.png +0 -0
  212. data/public/images/buttons/bg-button.gif +0 -0
  213. data/public/images/buttons/bg-button.png +0 -0
  214. data/public/images/buttons/blue/left_01.png +0 -0
  215. data/public/images/buttons/blue/right_01.png +0 -0
  216. data/public/images/buttons/button-dark-hover.png +0 -0
  217. data/public/images/buttons/button-dark.png +0 -0
  218. data/public/images/buttons/drag-handle-green.png +0 -0
  219. data/public/images/buttons/green/left_01.png +0 -0
  220. data/public/images/buttons/green/right_01.png +0 -0
  221. data/public/images/buttons/left_01.png +0 -0
  222. data/public/images/buttons/left_01_small.png +0 -0
  223. data/public/images/buttons/orange/left_03.png +0 -0
  224. data/public/images/buttons/orange/right_03.png +0 -0
  225. data/public/images/buttons/right_01.png +0 -0
  226. data/public/images/buttons/right_01_small.png +0 -0
  227. data/public/images/buttons/sxsw-ribbon-v1.png +0 -0
  228. data/public/images/buttons/top-shine.png +0 -0
  229. data/public/images/calendar_date_select/calendar.gif +0 -0
  230. data/public/images/cart-empty.png +0 -0
  231. data/public/images/cart-empty_x32.png +0 -0
  232. data/public/images/cart-full.png +0 -0
  233. data/public/images/cart-full_x32.png +0 -0
  234. data/public/images/checkout.png +0 -0
  235. data/public/images/creditcard.gif +0 -0
  236. data/public/images/datepicker/backstripes.gif +0 -0
  237. data/public/images/datepicker/bg_header.jpg +0 -0
  238. data/public/images/datepicker/bullet1.gif +0 -0
  239. data/public/images/datepicker/bullet2.gif +0 -0
  240. data/public/images/datepicker/cal.gif +0 -0
  241. data/public/images/datepicker/gradient-e5e5e5-ffffff.gif +0 -0
  242. data/public/images/discover_cid.gif +0 -0
  243. data/public/images/drag-handle-green.png +0 -0
  244. data/public/images/flags/ad.png +0 -0
  245. data/public/images/flags/ae.png +0 -0
  246. data/public/images/flags/af.png +0 -0
  247. data/public/images/flags/ag.png +0 -0
  248. data/public/images/flags/ai.png +0 -0
  249. data/public/images/flags/al.png +0 -0
  250. data/public/images/flags/am.png +0 -0
  251. data/public/images/flags/an.png +0 -0
  252. data/public/images/flags/ao.png +0 -0
  253. data/public/images/flags/ar.png +0 -0
  254. data/public/images/flags/as.png +0 -0
  255. data/public/images/flags/at.png +0 -0
  256. data/public/images/flags/au.png +0 -0
  257. data/public/images/flags/aw.png +0 -0
  258. data/public/images/flags/ax.png +0 -0
  259. data/public/images/flags/az.png +0 -0
  260. data/public/images/flags/ba.png +0 -0
  261. data/public/images/flags/bb.png +0 -0
  262. data/public/images/flags/bd.png +0 -0
  263. data/public/images/flags/be.png +0 -0
  264. data/public/images/flags/bf.png +0 -0
  265. data/public/images/flags/bg.png +0 -0
  266. data/public/images/flags/bh.png +0 -0
  267. data/public/images/flags/bi.png +0 -0
  268. data/public/images/flags/bj.png +0 -0
  269. data/public/images/flags/bm.png +0 -0
  270. data/public/images/flags/bn.png +0 -0
  271. data/public/images/flags/bo.png +0 -0
  272. data/public/images/flags/br.png +0 -0
  273. data/public/images/flags/bs.png +0 -0
  274. data/public/images/flags/bt.png +0 -0
  275. data/public/images/flags/bv.png +0 -0
  276. data/public/images/flags/bw.png +0 -0
  277. data/public/images/flags/by.png +0 -0
  278. data/public/images/flags/bz.png +0 -0
  279. data/public/images/flags/ca.png +0 -0
  280. data/public/images/flags/catalonia.png +0 -0
  281. data/public/images/flags/cc.png +0 -0
  282. data/public/images/flags/cd.png +0 -0
  283. data/public/images/flags/cf.png +0 -0
  284. data/public/images/flags/cg.png +0 -0
  285. data/public/images/flags/ch.png +0 -0
  286. data/public/images/flags/ci.png +0 -0
  287. data/public/images/flags/ck.png +0 -0
  288. data/public/images/flags/cl.png +0 -0
  289. data/public/images/flags/cm.png +0 -0
  290. data/public/images/flags/cn.png +0 -0
  291. data/public/images/flags/co.png +0 -0
  292. data/public/images/flags/cr.png +0 -0
  293. data/public/images/flags/cs.png +0 -0
  294. data/public/images/flags/cu.png +0 -0
  295. data/public/images/flags/cv.png +0 -0
  296. data/public/images/flags/cx.png +0 -0
  297. data/public/images/flags/cy.png +0 -0
  298. data/public/images/flags/cz.png +0 -0
  299. data/public/images/flags/da.png +0 -0
  300. data/public/images/flags/de.png +0 -0
  301. data/public/images/flags/de_CH.png +0 -0
  302. data/public/images/flags/dj.png +0 -0
  303. data/public/images/flags/dm.png +0 -0
  304. data/public/images/flags/do.png +0 -0
  305. data/public/images/flags/dz.png +0 -0
  306. data/public/images/flags/ec.png +0 -0
  307. data/public/images/flags/ee.png +0 -0
  308. data/public/images/flags/eg.png +0 -0
  309. data/public/images/flags/eh.png +0 -0
  310. data/public/images/flags/england.png +0 -0
  311. data/public/images/flags/er.png +0 -0
  312. data/public/images/flags/es.png +0 -0
  313. data/public/images/flags/et.png +0 -0
  314. data/public/images/flags/europeanunion.png +0 -0
  315. data/public/images/flags/fam.png +0 -0
  316. data/public/images/flags/fi.png +0 -0
  317. data/public/images/flags/fj.png +0 -0
  318. data/public/images/flags/fk.png +0 -0
  319. data/public/images/flags/fm.png +0 -0
  320. data/public/images/flags/fo.png +0 -0
  321. data/public/images/flags/fr.png +0 -0
  322. data/public/images/flags/ga.png +0 -0
  323. data/public/images/flags/gb.png +0 -0
  324. data/public/images/flags/gd.png +0 -0
  325. data/public/images/flags/ge.png +0 -0
  326. data/public/images/flags/gf.png +0 -0
  327. data/public/images/flags/gh.png +0 -0
  328. data/public/images/flags/gi.png +0 -0
  329. data/public/images/flags/gl.png +0 -0
  330. data/public/images/flags/gm.png +0 -0
  331. data/public/images/flags/gn.png +0 -0
  332. data/public/images/flags/gp.png +0 -0
  333. data/public/images/flags/gq.png +0 -0
  334. data/public/images/flags/gr.png +0 -0
  335. data/public/images/flags/gs.png +0 -0
  336. data/public/images/flags/gt.png +0 -0
  337. data/public/images/flags/gu.png +0 -0
  338. data/public/images/flags/gw.png +0 -0
  339. data/public/images/flags/gy.png +0 -0
  340. data/public/images/flags/hk.png +0 -0
  341. data/public/images/flags/hm.png +0 -0
  342. data/public/images/flags/hn.png +0 -0
  343. data/public/images/flags/hr.png +0 -0
  344. data/public/images/flags/ht.png +0 -0
  345. data/public/images/flags/hu.png +0 -0
  346. data/public/images/flags/id.png +0 -0
  347. data/public/images/flags/ie.png +0 -0
  348. data/public/images/flags/il.png +0 -0
  349. data/public/images/flags/in.png +0 -0
  350. data/public/images/flags/io.png +0 -0
  351. data/public/images/flags/iq.png +0 -0
  352. data/public/images/flags/ir.png +0 -0
  353. data/public/images/flags/is.png +0 -0
  354. data/public/images/flags/it.png +0 -0
  355. data/public/images/flags/jm.png +0 -0
  356. data/public/images/flags/jo.png +0 -0
  357. data/public/images/flags/jp.png +0 -0
  358. data/public/images/flags/ke.png +0 -0
  359. data/public/images/flags/kg.png +0 -0
  360. data/public/images/flags/kh.png +0 -0
  361. data/public/images/flags/ki.png +0 -0
  362. data/public/images/flags/km.png +0 -0
  363. data/public/images/flags/kn.png +0 -0
  364. data/public/images/flags/kp.png +0 -0
  365. data/public/images/flags/kr.png +0 -0
  366. data/public/images/flags/kw.png +0 -0
  367. data/public/images/flags/ky.png +0 -0
  368. data/public/images/flags/kz.png +0 -0
  369. data/public/images/flags/la.png +0 -0
  370. data/public/images/flags/lb.png +0 -0
  371. data/public/images/flags/lc.png +0 -0
  372. data/public/images/flags/li.png +0 -0
  373. data/public/images/flags/lk.png +0 -0
  374. data/public/images/flags/lr.png +0 -0
  375. data/public/images/flags/ls.png +0 -0
  376. data/public/images/flags/lt.png +0 -0
  377. data/public/images/flags/lu.png +0 -0
  378. data/public/images/flags/lv.png +0 -0
  379. data/public/images/flags/ly.png +0 -0
  380. data/public/images/flags/ma.png +0 -0
  381. data/public/images/flags/mc.png +0 -0
  382. data/public/images/flags/md.png +0 -0
  383. data/public/images/flags/me.png +0 -0
  384. data/public/images/flags/mg.png +0 -0
  385. data/public/images/flags/mh.png +0 -0
  386. data/public/images/flags/mk.png +0 -0
  387. data/public/images/flags/ml.png +0 -0
  388. data/public/images/flags/mm.png +0 -0
  389. data/public/images/flags/mn.png +0 -0
  390. data/public/images/flags/mo.png +0 -0
  391. data/public/images/flags/mp.png +0 -0
  392. data/public/images/flags/mq.png +0 -0
  393. data/public/images/flags/mr.png +0 -0
  394. data/public/images/flags/ms.png +0 -0
  395. data/public/images/flags/mt.png +0 -0
  396. data/public/images/flags/mu.png +0 -0
  397. data/public/images/flags/mv.png +0 -0
  398. data/public/images/flags/mw.png +0 -0
  399. data/public/images/flags/mx.png +0 -0
  400. data/public/images/flags/my.png +0 -0
  401. data/public/images/flags/mz.png +0 -0
  402. data/public/images/flags/na.png +0 -0
  403. data/public/images/flags/nc.png +0 -0
  404. data/public/images/flags/ne.png +0 -0
  405. data/public/images/flags/nf.png +0 -0
  406. data/public/images/flags/ng.png +0 -0
  407. data/public/images/flags/ni.png +0 -0
  408. data/public/images/flags/nl.png +0 -0
  409. data/public/images/flags/no.png +0 -0
  410. data/public/images/flags/np.png +0 -0
  411. data/public/images/flags/nr.png +0 -0
  412. data/public/images/flags/nu.png +0 -0
  413. data/public/images/flags/nz.png +0 -0
  414. data/public/images/flags/om.png +0 -0
  415. data/public/images/flags/pa.png +0 -0
  416. data/public/images/flags/pe.png +0 -0
  417. data/public/images/flags/pf.png +0 -0
  418. data/public/images/flags/pg.png +0 -0
  419. data/public/images/flags/ph.png +0 -0
  420. data/public/images/flags/pk.png +0 -0
  421. data/public/images/flags/pl.png +0 -0
  422. data/public/images/flags/pm.png +0 -0
  423. data/public/images/flags/pn.png +0 -0
  424. data/public/images/flags/pr.png +0 -0
  425. data/public/images/flags/ps.png +0 -0
  426. data/public/images/flags/pt.png +0 -0
  427. data/public/images/flags/pw.png +0 -0
  428. data/public/images/flags/py.png +0 -0
  429. data/public/images/flags/qa.png +0 -0
  430. data/public/images/flags/re.png +0 -0
  431. data/public/images/flags/ro.png +0 -0
  432. data/public/images/flags/rs.png +0 -0
  433. data/public/images/flags/ru.png +0 -0
  434. data/public/images/flags/rw.png +0 -0
  435. data/public/images/flags/sa.png +0 -0
  436. data/public/images/flags/sb.png +0 -0
  437. data/public/images/flags/sc.png +0 -0
  438. data/public/images/flags/scotland.png +0 -0
  439. data/public/images/flags/sd.png +0 -0
  440. data/public/images/flags/se.png +0 -0
  441. data/public/images/flags/sg.png +0 -0
  442. data/public/images/flags/sh.png +0 -0
  443. data/public/images/flags/si.png +0 -0
  444. data/public/images/flags/sj.png +0 -0
  445. data/public/images/flags/sk.png +0 -0
  446. data/public/images/flags/sl.png +0 -0
  447. data/public/images/flags/sm.png +0 -0
  448. data/public/images/flags/sn.png +0 -0
  449. data/public/images/flags/so.png +0 -0
  450. data/public/images/flags/sr.png +0 -0
  451. data/public/images/flags/st.png +0 -0
  452. data/public/images/flags/sv.png +0 -0
  453. data/public/images/flags/sy.png +0 -0
  454. data/public/images/flags/sz.png +0 -0
  455. data/public/images/flags/tc.png +0 -0
  456. data/public/images/flags/td.png +0 -0
  457. data/public/images/flags/tf.png +0 -0
  458. data/public/images/flags/tg.png +0 -0
  459. data/public/images/flags/th.png +0 -0
  460. data/public/images/flags/tj.png +0 -0
  461. data/public/images/flags/tk.png +0 -0
  462. data/public/images/flags/tl.png +0 -0
  463. data/public/images/flags/tm.png +0 -0
  464. data/public/images/flags/tn.png +0 -0
  465. data/public/images/flags/to.png +0 -0
  466. data/public/images/flags/tr.png +0 -0
  467. data/public/images/flags/tt.png +0 -0
  468. data/public/images/flags/tv.png +0 -0
  469. data/public/images/flags/tw.png +0 -0
  470. data/public/images/flags/tz.png +0 -0
  471. data/public/images/flags/ua.png +0 -0
  472. data/public/images/flags/ug.png +0 -0
  473. data/public/images/flags/um.png +0 -0
  474. data/public/images/flags/us.png +0 -0
  475. data/public/images/flags/uy.png +0 -0
  476. data/public/images/flags/uz.png +0 -0
  477. data/public/images/flags/va.png +0 -0
  478. data/public/images/flags/vc.png +0 -0
  479. data/public/images/flags/ve.png +0 -0
  480. data/public/images/flags/vg.png +0 -0
  481. data/public/images/flags/vi.png +0 -0
  482. data/public/images/flags/vn.png +0 -0
  483. data/public/images/flags/vu.png +0 -0
  484. data/public/images/flags/wales.png +0 -0
  485. data/public/images/flags/wf.png +0 -0
  486. data/public/images/flags/ws.png +0 -0
  487. data/public/images/flags/ye.png +0 -0
  488. data/public/images/flags/yt.png +0 -0
  489. data/public/images/flags/za.png +0 -0
  490. data/public/images/flags/zm.png +0 -0
  491. data/public/images/flags/zw.png +0 -0
  492. data/public/images/green/left_01.png +0 -0
  493. data/public/images/green/right_01.png +0 -0
  494. data/public/images/grid.png +0 -0
  495. data/public/images/left_01.png +0 -0
  496. data/public/images/left_01_small.png +0 -0
  497. data/public/images/master_cid.jpg +0 -0
  498. data/public/images/menu-current.png +0 -0
  499. data/public/images/menu-hover.png +0 -0
  500. data/public/images/noimage/mini.jpg +0 -0
  501. data/public/images/noimage/product.jpg +0 -0
  502. data/public/images/noimage/small.jpg +0 -0
  503. data/public/images/openid-inputicon.gif +0 -0
  504. data/public/images/orange/left_03.png +0 -0
  505. data/public/images/orange/right_03.png +0 -0
  506. data/public/images/progress.gif +0 -0
  507. data/public/images/rails.png +0 -0
  508. data/public/images/right_01.png +0 -0
  509. data/public/images/right_01_small.png +0 -0
  510. data/public/images/separator.png +0 -0
  511. data/public/images/shadow-top.png +0 -0
  512. data/public/images/shadow_top.png +0 -0
  513. data/public/images/spinner.gif +0 -0
  514. data/public/images/spree.jpg +0 -0
  515. data/public/images/spree/progress.gif +0 -0
  516. data/public/images/spree/spinner.gif +0 -0
  517. data/public/images/spree/spree.jpg +0 -0
  518. data/public/images/step-progress/completed-completed.gif +0 -0
  519. data/public/images/step-progress/completed-current.gif +0 -0
  520. data/public/images/step-progress/completed-first.gif +0 -0
  521. data/public/images/step-progress/current-first.gif +0 -0
  522. data/public/images/step-progress/current-incomplete.gif +0 -0
  523. data/public/images/step-progress/current-right.gif +0 -0
  524. data/public/images/step-progress/incomplete-incomplete.gif +0 -0
  525. data/public/images/step-progress/incomplete-right.gif +0 -0
  526. data/public/images/steps/1.png +0 -0
  527. data/public/images/steps/1_small.png +0 -0
  528. data/public/images/steps/2.png +0 -0
  529. data/public/images/steps/2_small.png +0 -0
  530. data/public/images/steps/3.png +0 -0
  531. data/public/images/steps/3_small.png +0 -0
  532. data/public/images/steps/4.png +0 -0
  533. data/public/images/steps/4_small.png +0 -0
  534. data/public/images/steps/5.png +0 -0
  535. data/public/images/steps/5_small.png +0 -0
  536. data/public/images/steps/6.png +0 -0
  537. data/public/images/steps/6_small.png +0 -0
  538. data/public/images/sxsw-ribbon-v1.png +0 -0
  539. data/public/images/tab_bottom.gif +0 -0
  540. data/public/images/tile-header.png +0 -0
  541. data/public/images/tile-slider.png +0 -0
  542. data/public/images/top-shine.png +0 -0
  543. data/public/images/tree-nav-icons/bullet.gif +0 -0
  544. data/public/images/tree-nav-icons/minus.gif +0 -0
  545. data/public/images/tree-nav-icons/plus.gif +0 -0
  546. data/public/images/tree-nav-icons/treeview-loading.gif +0 -0
  547. data/public/images/tree-nav-icons/treeview-sprite.gif +0 -0
  548. data/public/images/update.png +0 -0
  549. data/public/images/visa_cid.gif +0 -0
  550. data/public/images/wrapper-back-2.png +0 -0
  551. data/public/images/wrapper-back.png +0 -0
  552. data/public/images/yui-menubaritem_submenuindicator.png +0 -0
  553. data/public/images/yui-menubaritem_submenuindicator_disabled.png +0 -0
  554. data/public/images/yui-menuitem_checkbox.png +0 -0
  555. data/public/images/yui-menuitem_checkbox_disabled.png +0 -0
  556. data/public/images/yui-menuitem_submenuindicator.png +0 -0
  557. data/public/images/yui-menuitem_submenuindicator_disabled.png +0 -0
  558. data/public/images/yui-sprite.png +0 -0
  559. data/public/javascripts/additional-methods.js +0 -236
  560. data/public/javascripts/admin/address_states.js +0 -25
  561. data/public/javascripts/admin/checkouts/edit.js +0 -129
  562. data/public/javascripts/admin/orders/edit.js +0 -96
  563. data/public/javascripts/admin/orders/edit_form.js +0 -17
  564. data/public/javascripts/admin/payments/new.js +0 -9
  565. data/public/javascripts/admin/unobtrusive_handlers.js +0 -15
  566. data/public/javascripts/calculator.js +0 -13
  567. data/public/javascripts/checkout.js +0 -65
  568. data/public/javascripts/dashboard.js +0 -143
  569. data/public/javascripts/datepicker.js +0 -1445
  570. data/public/javascripts/gateway.js +0 -13
  571. data/public/javascripts/jqPlot/excanvas.min.js +0 -1
  572. data/public/javascripts/jqPlot/jquery.jqplot.min.js +0 -14
  573. data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -14
  574. data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -14
  575. data/public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +0 -14
  576. data/public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +0 -14
  577. data/public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +0 -14
  578. data/public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js +0 -14
  579. data/public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js +0 -14
  580. data/public/javascripts/jquery-1.3.2.min.js +0 -19
  581. data/public/javascripts/jquery-and-plugins.js +0 -36
  582. data/public/javascripts/jquery-ui.js +0 -188
  583. data/public/javascripts/jquery.alerts/images/help.gif +0 -0
  584. data/public/javascripts/jquery.alerts/images/important.gif +0 -0
  585. data/public/javascripts/jquery.alerts/images/info.gif +0 -0
  586. data/public/javascripts/jquery.alerts/images/title.gif +0 -0
  587. data/public/javascripts/jquery.alerts/jquery.alerts.css +0 -57
  588. data/public/javascripts/jquery.alerts/jquery.alerts.js +0 -235
  589. data/public/javascripts/jquery.alerts/jquery.alerts.spree.css +0 -30
  590. data/public/javascripts/jquery.autocomplete.min.js +0 -13
  591. data/public/javascripts/jquery.js +0 -19
  592. data/public/javascripts/jquery.suggest.js +0 -276
  593. data/public/javascripts/jquery.template.js +0 -255
  594. data/public/javascripts/jquery.validate.min.js +0 -16
  595. data/public/javascripts/jrails.autocomplete.js +0 -274
  596. data/public/javascripts/jrails.js +0 -1
  597. data/public/javascripts/jsTree/jquery.tree.js +0 -2058
  598. data/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -129
  599. data/public/javascripts/jsTree/themes/apple/bg.jpg +0 -0
  600. data/public/javascripts/jsTree/themes/apple/dot_for_ie.gif +0 -0
  601. data/public/javascripts/jsTree/themes/apple/icons.png +0 -0
  602. data/public/javascripts/jsTree/themes/apple/style.css +0 -34
  603. data/public/javascripts/jsTree/themes/apple/throbber.gif +0 -0
  604. data/public/javascripts/lang/af.js +0 -40
  605. data/public/javascripts/lang/ar.js +0 -50
  606. data/public/javascripts/lang/de.js +0 -40
  607. data/public/javascripts/lang/du.js +0 -40
  608. data/public/javascripts/lang/en.js +0 -42
  609. data/public/javascripts/lang/es.js +0 -41
  610. data/public/javascripts/lang/fi.js +0 -40
  611. data/public/javascripts/lang/fr.js +0 -44
  612. data/public/javascripts/lang/gr.js +0 -40
  613. data/public/javascripts/lang/he.js +0 -49
  614. data/public/javascripts/lang/it.js +0 -13
  615. data/public/javascripts/lang/nl.js +0 -40
  616. data/public/javascripts/lang/no.js +0 -40
  617. data/public/javascripts/lang/pt.js +0 -50
  618. data/public/javascripts/lang/ro.js +0 -40
  619. data/public/javascripts/lang/ru.js +0 -40
  620. data/public/javascripts/lang/sp.js +0 -40
  621. data/public/javascripts/lang/sv.js +0 -41
  622. data/public/javascripts/lang/ua.js +0 -40
  623. data/public/javascripts/localization/messages_cn.js +0 -24
  624. data/public/javascripts/localization/messages_cs.js +0 -23
  625. data/public/javascripts/localization/messages_da.js +0 -21
  626. data/public/javascripts/localization/messages_de.js +0 -21
  627. data/public/javascripts/localization/messages_es.js +0 -24
  628. data/public/javascripts/localization/messages_fr.js +0 -23
  629. data/public/javascripts/localization/messages_hu.js +0 -21
  630. data/public/javascripts/localization/messages_it.js +0 -26
  631. data/public/javascripts/localization/messages_kk.js +0 -23
  632. data/public/javascripts/localization/messages_nl.js +0 -23
  633. data/public/javascripts/localization/messages_no.js +0 -23
  634. data/public/javascripts/localization/messages_pl.js +0 -23
  635. data/public/javascripts/localization/messages_ptbr.js +0 -30
  636. data/public/javascripts/localization/messages_ro.js +0 -24
  637. data/public/javascripts/localization/messages_ru.js +0 -23
  638. data/public/javascripts/localization/messages_se.js +0 -23
  639. data/public/javascripts/localization/messages_sk.js +0 -21
  640. data/public/javascripts/localization/messages_tr.js +0 -24
  641. data/public/javascripts/localization/messages_tw.js +0 -24
  642. data/public/javascripts/localization/messages_ua.js +0 -24
  643. data/public/javascripts/nested-attribute.js +0 -25
  644. data/public/javascripts/open_id.js +0 -15
  645. data/public/javascripts/product.js +0 -49
  646. data/public/javascripts/spree.js +0 -53
  647. data/public/javascripts/taxonomy.js +0 -196
  648. data/public/javascripts/zone.js +0 -40
  649. data/public/stylesheets/admin/admin-forms.css +0 -159
  650. data/public/stylesheets/admin/admin-reset.css +0 -67
  651. data/public/stylesheets/admin/admin-tables.css +0 -39
  652. data/public/stylesheets/admin/admin-typography.css +0 -117
  653. data/public/stylesheets/admin/admin.css +0 -571
  654. data/public/stylesheets/admin/dashboard.css +0 -143
  655. data/public/stylesheets/admin/edit_checkouts.css +0 -57
  656. data/public/stylesheets/admin/edit_orders.css +0 -65
  657. data/public/stylesheets/admin/grids.css +0 -314
  658. data/public/stylesheets/admin/reset-fonts-grids-2-6-0.css +0 -7
  659. data/public/stylesheets/admin/yui-includes.css +0 -14
  660. data/public/stylesheets/datepicker.css +0 -263
  661. data/public/stylesheets/jquery.autocomplete.css +0 -48
  662. data/public/stylesheets/scaffold.css +0 -54
  663. data/public/stylesheets/screen.css +0 -1194
  664. data/script/autospec +0 -5
  665. data/script/breakpointer +0 -3
  666. data/script/performance/request +0 -3
  667. data/script/spec +0 -5
  668. data/script/spec_server +0 -125
  669. data/spec/controllers/admin/configurations_controller_spec.rb +0 -9
  670. data/spec/controllers/admin/mail_settings_controller_spec.rb +0 -24
  671. data/spec/controllers/admin/shipping_categories_controller_spec.rb +0 -10
  672. data/spec/controllers/admin/shipping_methods_controller_spec.rb +0 -10
  673. data/spec/controllers/countries_controller_spec.rb +0 -24
  674. data/spec/controllers/orders_controller_spec.rb +0 -35
  675. data/spec/controllers/products_controller_spec.rb +0 -16
  676. data/spec/controllers/states_controller_spec.rb +0 -18
  677. data/spec/controllers/taxons_controller_spec.rb +0 -18
  678. data/spec/fixtures/app_configurations.yml +0 -7
  679. data/spec/fixtures/countries.yml +0 -3
  680. data/spec/fixtures/gateways.yml +0 -8
  681. data/spec/fixtures/preferences.yml +0 -15
  682. data/spec/fixtures/roles.yml +0 -2
  683. data/spec/fixtures/states.yml +0 -2
  684. data/spec/fixtures/tax_categories.yml +0 -4
  685. data/spec/fixtures/users.yml +0 -5
  686. data/spec/fixtures/zone_members.yml +0 -7
  687. data/spec/fixtures/zones.yml +0 -4
  688. data/spec/lib/easy_role_requirement_system_spec.rb +0 -140
  689. data/spec/models/address_spec.rb +0 -79
  690. data/spec/models/app_configuration_spec.rb +0 -13
  691. data/spec/models/creditcard_payment_spec.rb +0 -17
  692. data/spec/models/creditcard_spec.rb +0 -43
  693. data/spec/models/inventory_unit_spec.rb +0 -18
  694. data/spec/models/option_type_spec.rb +0 -36
  695. data/spec/models/option_value_spec.rb +0 -39
  696. data/spec/models/order_spec.rb +0 -207
  697. data/spec/models/payment_sepc.rb +0 -29
  698. data/spec/models/product_option_type_spec.rb +0 -38
  699. data/spec/models/product_property_spec.rb +0 -29
  700. data/spec/models/property_spec.rb +0 -37
  701. data/spec/models/prototype_spec.rb +0 -35
  702. data/spec/models/shipment_spec.rb +0 -8
  703. data/spec/models/shipping_category_spec.rb +0 -8
  704. data/spec/models/shipping_order_spec.rb +0 -113
  705. data/spec/models/tax_category_spec.rb +0 -11
  706. data/spec/models/taxon_spec.rb +0 -50
  707. data/spec/models/taxonomy_spec.rb +0 -37
  708. data/spec/models/zone_member_spec.rb +0 -5
  709. data/spec/models/zone_spec.rb +0 -137
  710. data/spec/rcov.opts +0 -2
  711. data/spec/spec.opts +0 -4
  712. data/spec/spec_helper.rb +0 -79
  713. data/vendor/extensions/overview_dashboard/spec/spec.opts +0 -6
  714. data/vendor/extensions/overview_dashboard/spec/spec_helper.rb +0 -37
  715. data/vendor/extensions/payment_gateway/spec/helpers/admin/gateways_helper_spec.rb +0 -6
  716. data/vendor/extensions/payment_gateway/spec/models/creditcard_spec.rb +0 -15
  717. data/vendor/extensions/payment_gateway/spec/models/gateway_spec.rb +0 -11
  718. data/vendor/extensions/payment_gateway/spec/models/order_spec.rb +0 -45
  719. data/vendor/extensions/payment_gateway/spec/spec.opts +0 -6
  720. data/vendor/extensions/payment_gateway/spec/spec_helper.rb +0 -37
  721. data/vendor/extensions/theme_default/spec/spec.opts +0 -6
  722. data/vendor/extensions/theme_default/spec/spec_helper.rb +0 -37
@@ -3,4 +3,5 @@ en:
3
3
  signature: Signature
4
4
  currency_code: "Currency Code"
5
5
  pem: PEM
6
- secure_profile_api_key: Payment Profile API Key
6
+ secure_profile_api_key: Payment Profile API Key
7
+ validate_on_profile_create: Validate card
@@ -465,6 +465,8 @@ module ActiveMerchant #:nodoc:
465
465
  def build_create_customer_profile_request(xml, options)
466
466
  add_profile(xml, options[:profile])
467
467
 
468
+ xml.tag!('validationMode',CIM_VALIDATION_MODES[options[:validation_mode]]) if options[:validation_mode]
469
+
468
470
  xml.target!
469
471
  end
470
472
 
@@ -761,7 +763,7 @@ module ActiveMerchant #:nodoc:
761
763
  Rails.logger.error("Gateway Error: #{text}") unless success
762
764
 
763
765
  direct_response_params = parse_direct_response(response_params['direct_response'])
764
-
766
+
765
767
  response = Response.new(success, text, response_params,
766
768
  :test => test_mode,
767
769
  :authorization => response_params['customer_profile_id'] || (response_params['profile'] ? response_params['profile']['customer_profile_id'] : direct_response_params['transaction_id']),
@@ -775,7 +777,7 @@ module ActiveMerchant #:nodoc:
775
777
  response.authorization = response.params['direct_response']['transaction_id']
776
778
  end
777
779
  end
778
-
780
+
779
781
  response
780
782
  end
781
783
 
@@ -61,7 +61,7 @@ module Spree
61
61
  :avs_response => response.avs_result['code']
62
62
  )
63
63
  rescue ActiveMerchant::ConnectionError => e
64
- gateway_error t(:unable_to_connect_to_gateway)
64
+ gateway_error I18n.t(:unable_to_connect_to_gateway)
65
65
  end
66
66
 
67
67
  def void(payment)
@@ -9,8 +9,8 @@ namespace :spree do
9
9
  path = file.sub(PaymentGatewayExtension.root, '')
10
10
  directory = File.dirname(path)
11
11
  puts "Copying #{path}..."
12
- mkdir_p RAILS_ROOT + directory
13
- cp file, RAILS_ROOT + path
12
+ mkdir_p Rails.root + directory
13
+ cp file, Rails.root + path
14
14
  end
15
15
  end
16
16
  end
@@ -19,6 +19,7 @@ class PaymentGatewayExtension < Spree::Extension
19
19
  Gateway::Bogus,
20
20
  Gateway::AuthorizeNet,
21
21
  Gateway::AuthorizeNetCim,
22
+ Gateway::Braintree,
22
23
  Gateway::Eway,
23
24
  Gateway::Linkpoint,
24
25
  Gateway::PayPal,
@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../test_helper'
3
3
  class AuthorizeNetCimTest < Test::Unit::TestCase
4
4
 
5
5
  def setup
6
+ Gateway.update_all(:active => false)
6
7
  @cim_gateway = ActiveMerchant::Billing::AuthorizeNetCimGateway.new(
7
8
  :login => 'x',
8
9
  :password => 'y'
@@ -25,7 +26,7 @@ class AuthorizeNetCimTest < Test::Unit::TestCase
25
26
  @checkout = Factory(:checkout, :bill_address => @address, :ship_address => @address)
26
27
  @payment = Factory(:payment, :source => @creditcard, :payable => @checkout)
27
28
  @checkout.payments << @payment
28
- @gateway = Gateway::AuthorizeNetCim.create!(:name => 'Authorize.net CIM Gateway')
29
+ @gateway = Gateway::AuthorizeNetCim.create!(:name => 'Authorize.net CIM Gateway', :active => true)
29
30
  @creditcard.reload
30
31
 
31
32
  @address_options = {
@@ -0,0 +1,200 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require "braintree"
3
+
4
+ class BraintreeTest < Test::Unit::TestCase
5
+
6
+ def setup
7
+ Gateway.update_all(:active => false)
8
+ @gateway = Gateway::Braintree.create!(:name => "Braintree Gateway", :environment => "test", :active => true)
9
+
10
+ # TODO: really need to figure out how preferences work in Spree
11
+ # doing configuration this way for now
12
+ ::Braintree::Configuration.environment = :sandbox
13
+ ::Braintree::Configuration.merchant_id = "zbn5yzq9t7wmwx42"
14
+ ::Braintree::Configuration.public_key = "ym9djwqpkxbv3xzt"
15
+ ::Braintree::Configuration.private_key = "4ghghkyp2yy6yqc8"
16
+ ::Braintree::Configuration.class_eval do
17
+ def self.merchant_id=(value); end
18
+ def self.public_key=(value); end
19
+ def self.private_key=(value); end
20
+ end
21
+
22
+ with_payment_profiles_off do
23
+ @country = Factory(:country, :name => "United States", :iso_name => "UNITED STATES", :iso3 => "USA", :iso => "US", :numcode => 840)
24
+ @address = Factory(:address,
25
+ :firstname => 'John',
26
+ :lastname => 'Doe',
27
+ :address1 => '1234 My Street',
28
+ :address2 => 'Apt 1',
29
+ :city => 'Washington DC',
30
+ :zipcode => '20123',
31
+ :phone => '(555)555-5555',
32
+ :state_name => 'MD',
33
+ :country => @country
34
+ )
35
+ @checkout = Factory(:checkout, :bill_address => @address, :ship_address => @address)
36
+ @creditcard = Factory(:creditcard, :verification_value => '123', :number => '5105105105105100', :month => 9, :year => Time.now.year + 1, :first_name => 'John', :last_name => 'Doe')
37
+ @payment = Factory(:payment, :source => @creditcard, :payable => @checkout, :amount => @checkout.order.total)
38
+ end
39
+ end
40
+
41
+ context "provider_class" do
42
+ should "be braintree gateway" do
43
+ @gateway.provider_class.should == ::ActiveMerchant::Billing::BraintreeGateway
44
+ end
45
+ end
46
+
47
+ context "authorize" do
48
+ should "return a success response with an authorization code" do
49
+ result = @gateway.authorize(500, @creditcard)
50
+ assert_equal true, result.success?
51
+ assert_match /\A\w{6}\z/, result.authorization
52
+ assert_equal Braintree::Transaction::Status::Authorized, Braintree::Transaction.find(result.authorization).status
53
+ end
54
+
55
+ should "work through the spree payment interface" do
56
+ Spree::Config.set :auto_capture => false
57
+ assert_equal 0, @payment.txns.size
58
+ @payment.process!
59
+ assert_equal 1, @payment.txns.size
60
+ assert_match /\A\w{6}\z/, @payment.txns[0].response_code
61
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
62
+ assert_equal Braintree::Transaction::Status::Authorized, transaction.status
63
+ assert_equal "510510******5100", transaction.credit_card_details.masked_number
64
+ assert_equal "09/#{Time.now.year + 1}", transaction.credit_card_details.expiration_date
65
+ assert_equal "John", transaction.customer_details.first_name
66
+ assert_equal "Doe", transaction.customer_details.last_name
67
+ end
68
+ end
69
+
70
+ context "capture" do
71
+ should "capture a previous authorization" do
72
+ @payment.process!
73
+ assert_equal 1, @payment.txns.size
74
+ assert_match /\A\w{6}\z/, @payment.txns[0].response_code
75
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
76
+ assert_equal Braintree::Transaction::Status::Authorized, transaction.status
77
+ capture_result = @gateway.capture(@payment.txns.first, :ignored_arg_creditcard, :ignored_arg_options)
78
+ assert_equal true, capture_result.success?
79
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
80
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
81
+ end
82
+
83
+ should "raise an error if capture fails using spree interface" do
84
+ Spree::Config.set :auto_capture => false
85
+ assert_equal 0, @payment.txns.size
86
+ @payment.process!
87
+ assert_equal 1, @payment.txns.size
88
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
89
+ assert_equal Braintree::Transaction::Status::Authorized, transaction.status
90
+ @payment.source.capture(@payment) # as done in PaymentsController#fire
91
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
92
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
93
+ assert_raises(Spree::GatewayError, "Cannot submit for settlement unless status is authorized. (91507)") do
94
+ @payment.source.capture(@payment) # as done in PaymentsController#fire
95
+ end
96
+ end
97
+
98
+ should "work using the spree interface" do
99
+ Spree::Config.set :auto_capture => false
100
+ assert_equal 0, @payment.txns.size
101
+ @payment.process!
102
+ assert_equal 1, @payment.txns.size
103
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
104
+ assert_equal Braintree::Transaction::Status::Authorized, transaction.status
105
+ @payment.source.capture(@payment) # as done in PaymentsController#fire
106
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
107
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
108
+ end
109
+ end
110
+
111
+ context "purchase" do
112
+ should "return a success response with an authorization code" do
113
+ result = @gateway.purchase(500, @creditcard)
114
+ assert_equal true, result.success?
115
+ assert_match /\A\w{6}\z/, result.authorization
116
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, Braintree::Transaction.find(result.authorization).status
117
+ end
118
+
119
+ should "work through the spree payment interface with payment profiles" do
120
+ purchase_using_spree_interface
121
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
122
+ assert_match /\A\w{4}\z/, transaction.credit_card_details.token
123
+ end
124
+
125
+ should "work through the spree payment interface without payment profiles" do
126
+ with_payment_profiles_off do
127
+ purchase_using_spree_interface
128
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
129
+ assert_equal nil, transaction.credit_card_details.token
130
+ end
131
+ end
132
+ end
133
+
134
+ context "credit" do
135
+ should "work through the spree interface" do
136
+ purchase_using_spree_interface
137
+ credit_using_spree_interface
138
+ end
139
+ end
140
+
141
+ context "void" do
142
+ should "work through the spree creditcard / payment interface" do
143
+ assert_equal 0, @payment.txns.size
144
+ @payment.process!
145
+ assert_equal 1, @payment.txns.size
146
+ assert_match /\A\w{6}\z/, @payment.txns[0].response_code
147
+ transaction = Braintree::Transaction.find(@payment.txns[0].response_code)
148
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
149
+ @creditcard.void(@payment)
150
+ transaction = Braintree::Transaction.find(transaction.id)
151
+ assert_equal Braintree::Transaction::Status::Voided, transaction.status
152
+ end
153
+ end
154
+
155
+ def credit_using_spree_interface
156
+ @payment.order.payments << @payment
157
+ assert_equal 1, @payment.txns.size
158
+ @payment.source.credit(@payment) # as done in PaymentsController#fire
159
+ assert_equal 2, @payment.txns.size
160
+ assert_match /\A\w{6}\z/, @payment.txns[1].response_code
161
+ transaction = ::Braintree::Transaction.find(@payment.txns[1].response_code)
162
+ assert_equal Braintree::Transaction::Type::Credit, transaction.type
163
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
164
+ assert_equal "510510******5100", transaction.credit_card_details.masked_number
165
+ assert_equal "09/#{Time.now.year + 1}", transaction.credit_card_details.expiration_date
166
+ assert_equal "John", transaction.customer_details.first_name
167
+ assert_equal "Doe", transaction.customer_details.last_name
168
+ end
169
+
170
+ def purchase_using_spree_interface
171
+ Spree::Config.set :auto_capture => true
172
+ @payment.send(:create_payment_profile)
173
+ assert_equal 0, @payment.txns.size
174
+ @payment.process! # as done in PaymentsController#create
175
+ assert_equal 1, @payment.txns.size
176
+ assert_match /\A\w{6}\z/, @payment.txns[0].response_code
177
+ transaction = ::Braintree::Transaction.find(@payment.txns[0].response_code)
178
+ assert_equal Braintree::Transaction::Status::SubmittedForSettlement, transaction.status
179
+ assert_equal "510510******5100", transaction.credit_card_details.masked_number
180
+ assert_equal "09/#{Time.now.year + 1}", transaction.credit_card_details.expiration_date
181
+ assert_equal "John", transaction.customer_details.first_name
182
+ assert_equal "Doe", transaction.customer_details.last_name
183
+ end
184
+
185
+ def with_payment_profiles_off(&block)
186
+ Gateway::Braintree.class_eval do
187
+ def payment_profiles_supported?
188
+ false
189
+ end
190
+ end
191
+ yield
192
+ ensure
193
+ Gateway::Braintree.class_eval do
194
+ def payment_profiles_supported?
195
+ true
196
+ end
197
+ end
198
+ end
199
+ end
200
+
@@ -67,7 +67,7 @@ namespace :spec do
67
67
  # desc "Translate specs from pre-0.9 to 0.9 style"
68
68
  # task :translate do
69
69
  # translator = ::Spec::Translator.new
70
- # dir = RAILS_ROOT + '/spec'
70
+ # dir = Rails.root + '/spec'
71
71
  # translator.translate(dir, dir)
72
72
  # end
73
73
 
@@ -91,7 +91,7 @@ namespace :spec do
91
91
  task :load => :environment do
92
92
  require 'active_record/fixtures'
93
93
  ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
94
- (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
94
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(Rails.root.join('spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
95
95
  Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
96
96
  end
97
97
  end
@@ -29,7 +29,12 @@ button, a.button, input.button {
29
29
 
30
30
  button.primary, a.button.primary, input.button.primary {
31
31
  font-weight: bold;
32
- color: #000;
32
+ color: #000;
33
+ }
34
+
35
+ button.disabled, a.button.disabled, input.button.disabled{
36
+ font-weight: bold;
37
+ color: #999;
33
38
  }
34
39
 
35
40
  button:hover, a.button:hover, input.button:hover {
@@ -71,5 +76,5 @@ button::-moz-focus-inner {
71
76
  }
72
77
 
73
78
  p a.button img, p button img {
74
- margin: 0 5px 0 0;
79
+ margin: 0 5px 0 0;
75
80
  }
@@ -2,7 +2,7 @@
2
2
  @black: #000;
3
3
  @input_border: #BBB;
4
4
  @default_border_color: #DDD;
5
- @link_hover_color: #eee;
5
+ @link_hover_color: #3C7DFB;
6
6
  @lighter_text_color: #666;
7
7
  @medium_blue: #2E6AB1;
8
8
  @lightest_blue: #BBDAFD;
@@ -2,8 +2,13 @@
2
2
  @import "_mixins";
3
3
 
4
4
  body {
5
- margin-top: 10px;
6
- background: #fff url(../images/body-back.png) top left repeat-x;
5
+ margin-top: 0px;
6
+ background: #ffffff url(../images/tile-slider.png) top left repeat-x;
7
+ }
8
+
9
+ .container_bg{
10
+ width:100%;
11
+ background:url(../images/tile-header.png) top left repeat-x;
7
12
  }
8
13
 
9
14
  div.left { .leftie; }
@@ -16,7 +16,7 @@
16
16
  <tr>
17
17
  <td><label><%=t("display")%></label></td>
18
18
  <td>
19
- <%= select(:payment_method, :display, PaymentMethod::DISPLAY.collect {|display| [t(display), display == :both ? nil : display.to_s]}) %>
19
+ <%= select(:payment_method, :display_on, PaymentMethod::DISPLAY.collect {|display| [t(display), display == :both ? nil : display.to_s]}) %>
20
20
  </td>
21
21
  </tr>
22
22
  <tr>
@@ -41,11 +41,10 @@
41
41
  <%= collection_select(:payment_method, :type, @providers, :to_s, :name, {}, {:id => "gtwy-type"}) %>
42
42
 
43
43
  <% unless @object.new_record? %>
44
-
45
44
  <%= preference_fields(@object, f) %>
46
45
 
47
46
  <% if @object.respond_to?(:preferences) %>
48
47
  <div id="gateway-settings-warning" style="color:#FF0000"><%= t('provider_settings_warning')%></div>
49
- <% end %>
50
48
  <% end %>
51
- </div>
49
+ <% end %>
50
+ </div>
@@ -32,7 +32,7 @@
32
32
  <td width="120px"><%= method.name %></td>
33
33
  <td width="140px"><%= method.type %></td>
34
34
  <td width="100px"><%= method.environment.to_s.titleize %></td>
35
- <td width="60px"><%= method.display.blank? ? "Both" : t(method.display) %></td>
35
+ <td width="60px"><%= method.display_on.blank? ? "Both" : t(method.display_on) %></td>
36
36
  <td width="60px"><%= method.active ? t(:yes) : t(:no) %></td>
37
37
  <% end %>
38
38
  <td width="140px">
@@ -1,5 +1,5 @@
1
1
  <p>
2
- <%= label controller.controller_name.singularize, t("activerecord.attributes.variant." + field[:name].downcase, :default => field[:name].titleize)%><br />
2
+ <%= label controller.controller_name.singularize, field[:name], t("activerecord.attributes.variant." + field[:name].downcase, :default => field[:name].titleize)%><br />
3
3
  <%= additional_field_for(controller, field) %>
4
4
  <%= error_message_on controller.controller_name.singularize, attribute_name_for(field[:name]) %>
5
5
  </p>
@@ -4,13 +4,13 @@
4
4
  <%= f.collection_select(:calculator_type, @calculators, :to_s, :description, {}, {:id => "calc-type"}) %>
5
5
 
6
6
  <% if !@object.new_record? %>
7
- <% f.fields_for :calculator do |calculator_form| %>
8
- <div class="calculator-settings">
9
- <%= preference_fields(@object.calculator, calculator_form) %>
10
- </div>
11
- <% end %>
7
+ <div class="calculator-settings">
8
+ <% f.fields_for :calculator do |calculator_form| %>
9
+ <%= preference_fields(@object.calculator, calculator_form) %>
10
+ <% end %>
11
+ </div>
12
12
  <% if @object.calculator.respond_to?(:preferences) %>
13
13
  <div id="calculator-settings-warning"><%= t('calculator_settings_warning')%></div>
14
14
  <% end %>
15
15
  <% end %>
16
- </div>
16
+ </div>
@@ -1,22 +1,22 @@
1
1
  <% content_for :sidebar do %>
2
2
 
3
- <h3><%= t("configurations") -%></h3>
3
+ <h3><%= t("configurations") %></h3>
4
4
  <br class="clear" />
5
5
 
6
6
  <ul class="sidebar">
7
7
  <% hook :admin_configurations_sidebar_menu do %>
8
- <li<%= ' class="active"' if controller.controller_name == 'general_settings' %>><%= link_to t("general_settings"), admin_general_settings_path %></li>
9
- <li<%= ' class="active"' if controller.controller_name == 'mail_settings' %>><%= link_to t("mail_server_settings"), admin_mail_settings_path %></li>
10
- <li<%= ' class="active"' if controller.controller_name == 'tax_categories' %>><%= link_to t("tax_categories"), admin_tax_categories_path %></li>
11
- <li<%= ' class="active"' if controller.controller_name == 'zones' %>><%= link_to t("zones"), admin_zones_path %></li>
12
- <li<%= ' class="active"' if controller.controller_name == 'states' %>><%= link_to t("states"), admin_country_states_path(Spree::Config[:default_country_id]) %></li>
13
- <li<%= ' class="active"' if controller.controller_name == 'payment_methods' %>><%= link_to t("payment_methods"), admin_payment_methods_path %></li>
14
- <li<%= ' class="active"' if ['taxonomies', 'taxons'].include? controller.controller_name %>><%= link_to t("taxonomies"), admin_taxonomies_path %></li>
15
- <li<%= ' class="active"' if controller.controller_name == 'shipping_methods' %>><%= link_to t("shipping_methods"), admin_shipping_methods_path %></li>
16
- <li<%= ' class="active"' if controller.controller_name == 'inventory_settings' %>><%= link_to t("inventory_settings"), admin_inventory_settings_path %></li>
17
- <li<%= ' class="active"' if controller.controller_name == 'trackers' %>><%= link_to t("analytics_trackers"), admin_trackers_path %></li>
8
+ <li<%= raw(' class="active"') if controller.controller_name == 'general_settings' %>><%= link_to t("general_settings"), admin_general_settings_path %></li>
9
+ <li<%= raw(' class="active"') if controller.controller_name == 'mail_settings' %>><%= link_to t("mail_server_settings"), admin_mail_settings_path %></li>
10
+ <li<%= raw(' class="active"') if controller.controller_name == 'tax_categories' %>><%= link_to t("tax_categories"), admin_tax_categories_path %></li>
11
+ <li<%= raw(' class="active"') if controller.controller_name == 'zones' %>><%= link_to t("zones"), admin_zones_path %></li>
12
+ <li<%= raw(' class="active"') if controller.controller_name == 'states' %>><%= link_to t("states"), admin_country_states_path(Spree::Config[:default_country_id]) %></li>
13
+ <li<%= raw(' class="active"') if controller.controller_name == 'payment_methods' %>><%= link_to t("payment_methods"), admin_payment_methods_path %></li>
14
+ <li<%= raw(' class="active"') if ['taxonomies', 'taxons'].include? controller.controller_name %>><%= link_to t("taxonomies"), admin_taxonomies_path %></li>
15
+ <li<%= raw(' class="active"') if controller.controller_name == 'shipping_methods' %>><%= link_to t("shipping_methods"), admin_shipping_methods_path %></li>
16
+ <li<%= raw(' class="active"') if controller.controller_name == 'inventory_settings' %>><%= link_to t("inventory_settings"), admin_inventory_settings_path %></li>
17
+ <li<%= raw(' class="active"') if controller.controller_name == 'trackers' %>><%= link_to t("analytics_trackers"), admin_trackers_path %></li>
18
18
  <% end %>
19
- <li<%= ' class="active"' if controller.controller_name == 'configurations' %>><%= link_to t("complete_list"), admin_configurations_path %></li>
19
+ <li<%= raw(' class="active"') if controller.controller_name == 'configurations' %>><%= link_to t("complete_list"), admin_configurations_path %></li>
20
20
  </ul>
21
21
 
22
- <% end %>
22
+ <% end %>