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.
- data/CHANGELOG +457 -425
- data/{README.markdown → README.md} +4 -0
- data/Rakefile +2 -2
- data/app/controllers/admin/adjustments_controller.rb +8 -9
- data/app/controllers/admin/checkouts_controller.rb +10 -2
- data/app/controllers/admin/line_items_controller.rb +0 -1
- data/app/controllers/admin/payments_controller.rb +8 -7
- data/app/controllers/admin/shipments_controller.rb +1 -1
- data/app/controllers/checkouts_controller.rb +16 -5
- data/app/controllers/spree/base_controller.rb +2 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/checkouts_helper.rb +1 -1
- data/app/helpers/products_helper.rb +1 -1
- data/app/helpers/taxons_helper.rb +1 -1
- data/app/models/address.rb +9 -0
- data/app/models/checkout.rb +13 -7
- data/app/models/creditcard.rb +2 -2
- data/app/models/model_cache_cleaner.rb +13 -0
- data/app/models/order.rb +6 -8
- data/app/models/payment.rb +18 -17
- data/app/models/payment_method.rb +2 -2
- data/app/models/product.rb +1 -2
- data/app/models/return_authorization.rb +3 -1
- data/app/models/shipping_method.rb +16 -6
- data/app/models/zone.rb +34 -3
- data/config/database.yml +4 -21
- data/config/environment.rb +6 -6
- data/config/environments/test.rb +1 -0
- data/config/locales/en_spree.yml +10 -9
- data/db/migrate/20100624110730_add_display_to_shipping_methods.rb +9 -0
- data/db/migrate/20100624123336_rename_payment_method_display.rb +9 -0
- data/db/sample/orders.yml +3 -3
- data/db/sample/payments.rb +6 -5
- data/db/sample/products.rb +2 -2
- data/db/schema.rb +9 -27
- data/lib/easy_role_requirement_system.rb +1 -1
- data/lib/generators/extension/extension_generator.rb +7 -22
- data/lib/generators/extension/templates/functional_test.rb +1 -1
- data/lib/generators/extension/templates/tasks.rake +2 -2
- data/lib/generators/extension_controller/extension_controller_generator.rb +1 -1
- data/lib/generators/extension_model/extension_model_generator.rb +1 -1
- data/lib/generators/instance/instance_generator.rb +24 -24
- data/lib/generators/instance/templates/instance_generate +1 -1
- data/lib/generators/theme/theme_generator.rb +6 -10
- data/lib/plugins/extension_patches/lib/asset_copy.rb +2 -2
- data/lib/spree.rb +1 -1
- data/lib/spree/initializer.rb +15 -15
- data/lib/spree/search.rb +1 -1
- data/lib/tasks/cucumber.rake +1 -1
- data/lib/tasks/extensions.rake +6 -6
- data/lib/tasks/framework.rake +1 -1
- data/lib/tasks/instance.rake +6 -6
- data/lib/validation_group.rb +16 -16
- data/script/extension +2 -2
- data/test/functional/products_controller_test.rb +13 -0
- data/test/test_helper.rb +1 -1
- data/test/unit/checkout_test.rb +18 -9
- data/vendor/extensions/README +1 -1
- data/vendor/extensions/api/Rakefile +2 -2
- data/vendor/extensions/api/lib/tasks/api_extension_tasks.rake +2 -2
- data/vendor/extensions/overview_dashboard/Rakefile +2 -2
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +5 -5
- data/vendor/extensions/overview_dashboard/lib/tasks/overview_dashboard_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/Rakefile +2 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +6 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/braintree.rb +88 -0
- data/vendor/extensions/payment_gateway/config/locales/en.yml +2 -1
- data/vendor/extensions/payment_gateway/lib/active_merchant/billing/authorize_net_cim.rb +4 -2
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/lib/tasks/payment_gateway_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +1 -0
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +2 -1
- data/vendor/extensions/payment_gateway/test/unit/braintree_test.rb +200 -0
- data/vendor/extensions/theme_default/Rakefile +2 -2
- data/vendor/extensions/theme_default/app/stylesheets/_buttons.less +7 -2
- data/vendor/extensions/theme_default/app/stylesheets/_colors.less +1 -1
- data/vendor/extensions/theme_default/app/stylesheets/_layout.less +7 -2
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +3 -4
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_additional_field.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_calculator_fields.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +13 -13
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/_form.html.erb +6 -0
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/index.html.erb +2 -0
- data/vendor/extensions/theme_default/app/views/checkouts/_address.html.erb +7 -9
- data/vendor/extensions/theme_default/app/views/checkouts/_payment.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +36 -35
- data/vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/shared/_head.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/states/index.js.erb +1 -1
- data/vendor/extensions/theme_default/lib/tasks/theme_default_extension_tasks.rake +2 -2
- data/vendor/extensions/theme_default/public/favicon.ico +0 -0
- data/vendor/extensions/theme_default/public/images/admin/bg/header.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/calculator.js +3 -1
- data/vendor/extensions/theme_default/public/javascripts/checkout.js +44 -18
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +29 -24
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +9 -7
- data/vendor/plugins/attribute_fu/init.rb +2 -2
- data/vendor/plugins/delegate_belongs_to/spec/spec_helper.rb +1 -1
- data/vendor/plugins/jrails/install.rb +1 -1
- data/vendor/plugins/jrails/lib/tasks/jrails.rake +2 -2
- data/vendor/plugins/jrails_auto_complete/install.rb +1 -1
- data/vendor/plugins/jrails_auto_complete/uninstall.rb +1 -1
- data/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +1 -1
- metadata +59 -659
- data/lib/generators/extension/templates/RSpecRakefile +0 -137
- data/lib/generators/extension/templates/spec.opts +0 -6
- data/lib/generators/extension/templates/spec_helper.rb +0 -37
- data/lib/generators/extension_controller/templates/controller_spec.rb +0 -23
- data/lib/generators/extension_controller/templates/helper_spec.rb +0 -11
- data/lib/generators/extension_controller/templates/view_spec.rb +0 -12
- data/lib/generators/extension_model/templates/model_spec.rb +0 -11
- data/lib/tasks/rspec.rake +0 -182
- data/public/images/add-to-cart.png +0 -0
- data/public/images/admin/bg/active-tab.png +0 -0
- data/public/images/admin/bg/admin_tab_back.png +0 -0
- data/public/images/admin/bg/admin_tab_selected_back.png +0 -0
- data/public/images/admin/bg/content-back-blue.png +0 -0
- data/public/images/admin/bg/content-back-green.png +0 -0
- data/public/images/admin/bg/content-back.png +0 -0
- data/public/images/admin/bg/flash-error.png +0 -0
- data/public/images/admin/bg/flash-notice.png +0 -0
- data/public/images/admin/bg/green-stripes.gif +0 -0
- data/public/images/admin/bg/green-stripes.png +0 -0
- data/public/images/admin/bg/grid_header_back.png +0 -0
- data/public/images/admin/bg/grid_header_back_green.png +0 -0
- data/public/images/admin/bg/header-bg.png +0 -0
- data/public/images/admin/bg/header_bg.jpg +0 -0
- data/public/images/admin/bg/menu-current.png +0 -0
- data/public/images/admin/bg/red-stripes.gif +0 -0
- data/public/images/admin/bg/red-stripes.png +0 -0
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/admin/bg/subnav-divider.png +0 -0
- data/public/images/admin/bg/subnav.png +0 -0
- data/public/images/admin/bg/tab-back.png +0 -0
- data/public/images/admin/buttons/blue/left_01.png +0 -0
- data/public/images/admin/buttons/blue/right_01.png +0 -0
- data/public/images/admin/buttons/drag-handle-green.png +0 -0
- data/public/images/admin/buttons/green/left_01.png +0 -0
- data/public/images/admin/buttons/green/right_01.png +0 -0
- data/public/images/admin/buttons/left_01.png +0 -0
- data/public/images/admin/buttons/left_01_small.png +0 -0
- data/public/images/admin/buttons/orange/left_03.png +0 -0
- data/public/images/admin/buttons/orange/right_03.png +0 -0
- data/public/images/admin/buttons/right_01.png +0 -0
- data/public/images/admin/buttons/right_01_small.png +0 -0
- data/public/images/admin/icons/16x16/1.png +0 -0
- data/public/images/admin/icons/16x16/10.png +0 -0
- data/public/images/admin/icons/16x16/2.png +0 -0
- data/public/images/admin/icons/16x16/3.png +0 -0
- data/public/images/admin/icons/16x16/4.png +0 -0
- data/public/images/admin/icons/16x16/5.png +0 -0
- data/public/images/admin/icons/16x16/6.png +0 -0
- data/public/images/admin/icons/16x16/7.png +0 -0
- data/public/images/admin/icons/16x16/8.png +0 -0
- data/public/images/admin/icons/16x16/9.png +0 -0
- data/public/images/admin/icons/32x32/1.png +0 -0
- data/public/images/admin/icons/32x32/10.png +0 -0
- data/public/images/admin/icons/32x32/11.png +0 -0
- data/public/images/admin/icons/32x32/2.png +0 -0
- data/public/images/admin/icons/32x32/3.png +0 -0
- data/public/images/admin/icons/32x32/4.png +0 -0
- data/public/images/admin/icons/32x32/5.png +0 -0
- data/public/images/admin/icons/32x32/6.png +0 -0
- data/public/images/admin/icons/32x32/7.png +0 -0
- data/public/images/admin/icons/32x32/8.png +0 -0
- data/public/images/admin/icons/32x32/9.png +0 -0
- data/public/images/admin/icons/accept.png +0 -0
- data/public/images/admin/icons/add.gif +0 -0
- data/public/images/admin/icons/add.png +0 -0
- data/public/images/admin/icons/arrow-down.gif +0 -0
- data/public/images/admin/icons/cross.png +0 -0
- data/public/images/admin/icons/delete.gif +0 -0
- data/public/images/admin/icons/delete.png +0 -0
- data/public/images/admin/icons/drag.gif +0 -0
- data/public/images/admin/icons/edit.gif +0 -0
- data/public/images/admin/icons/edit.png +0 -0
- data/public/images/admin/icons/email.png +0 -0
- data/public/images/admin/icons/error.png +0 -0
- data/public/images/admin/icons/exclamation.png +0 -0
- data/public/images/admin/icons/feed.png +0 -0
- data/public/images/admin/icons/pdf.png +0 -0
- data/public/images/admin/icons/reorder.gif +0 -0
- data/public/images/admin/icons/search.gif +0 -0
- data/public/images/admin/icons/send-email.png +0 -0
- data/public/images/admin/icons/stop.png +0 -0
- data/public/images/admin/icons/tick.png +0 -0
- data/public/images/admin/icons/up.gif +0 -0
- data/public/images/admin/icons/xls.png +0 -0
- data/public/images/admin/tabs/off-left.png +0 -0
- data/public/images/admin/tabs/off-right.png +0 -0
- data/public/images/admin/tabs/on-left.png +0 -0
- data/public/images/admin/tabs/on-right.png +0 -0
- data/public/images/ajax_loader.gif +0 -0
- data/public/images/amex_cid.gif +0 -0
- data/public/images/bg-button-hover.png +0 -0
- data/public/images/bg-button-pressed.png +0 -0
- data/public/images/bg-button.gif +0 -0
- data/public/images/bg-button.png +0 -0
- data/public/images/blue/left_01.png +0 -0
- data/public/images/blue/right_01.png +0 -0
- data/public/images/body-back.png +0 -0
- data/public/images/bottom_shine.png +0 -0
- data/public/images/breadcrumb.gif +0 -0
- data/public/images/button-dark-hover.png +0 -0
- data/public/images/button-dark.png +0 -0
- data/public/images/buttons/bg-button-hover.png +0 -0
- data/public/images/buttons/bg-button-pressed.png +0 -0
- data/public/images/buttons/bg-button.gif +0 -0
- data/public/images/buttons/bg-button.png +0 -0
- data/public/images/buttons/blue/left_01.png +0 -0
- data/public/images/buttons/blue/right_01.png +0 -0
- data/public/images/buttons/button-dark-hover.png +0 -0
- data/public/images/buttons/button-dark.png +0 -0
- data/public/images/buttons/drag-handle-green.png +0 -0
- data/public/images/buttons/green/left_01.png +0 -0
- data/public/images/buttons/green/right_01.png +0 -0
- data/public/images/buttons/left_01.png +0 -0
- data/public/images/buttons/left_01_small.png +0 -0
- data/public/images/buttons/orange/left_03.png +0 -0
- data/public/images/buttons/orange/right_03.png +0 -0
- data/public/images/buttons/right_01.png +0 -0
- data/public/images/buttons/right_01_small.png +0 -0
- data/public/images/buttons/sxsw-ribbon-v1.png +0 -0
- data/public/images/buttons/top-shine.png +0 -0
- data/public/images/calendar_date_select/calendar.gif +0 -0
- data/public/images/cart-empty.png +0 -0
- data/public/images/cart-empty_x32.png +0 -0
- data/public/images/cart-full.png +0 -0
- data/public/images/cart-full_x32.png +0 -0
- data/public/images/checkout.png +0 -0
- data/public/images/creditcard.gif +0 -0
- data/public/images/datepicker/backstripes.gif +0 -0
- data/public/images/datepicker/bg_header.jpg +0 -0
- data/public/images/datepicker/bullet1.gif +0 -0
- data/public/images/datepicker/bullet2.gif +0 -0
- data/public/images/datepicker/cal.gif +0 -0
- data/public/images/datepicker/gradient-e5e5e5-ffffff.gif +0 -0
- data/public/images/discover_cid.gif +0 -0
- data/public/images/drag-handle-green.png +0 -0
- data/public/images/flags/ad.png +0 -0
- data/public/images/flags/ae.png +0 -0
- data/public/images/flags/af.png +0 -0
- data/public/images/flags/ag.png +0 -0
- data/public/images/flags/ai.png +0 -0
- data/public/images/flags/al.png +0 -0
- data/public/images/flags/am.png +0 -0
- data/public/images/flags/an.png +0 -0
- data/public/images/flags/ao.png +0 -0
- data/public/images/flags/ar.png +0 -0
- data/public/images/flags/as.png +0 -0
- data/public/images/flags/at.png +0 -0
- data/public/images/flags/au.png +0 -0
- data/public/images/flags/aw.png +0 -0
- data/public/images/flags/ax.png +0 -0
- data/public/images/flags/az.png +0 -0
- data/public/images/flags/ba.png +0 -0
- data/public/images/flags/bb.png +0 -0
- data/public/images/flags/bd.png +0 -0
- data/public/images/flags/be.png +0 -0
- data/public/images/flags/bf.png +0 -0
- data/public/images/flags/bg.png +0 -0
- data/public/images/flags/bh.png +0 -0
- data/public/images/flags/bi.png +0 -0
- data/public/images/flags/bj.png +0 -0
- data/public/images/flags/bm.png +0 -0
- data/public/images/flags/bn.png +0 -0
- data/public/images/flags/bo.png +0 -0
- data/public/images/flags/br.png +0 -0
- data/public/images/flags/bs.png +0 -0
- data/public/images/flags/bt.png +0 -0
- data/public/images/flags/bv.png +0 -0
- data/public/images/flags/bw.png +0 -0
- data/public/images/flags/by.png +0 -0
- data/public/images/flags/bz.png +0 -0
- data/public/images/flags/ca.png +0 -0
- data/public/images/flags/catalonia.png +0 -0
- data/public/images/flags/cc.png +0 -0
- data/public/images/flags/cd.png +0 -0
- data/public/images/flags/cf.png +0 -0
- data/public/images/flags/cg.png +0 -0
- data/public/images/flags/ch.png +0 -0
- data/public/images/flags/ci.png +0 -0
- data/public/images/flags/ck.png +0 -0
- data/public/images/flags/cl.png +0 -0
- data/public/images/flags/cm.png +0 -0
- data/public/images/flags/cn.png +0 -0
- data/public/images/flags/co.png +0 -0
- data/public/images/flags/cr.png +0 -0
- data/public/images/flags/cs.png +0 -0
- data/public/images/flags/cu.png +0 -0
- data/public/images/flags/cv.png +0 -0
- data/public/images/flags/cx.png +0 -0
- data/public/images/flags/cy.png +0 -0
- data/public/images/flags/cz.png +0 -0
- data/public/images/flags/da.png +0 -0
- data/public/images/flags/de.png +0 -0
- data/public/images/flags/de_CH.png +0 -0
- data/public/images/flags/dj.png +0 -0
- data/public/images/flags/dm.png +0 -0
- data/public/images/flags/do.png +0 -0
- data/public/images/flags/dz.png +0 -0
- data/public/images/flags/ec.png +0 -0
- data/public/images/flags/ee.png +0 -0
- data/public/images/flags/eg.png +0 -0
- data/public/images/flags/eh.png +0 -0
- data/public/images/flags/england.png +0 -0
- data/public/images/flags/er.png +0 -0
- data/public/images/flags/es.png +0 -0
- data/public/images/flags/et.png +0 -0
- data/public/images/flags/europeanunion.png +0 -0
- data/public/images/flags/fam.png +0 -0
- data/public/images/flags/fi.png +0 -0
- data/public/images/flags/fj.png +0 -0
- data/public/images/flags/fk.png +0 -0
- data/public/images/flags/fm.png +0 -0
- data/public/images/flags/fo.png +0 -0
- data/public/images/flags/fr.png +0 -0
- data/public/images/flags/ga.png +0 -0
- data/public/images/flags/gb.png +0 -0
- data/public/images/flags/gd.png +0 -0
- data/public/images/flags/ge.png +0 -0
- data/public/images/flags/gf.png +0 -0
- data/public/images/flags/gh.png +0 -0
- data/public/images/flags/gi.png +0 -0
- data/public/images/flags/gl.png +0 -0
- data/public/images/flags/gm.png +0 -0
- data/public/images/flags/gn.png +0 -0
- data/public/images/flags/gp.png +0 -0
- data/public/images/flags/gq.png +0 -0
- data/public/images/flags/gr.png +0 -0
- data/public/images/flags/gs.png +0 -0
- data/public/images/flags/gt.png +0 -0
- data/public/images/flags/gu.png +0 -0
- data/public/images/flags/gw.png +0 -0
- data/public/images/flags/gy.png +0 -0
- data/public/images/flags/hk.png +0 -0
- data/public/images/flags/hm.png +0 -0
- data/public/images/flags/hn.png +0 -0
- data/public/images/flags/hr.png +0 -0
- data/public/images/flags/ht.png +0 -0
- data/public/images/flags/hu.png +0 -0
- data/public/images/flags/id.png +0 -0
- data/public/images/flags/ie.png +0 -0
- data/public/images/flags/il.png +0 -0
- data/public/images/flags/in.png +0 -0
- data/public/images/flags/io.png +0 -0
- data/public/images/flags/iq.png +0 -0
- data/public/images/flags/ir.png +0 -0
- data/public/images/flags/is.png +0 -0
- data/public/images/flags/it.png +0 -0
- data/public/images/flags/jm.png +0 -0
- data/public/images/flags/jo.png +0 -0
- data/public/images/flags/jp.png +0 -0
- data/public/images/flags/ke.png +0 -0
- data/public/images/flags/kg.png +0 -0
- data/public/images/flags/kh.png +0 -0
- data/public/images/flags/ki.png +0 -0
- data/public/images/flags/km.png +0 -0
- data/public/images/flags/kn.png +0 -0
- data/public/images/flags/kp.png +0 -0
- data/public/images/flags/kr.png +0 -0
- data/public/images/flags/kw.png +0 -0
- data/public/images/flags/ky.png +0 -0
- data/public/images/flags/kz.png +0 -0
- data/public/images/flags/la.png +0 -0
- data/public/images/flags/lb.png +0 -0
- data/public/images/flags/lc.png +0 -0
- data/public/images/flags/li.png +0 -0
- data/public/images/flags/lk.png +0 -0
- data/public/images/flags/lr.png +0 -0
- data/public/images/flags/ls.png +0 -0
- data/public/images/flags/lt.png +0 -0
- data/public/images/flags/lu.png +0 -0
- data/public/images/flags/lv.png +0 -0
- data/public/images/flags/ly.png +0 -0
- data/public/images/flags/ma.png +0 -0
- data/public/images/flags/mc.png +0 -0
- data/public/images/flags/md.png +0 -0
- data/public/images/flags/me.png +0 -0
- data/public/images/flags/mg.png +0 -0
- data/public/images/flags/mh.png +0 -0
- data/public/images/flags/mk.png +0 -0
- data/public/images/flags/ml.png +0 -0
- data/public/images/flags/mm.png +0 -0
- data/public/images/flags/mn.png +0 -0
- data/public/images/flags/mo.png +0 -0
- data/public/images/flags/mp.png +0 -0
- data/public/images/flags/mq.png +0 -0
- data/public/images/flags/mr.png +0 -0
- data/public/images/flags/ms.png +0 -0
- data/public/images/flags/mt.png +0 -0
- data/public/images/flags/mu.png +0 -0
- data/public/images/flags/mv.png +0 -0
- data/public/images/flags/mw.png +0 -0
- data/public/images/flags/mx.png +0 -0
- data/public/images/flags/my.png +0 -0
- data/public/images/flags/mz.png +0 -0
- data/public/images/flags/na.png +0 -0
- data/public/images/flags/nc.png +0 -0
- data/public/images/flags/ne.png +0 -0
- data/public/images/flags/nf.png +0 -0
- data/public/images/flags/ng.png +0 -0
- data/public/images/flags/ni.png +0 -0
- data/public/images/flags/nl.png +0 -0
- data/public/images/flags/no.png +0 -0
- data/public/images/flags/np.png +0 -0
- data/public/images/flags/nr.png +0 -0
- data/public/images/flags/nu.png +0 -0
- data/public/images/flags/nz.png +0 -0
- data/public/images/flags/om.png +0 -0
- data/public/images/flags/pa.png +0 -0
- data/public/images/flags/pe.png +0 -0
- data/public/images/flags/pf.png +0 -0
- data/public/images/flags/pg.png +0 -0
- data/public/images/flags/ph.png +0 -0
- data/public/images/flags/pk.png +0 -0
- data/public/images/flags/pl.png +0 -0
- data/public/images/flags/pm.png +0 -0
- data/public/images/flags/pn.png +0 -0
- data/public/images/flags/pr.png +0 -0
- data/public/images/flags/ps.png +0 -0
- data/public/images/flags/pt.png +0 -0
- data/public/images/flags/pw.png +0 -0
- data/public/images/flags/py.png +0 -0
- data/public/images/flags/qa.png +0 -0
- data/public/images/flags/re.png +0 -0
- data/public/images/flags/ro.png +0 -0
- data/public/images/flags/rs.png +0 -0
- data/public/images/flags/ru.png +0 -0
- data/public/images/flags/rw.png +0 -0
- data/public/images/flags/sa.png +0 -0
- data/public/images/flags/sb.png +0 -0
- data/public/images/flags/sc.png +0 -0
- data/public/images/flags/scotland.png +0 -0
- data/public/images/flags/sd.png +0 -0
- data/public/images/flags/se.png +0 -0
- data/public/images/flags/sg.png +0 -0
- data/public/images/flags/sh.png +0 -0
- data/public/images/flags/si.png +0 -0
- data/public/images/flags/sj.png +0 -0
- data/public/images/flags/sk.png +0 -0
- data/public/images/flags/sl.png +0 -0
- data/public/images/flags/sm.png +0 -0
- data/public/images/flags/sn.png +0 -0
- data/public/images/flags/so.png +0 -0
- data/public/images/flags/sr.png +0 -0
- data/public/images/flags/st.png +0 -0
- data/public/images/flags/sv.png +0 -0
- data/public/images/flags/sy.png +0 -0
- data/public/images/flags/sz.png +0 -0
- data/public/images/flags/tc.png +0 -0
- data/public/images/flags/td.png +0 -0
- data/public/images/flags/tf.png +0 -0
- data/public/images/flags/tg.png +0 -0
- data/public/images/flags/th.png +0 -0
- data/public/images/flags/tj.png +0 -0
- data/public/images/flags/tk.png +0 -0
- data/public/images/flags/tl.png +0 -0
- data/public/images/flags/tm.png +0 -0
- data/public/images/flags/tn.png +0 -0
- data/public/images/flags/to.png +0 -0
- data/public/images/flags/tr.png +0 -0
- data/public/images/flags/tt.png +0 -0
- data/public/images/flags/tv.png +0 -0
- data/public/images/flags/tw.png +0 -0
- data/public/images/flags/tz.png +0 -0
- data/public/images/flags/ua.png +0 -0
- data/public/images/flags/ug.png +0 -0
- data/public/images/flags/um.png +0 -0
- data/public/images/flags/us.png +0 -0
- data/public/images/flags/uy.png +0 -0
- data/public/images/flags/uz.png +0 -0
- data/public/images/flags/va.png +0 -0
- data/public/images/flags/vc.png +0 -0
- data/public/images/flags/ve.png +0 -0
- data/public/images/flags/vg.png +0 -0
- data/public/images/flags/vi.png +0 -0
- data/public/images/flags/vn.png +0 -0
- data/public/images/flags/vu.png +0 -0
- data/public/images/flags/wales.png +0 -0
- data/public/images/flags/wf.png +0 -0
- data/public/images/flags/ws.png +0 -0
- data/public/images/flags/ye.png +0 -0
- data/public/images/flags/yt.png +0 -0
- data/public/images/flags/za.png +0 -0
- data/public/images/flags/zm.png +0 -0
- data/public/images/flags/zw.png +0 -0
- data/public/images/green/left_01.png +0 -0
- data/public/images/green/right_01.png +0 -0
- data/public/images/grid.png +0 -0
- data/public/images/left_01.png +0 -0
- data/public/images/left_01_small.png +0 -0
- data/public/images/master_cid.jpg +0 -0
- data/public/images/menu-current.png +0 -0
- data/public/images/menu-hover.png +0 -0
- data/public/images/noimage/mini.jpg +0 -0
- data/public/images/noimage/product.jpg +0 -0
- data/public/images/noimage/small.jpg +0 -0
- data/public/images/openid-inputicon.gif +0 -0
- data/public/images/orange/left_03.png +0 -0
- data/public/images/orange/right_03.png +0 -0
- data/public/images/progress.gif +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/right_01.png +0 -0
- data/public/images/right_01_small.png +0 -0
- data/public/images/separator.png +0 -0
- data/public/images/shadow-top.png +0 -0
- data/public/images/shadow_top.png +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/images/spree.jpg +0 -0
- data/public/images/spree/progress.gif +0 -0
- data/public/images/spree/spinner.gif +0 -0
- data/public/images/spree/spree.jpg +0 -0
- data/public/images/step-progress/completed-completed.gif +0 -0
- data/public/images/step-progress/completed-current.gif +0 -0
- data/public/images/step-progress/completed-first.gif +0 -0
- data/public/images/step-progress/current-first.gif +0 -0
- data/public/images/step-progress/current-incomplete.gif +0 -0
- data/public/images/step-progress/current-right.gif +0 -0
- data/public/images/step-progress/incomplete-incomplete.gif +0 -0
- data/public/images/step-progress/incomplete-right.gif +0 -0
- data/public/images/steps/1.png +0 -0
- data/public/images/steps/1_small.png +0 -0
- data/public/images/steps/2.png +0 -0
- data/public/images/steps/2_small.png +0 -0
- data/public/images/steps/3.png +0 -0
- data/public/images/steps/3_small.png +0 -0
- data/public/images/steps/4.png +0 -0
- data/public/images/steps/4_small.png +0 -0
- data/public/images/steps/5.png +0 -0
- data/public/images/steps/5_small.png +0 -0
- data/public/images/steps/6.png +0 -0
- data/public/images/steps/6_small.png +0 -0
- data/public/images/sxsw-ribbon-v1.png +0 -0
- data/public/images/tab_bottom.gif +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/images/top-shine.png +0 -0
- data/public/images/tree-nav-icons/bullet.gif +0 -0
- data/public/images/tree-nav-icons/minus.gif +0 -0
- data/public/images/tree-nav-icons/plus.gif +0 -0
- data/public/images/tree-nav-icons/treeview-loading.gif +0 -0
- data/public/images/tree-nav-icons/treeview-sprite.gif +0 -0
- data/public/images/update.png +0 -0
- data/public/images/visa_cid.gif +0 -0
- data/public/images/wrapper-back-2.png +0 -0
- data/public/images/wrapper-back.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-menuitem_checkbox.png +0 -0
- data/public/images/yui-menuitem_checkbox_disabled.png +0 -0
- data/public/images/yui-menuitem_submenuindicator.png +0 -0
- data/public/images/yui-menuitem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-sprite.png +0 -0
- data/public/javascripts/additional-methods.js +0 -236
- data/public/javascripts/admin/address_states.js +0 -25
- data/public/javascripts/admin/checkouts/edit.js +0 -129
- data/public/javascripts/admin/orders/edit.js +0 -96
- data/public/javascripts/admin/orders/edit_form.js +0 -17
- data/public/javascripts/admin/payments/new.js +0 -9
- data/public/javascripts/admin/unobtrusive_handlers.js +0 -15
- data/public/javascripts/calculator.js +0 -13
- data/public/javascripts/checkout.js +0 -65
- data/public/javascripts/dashboard.js +0 -143
- data/public/javascripts/datepicker.js +0 -1445
- data/public/javascripts/gateway.js +0 -13
- data/public/javascripts/jqPlot/excanvas.min.js +0 -1
- data/public/javascripts/jqPlot/jquery.jqplot.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js +0 -14
- data/public/javascripts/jquery-1.3.2.min.js +0 -19
- data/public/javascripts/jquery-and-plugins.js +0 -36
- data/public/javascripts/jquery-ui.js +0 -188
- data/public/javascripts/jquery.alerts/images/help.gif +0 -0
- data/public/javascripts/jquery.alerts/images/important.gif +0 -0
- data/public/javascripts/jquery.alerts/images/info.gif +0 -0
- data/public/javascripts/jquery.alerts/images/title.gif +0 -0
- data/public/javascripts/jquery.alerts/jquery.alerts.css +0 -57
- data/public/javascripts/jquery.alerts/jquery.alerts.js +0 -235
- data/public/javascripts/jquery.alerts/jquery.alerts.spree.css +0 -30
- data/public/javascripts/jquery.autocomplete.min.js +0 -13
- data/public/javascripts/jquery.js +0 -19
- data/public/javascripts/jquery.suggest.js +0 -276
- data/public/javascripts/jquery.template.js +0 -255
- data/public/javascripts/jquery.validate.min.js +0 -16
- data/public/javascripts/jrails.autocomplete.js +0 -274
- data/public/javascripts/jrails.js +0 -1
- data/public/javascripts/jsTree/jquery.tree.js +0 -2058
- data/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -129
- data/public/javascripts/jsTree/themes/apple/bg.jpg +0 -0
- data/public/javascripts/jsTree/themes/apple/dot_for_ie.gif +0 -0
- data/public/javascripts/jsTree/themes/apple/icons.png +0 -0
- data/public/javascripts/jsTree/themes/apple/style.css +0 -34
- data/public/javascripts/jsTree/themes/apple/throbber.gif +0 -0
- data/public/javascripts/lang/af.js +0 -40
- data/public/javascripts/lang/ar.js +0 -50
- data/public/javascripts/lang/de.js +0 -40
- data/public/javascripts/lang/du.js +0 -40
- data/public/javascripts/lang/en.js +0 -42
- data/public/javascripts/lang/es.js +0 -41
- data/public/javascripts/lang/fi.js +0 -40
- data/public/javascripts/lang/fr.js +0 -44
- data/public/javascripts/lang/gr.js +0 -40
- data/public/javascripts/lang/he.js +0 -49
- data/public/javascripts/lang/it.js +0 -13
- data/public/javascripts/lang/nl.js +0 -40
- data/public/javascripts/lang/no.js +0 -40
- data/public/javascripts/lang/pt.js +0 -50
- data/public/javascripts/lang/ro.js +0 -40
- data/public/javascripts/lang/ru.js +0 -40
- data/public/javascripts/lang/sp.js +0 -40
- data/public/javascripts/lang/sv.js +0 -41
- data/public/javascripts/lang/ua.js +0 -40
- data/public/javascripts/localization/messages_cn.js +0 -24
- data/public/javascripts/localization/messages_cs.js +0 -23
- data/public/javascripts/localization/messages_da.js +0 -21
- data/public/javascripts/localization/messages_de.js +0 -21
- data/public/javascripts/localization/messages_es.js +0 -24
- data/public/javascripts/localization/messages_fr.js +0 -23
- data/public/javascripts/localization/messages_hu.js +0 -21
- data/public/javascripts/localization/messages_it.js +0 -26
- data/public/javascripts/localization/messages_kk.js +0 -23
- data/public/javascripts/localization/messages_nl.js +0 -23
- data/public/javascripts/localization/messages_no.js +0 -23
- data/public/javascripts/localization/messages_pl.js +0 -23
- data/public/javascripts/localization/messages_ptbr.js +0 -30
- data/public/javascripts/localization/messages_ro.js +0 -24
- data/public/javascripts/localization/messages_ru.js +0 -23
- data/public/javascripts/localization/messages_se.js +0 -23
- data/public/javascripts/localization/messages_sk.js +0 -21
- data/public/javascripts/localization/messages_tr.js +0 -24
- data/public/javascripts/localization/messages_tw.js +0 -24
- data/public/javascripts/localization/messages_ua.js +0 -24
- data/public/javascripts/nested-attribute.js +0 -25
- data/public/javascripts/open_id.js +0 -15
- data/public/javascripts/product.js +0 -49
- data/public/javascripts/spree.js +0 -53
- data/public/javascripts/taxonomy.js +0 -196
- data/public/javascripts/zone.js +0 -40
- data/public/stylesheets/admin/admin-forms.css +0 -159
- data/public/stylesheets/admin/admin-reset.css +0 -67
- data/public/stylesheets/admin/admin-tables.css +0 -39
- data/public/stylesheets/admin/admin-typography.css +0 -117
- data/public/stylesheets/admin/admin.css +0 -571
- data/public/stylesheets/admin/dashboard.css +0 -143
- data/public/stylesheets/admin/edit_checkouts.css +0 -57
- data/public/stylesheets/admin/edit_orders.css +0 -65
- data/public/stylesheets/admin/grids.css +0 -314
- data/public/stylesheets/admin/reset-fonts-grids-2-6-0.css +0 -7
- data/public/stylesheets/admin/yui-includes.css +0 -14
- data/public/stylesheets/datepicker.css +0 -263
- data/public/stylesheets/jquery.autocomplete.css +0 -48
- data/public/stylesheets/scaffold.css +0 -54
- data/public/stylesheets/screen.css +0 -1194
- data/script/autospec +0 -5
- data/script/breakpointer +0 -3
- data/script/performance/request +0 -3
- data/script/spec +0 -5
- data/script/spec_server +0 -125
- data/spec/controllers/admin/configurations_controller_spec.rb +0 -9
- data/spec/controllers/admin/mail_settings_controller_spec.rb +0 -24
- data/spec/controllers/admin/shipping_categories_controller_spec.rb +0 -10
- data/spec/controllers/admin/shipping_methods_controller_spec.rb +0 -10
- data/spec/controllers/countries_controller_spec.rb +0 -24
- data/spec/controllers/orders_controller_spec.rb +0 -35
- data/spec/controllers/products_controller_spec.rb +0 -16
- data/spec/controllers/states_controller_spec.rb +0 -18
- data/spec/controllers/taxons_controller_spec.rb +0 -18
- data/spec/fixtures/app_configurations.yml +0 -7
- data/spec/fixtures/countries.yml +0 -3
- data/spec/fixtures/gateways.yml +0 -8
- data/spec/fixtures/preferences.yml +0 -15
- data/spec/fixtures/roles.yml +0 -2
- data/spec/fixtures/states.yml +0 -2
- data/spec/fixtures/tax_categories.yml +0 -4
- data/spec/fixtures/users.yml +0 -5
- data/spec/fixtures/zone_members.yml +0 -7
- data/spec/fixtures/zones.yml +0 -4
- data/spec/lib/easy_role_requirement_system_spec.rb +0 -140
- data/spec/models/address_spec.rb +0 -79
- data/spec/models/app_configuration_spec.rb +0 -13
- data/spec/models/creditcard_payment_spec.rb +0 -17
- data/spec/models/creditcard_spec.rb +0 -43
- data/spec/models/inventory_unit_spec.rb +0 -18
- data/spec/models/option_type_spec.rb +0 -36
- data/spec/models/option_value_spec.rb +0 -39
- data/spec/models/order_spec.rb +0 -207
- data/spec/models/payment_sepc.rb +0 -29
- data/spec/models/product_option_type_spec.rb +0 -38
- data/spec/models/product_property_spec.rb +0 -29
- data/spec/models/property_spec.rb +0 -37
- data/spec/models/prototype_spec.rb +0 -35
- data/spec/models/shipment_spec.rb +0 -8
- data/spec/models/shipping_category_spec.rb +0 -8
- data/spec/models/shipping_order_spec.rb +0 -113
- data/spec/models/tax_category_spec.rb +0 -11
- data/spec/models/taxon_spec.rb +0 -50
- data/spec/models/taxonomy_spec.rb +0 -37
- data/spec/models/zone_member_spec.rb +0 -5
- data/spec/models/zone_spec.rb +0 -137
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -79
- data/vendor/extensions/overview_dashboard/spec/spec.opts +0 -6
- data/vendor/extensions/overview_dashboard/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/spec/helpers/admin/gateways_helper_spec.rb +0 -6
- data/vendor/extensions/payment_gateway/spec/models/creditcard_spec.rb +0 -15
- data/vendor/extensions/payment_gateway/spec/models/gateway_spec.rb +0 -11
- data/vendor/extensions/payment_gateway/spec/models/order_spec.rb +0 -45
- data/vendor/extensions/payment_gateway/spec/spec.opts +0 -6
- data/vendor/extensions/payment_gateway/spec/spec_helper.rb +0 -37
- data/vendor/extensions/theme_default/spec/spec.opts +0 -6
- data/vendor/extensions/theme_default/spec/spec_helper.rb +0 -37
@@ -74,3 +74,7 @@ Running from edge sources (latest and greatest features)
|
|
74
74
|
script/server
|
75
75
|
|
76
76
|
|
77
|
+
Contributing
|
78
|
+
============
|
79
|
+
|
80
|
+
Spree is an open source project. We encourage contributions. Please see the [contributors guidelines](http://spreecommerce.com/documentation/contributing_to_spree.html) before contributing. **Do not send a Github pull request - it will be ignored.**
|
data/Rakefile
CHANGED
@@ -36,8 +36,8 @@ begin
|
|
36
36
|
s.add_dependency 'chronic', '0.2.3'
|
37
37
|
s.add_dependency 'whenever', "0.3.7"
|
38
38
|
s.add_dependency 'searchlogic', "2.3.5"
|
39
|
-
s.add_dependency 'will_paginate', "2.3.
|
40
|
-
s.add_dependency 'state_machine', "0.
|
39
|
+
s.add_dependency 'will_paginate', "2.3.14"
|
40
|
+
s.add_dependency 'state_machine', "0.9.2"
|
41
41
|
s.add_dependency 'faker', "0.3.1"
|
42
42
|
s.add_dependency 'paperclip', "= 2.3.1.1"
|
43
43
|
s.add_dependency 'ruby-openid', '>= 2.0.4'
|
@@ -10,9 +10,9 @@ class Admin::AdjustmentsController < Admin::BaseController
|
|
10
10
|
destroy.success.wants.js { render_js_for_destroy }
|
11
11
|
|
12
12
|
create.before :set_type
|
13
|
-
create.after :
|
14
|
-
update.after :
|
15
|
-
destroy.after :
|
13
|
+
create.after :set_order_state
|
14
|
+
update.after :set_order_state
|
15
|
+
destroy.after :set_order_state
|
16
16
|
|
17
17
|
private
|
18
18
|
def list_adjustment_types
|
@@ -28,18 +28,17 @@ class Admin::AdjustmentsController < Admin::BaseController
|
|
28
28
|
object.type = params[:adjustment][:type]
|
29
29
|
end
|
30
30
|
|
31
|
-
def update_totals
|
32
|
-
@order.update_totals!
|
33
|
-
end
|
34
|
-
|
35
31
|
# Automatically complete and order where no payment is necessary because adjustments cancel out the total
|
36
|
-
def
|
32
|
+
def set_order_state
|
37
33
|
@order.update_totals!
|
38
|
-
|
34
|
+
|
35
|
+
if @order.in_progress? and @order.item_total > 0 and @order.total == 0 and @order.payments.total == 0 #for new orders that are adjusted to zero
|
39
36
|
until @order.checkout.complete?
|
40
37
|
@order.checkout.next!
|
41
38
|
end
|
42
39
|
@order.reload.pay!
|
40
|
+
elsif @order.item_total > 0 && ((@order.balance_due? && @order.outstanding_balance == 0) || (@order.credit_owed? && @order.outstanding_credit == 0)) #set existing orders back to paid, if adjustment corrects balance
|
41
|
+
@order.reload.pay!
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
@@ -39,12 +39,20 @@ class Admin::CheckoutsController < Admin::BaseController
|
|
39
39
|
def edit_before
|
40
40
|
@checkout.build_bill_address(:country_id => Spree::Config[:default_country_id]) if @checkout.bill_address.nil?
|
41
41
|
@checkout.build_ship_address(:country_id => Spree::Config[:default_country_id]) if @checkout.ship_address.nil?
|
42
|
+
set_validations
|
42
43
|
end
|
43
44
|
|
44
45
|
def update_before
|
45
|
-
@checkout.enable_validation_group(:address)
|
46
|
-
|
47
46
|
#assign order to existing user
|
48
47
|
@checkout.order.update_attribute(:user_id, params[:user_id]) unless params[:user_id].blank?
|
48
|
+
set_validations
|
49
|
+
end
|
50
|
+
|
51
|
+
def set_validations
|
52
|
+
@checkout.enable_validation_group(:address) #force validation group here as checkout state could be different
|
53
|
+
|
54
|
+
#need to add email to current validation fields as admin checkout
|
55
|
+
#is handling to validation groups at once register/address
|
56
|
+
@checkout.current_validation_fields << "email"
|
49
57
|
end
|
50
58
|
end
|
@@ -59,7 +59,6 @@ class Admin::LineItemsController < Admin::BaseController
|
|
59
59
|
tax_charge.update_attributes(:amount => tax_charge.calculate_tax_charge)
|
60
60
|
end
|
61
61
|
|
62
|
-
@order.checkout.enable_validation_group(@order.checkout.state.to_sym)
|
63
62
|
@order.update_totals!
|
64
63
|
|
65
64
|
unless @order.in_progress?
|
@@ -9,13 +9,13 @@ class Admin::PaymentsController < Admin::BaseController
|
|
9
9
|
build_object
|
10
10
|
load_object
|
11
11
|
|
12
|
-
unless object.save
|
13
|
-
response_for :create_fails
|
14
|
-
return
|
15
|
-
end
|
16
|
-
|
17
12
|
begin
|
18
13
|
|
14
|
+
unless object.save
|
15
|
+
response_for :create_fails
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
19
19
|
if @order.checkout.state == "complete"
|
20
20
|
object.process!
|
21
21
|
set_flash :create
|
@@ -30,8 +30,9 @@ class Admin::PaymentsController < Admin::BaseController
|
|
30
30
|
end
|
31
31
|
|
32
32
|
rescue Spree::GatewayError => e
|
33
|
-
flash
|
34
|
-
|
33
|
+
flash[:error] = "#{e.message}"
|
34
|
+
@payment.destroy
|
35
|
+
redirect_to new_object_path
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
@@ -48,7 +48,7 @@ class Admin::ShipmentsController < Admin::BaseController
|
|
48
48
|
@selected_country_id = params[:shipment_presenter][:address_country_id].to_i if params.has_key?('shipment_presenter')
|
49
49
|
@selected_country_id ||= @order.bill_address.country_id unless @order.nil? || @order.bill_address.nil?
|
50
50
|
@selected_country_id ||= Spree::Config[:default_country_id]
|
51
|
-
@shipping_methods = ShippingMethod.
|
51
|
+
@shipping_methods = ShippingMethod.all_available(@order, :back_end)
|
52
52
|
|
53
53
|
@states = State.find_all_by_country_id(@selected_country_id, :order => 'name')
|
54
54
|
@countries = Checkout.countries.sort
|
@@ -23,6 +23,7 @@ class CheckoutsController < Spree::BaseController
|
|
23
23
|
address.edit_hook :set_ip_address
|
24
24
|
payment.edit_hook :load_available_payment_methods
|
25
25
|
update.before :clear_payments_if_in_payment_state
|
26
|
+
update.after :update_payment_if_order_total_has_changed
|
26
27
|
|
27
28
|
# customized verison of the standard r_c update method (since we need to handle gateway errors, etc)
|
28
29
|
def update
|
@@ -30,7 +31,6 @@ class CheckoutsController < Spree::BaseController
|
|
30
31
|
|
31
32
|
# call the edit hooks for the current step in case we experience validation failure and need to edit again
|
32
33
|
edit_hooks
|
33
|
-
@checkout.enable_validation_group(@checkout.state.to_sym)
|
34
34
|
@prev_state = @checkout.state
|
35
35
|
|
36
36
|
before :update
|
@@ -144,7 +144,7 @@ class CheckoutsController < Spree::BaseController
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def next_step
|
147
|
-
@checkout.next!
|
147
|
+
@checkout.next!
|
148
148
|
flash[:analytics] = "/checkout/#{object.state}"
|
149
149
|
# call edit hooks for this next step since we're going to just render it (instead of issuing a redirect)
|
150
150
|
edit_hooks
|
@@ -156,10 +156,20 @@ class CheckoutsController < Spree::BaseController
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def clear_payments_if_in_payment_state
|
159
|
-
if
|
160
|
-
|
159
|
+
# lets clear payments only if we actually are receiving a payment. Otherwise the payment can get cleared
|
160
|
+
# if we are submitting a blank coupon anytime after the payment has been received.
|
161
|
+
if @checkout.payment? && params[:checkout] && params[:checkout][:payments_attributes]
|
162
|
+
@checkout.payments.destroy_all
|
161
163
|
end
|
162
164
|
end
|
165
|
+
|
166
|
+
def update_payment_if_order_total_has_changed
|
167
|
+
if @checkout.payment
|
168
|
+
@order.reload
|
169
|
+
logger.debug "CHECKOUT PAYMENT #{@checkout.payment.amount.to_s}, ORDER TOTAL: #{@order.total.to_s}"
|
170
|
+
@checkout.payment.update_attribute(:amount, @order.total) if @checkout.payment.amount != @order.total
|
171
|
+
end
|
172
|
+
end
|
163
173
|
|
164
174
|
def load_available_payment_methods
|
165
175
|
@payment_methods = PaymentMethod.available(:front_end)
|
@@ -192,7 +202,8 @@ class CheckoutsController < Spree::BaseController
|
|
192
202
|
|
193
203
|
def rate_hash
|
194
204
|
begin
|
195
|
-
|
205
|
+
|
206
|
+
@checkout.shipping_methods(:front_end).collect do |ship_method|
|
196
207
|
@checkout.shipment.shipping_method = ship_method
|
197
208
|
{ :id => ship_method.id,
|
198
209
|
:name => ship_method.name,
|
@@ -88,7 +88,7 @@ class Spree::BaseController < ActionController::Base
|
|
88
88
|
|
89
89
|
def render_404(exception)
|
90
90
|
respond_to do |type|
|
91
|
-
type.html { render :file => "#{
|
91
|
+
type.html { render :file => "#{Rails.root}/public/404.html", :status => "404 Not Found" }
|
92
92
|
type.all { render :nothing => true, :status => "404 Not Found" }
|
93
93
|
end
|
94
94
|
end
|
@@ -170,7 +170,7 @@ class Spree::BaseController < ActionController::Base
|
|
170
170
|
|
171
171
|
def get_taxonomies
|
172
172
|
@taxonomies ||= Taxonomy.find(:all, :include => {:root => :children})
|
173
|
-
@taxonomies
|
173
|
+
@taxonomies.reject { |t| t.root.nil? }
|
174
174
|
end
|
175
175
|
|
176
176
|
def current_gateway
|
@@ -22,7 +22,7 @@ module CheckoutsHelper
|
|
22
22
|
# It'd be nice to have separate classes but combining them with a dash helps out for IE6 which only sees the last class
|
23
23
|
content_tag('li', content_tag('span', text), :class => css_classes.join('-'))
|
24
24
|
end
|
25
|
-
content_tag('ol', items.join("\n"), :class => 'progress-steps', :id => "checkout-step-#{@checkout.state}")
|
25
|
+
content_tag('ol', raw(items.join("\n")), :class => 'progress-steps', :id => "checkout-step-#{@checkout.state}")
|
26
26
|
end
|
27
27
|
|
28
28
|
def billing_firstname
|
@@ -35,7 +35,7 @@ module ProductsHelper
|
|
35
35
|
|
36
36
|
# converts line breaks in product description into <p> tags (for html display purposes)
|
37
37
|
def product_description(product)
|
38
|
-
product.description.gsub(/^(.*)$/, '<p>\1</p>')
|
38
|
+
raw(product.description.gsub(/^(.*)$/, '<p>\1</p>'))
|
39
39
|
end
|
40
40
|
|
41
41
|
# generates nested url to product based on supplied taxon
|
@@ -10,7 +10,7 @@ module TaxonsHelper
|
|
10
10
|
else
|
11
11
|
crumbs << content_tag(:li, content_tag(:span, t('products')))
|
12
12
|
end
|
13
|
-
crumb_list = content_tag(:ul, crumbs.flatten.map{|li| li.mb_chars}.join)
|
13
|
+
crumb_list = content_tag(:ul, raw(crumbs.flatten.map{|li| li.mb_chars}.join))
|
14
14
|
content_tag(:div, crumb_list + tag(:br, {:class => 'clear'}, false, true), :class => 'breadcrumbs')
|
15
15
|
end
|
16
16
|
|
data/app/models/address.rb
CHANGED
@@ -17,6 +17,8 @@ class Address < ActiveRecord::Base
|
|
17
17
|
validates_presence_of :phone
|
18
18
|
validate :state_name_validate, :if => Proc.new { |address| address.state.blank? && Spree::Config[:address_requires_state] }
|
19
19
|
|
20
|
+
before_save :clear_invalid_state
|
21
|
+
|
20
22
|
def checkouts
|
21
23
|
(billing_checkouts + shipping_checkouts).uniq
|
22
24
|
end
|
@@ -91,4 +93,11 @@ class Address < ActiveRecord::Base
|
|
91
93
|
def empty?
|
92
94
|
attributes.except("id", "created_at", "updated_at", "order_id", "country_id").all? {|k,v| v.nil?}
|
93
95
|
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def clear_invalid_state #reset state to nil if it's not from selected country
|
100
|
+
return unless self.state
|
101
|
+
self.state = nil unless self.state.country_id == self.country_id
|
102
|
+
end
|
94
103
|
end
|
data/app/models/checkout.rb
CHANGED
@@ -9,7 +9,7 @@ class Checkout < ActiveRecord::Base
|
|
9
9
|
belongs_to :order
|
10
10
|
belongs_to :bill_address, :foreign_key => "bill_address_id", :class_name => "Address"
|
11
11
|
belongs_to :ship_address, :foreign_key => "ship_address_id", :class_name => "Address"
|
12
|
-
belongs_to :shipping_method
|
12
|
+
belongs_to :shipping_method
|
13
13
|
has_many :payments, :as => :payable
|
14
14
|
|
15
15
|
accepts_nested_attributes_for :bill_address
|
@@ -18,9 +18,10 @@ class Checkout < ActiveRecord::Base
|
|
18
18
|
|
19
19
|
attr_accessor :coupon_code
|
20
20
|
attr_accessor :use_billing
|
21
|
+
attr_accessor :current_validation_fields
|
21
22
|
|
22
23
|
validates_presence_of :order_id, :shipping_method_id
|
23
|
-
validates_format_of :email, :with => /^\S+@\S+\.\S
|
24
|
+
validates_format_of :email, :with => /^\S+@\S+\.\S+$/
|
24
25
|
|
25
26
|
validation_group :register, :fields => ["email"]
|
26
27
|
|
@@ -33,6 +34,11 @@ class Checkout < ActiveRecord::Base
|
|
33
34
|
"ship_address.zipcode"]
|
34
35
|
validation_group :delivery, :fields => ["shipping_method_id"]
|
35
36
|
|
37
|
+
|
38
|
+
def after_initialize
|
39
|
+
enable_validation_group(state.to_sym)
|
40
|
+
end
|
41
|
+
|
36
42
|
def completed_at
|
37
43
|
order.completed_at
|
38
44
|
end
|
@@ -47,7 +53,7 @@ class Checkout < ActiveRecord::Base
|
|
47
53
|
def valid?
|
48
54
|
# will perform partial validation when @checkout.enabled_validation_group :step is called
|
49
55
|
result = ar_valid?
|
50
|
-
return result
|
56
|
+
return result if @current_validation_fields.nil?
|
51
57
|
|
52
58
|
relevant_errors = errors.select { |attr, msg| @current_validation_fields.include?(attr) }
|
53
59
|
errors.clear
|
@@ -71,15 +77,15 @@ class Checkout < ActiveRecord::Base
|
|
71
77
|
state_machine.states.by_priority.map(&:name)
|
72
78
|
end
|
73
79
|
|
74
|
-
def shipping_methods
|
80
|
+
def shipping_methods(display_on=nil)
|
75
81
|
return [] unless ship_address
|
76
|
-
ShippingMethod.all_available(order)
|
82
|
+
ShippingMethod.all_available(order,display_on)
|
77
83
|
end
|
78
|
-
|
84
|
+
|
79
85
|
def payment
|
80
86
|
payments.first
|
81
87
|
end
|
82
|
-
|
88
|
+
|
83
89
|
private
|
84
90
|
|
85
91
|
def check_addresses_on_duplication
|
data/app/models/creditcard.rb
CHANGED
@@ -3,8 +3,8 @@ class Creditcard < ActiveRecord::Base
|
|
3
3
|
|
4
4
|
before_save :set_last_digits
|
5
5
|
|
6
|
-
validates_numericality_of :month, :
|
7
|
-
validates_numericality_of :year, :
|
6
|
+
validates_numericality_of :month, :only_integer => true
|
7
|
+
validates_numericality_of :year, :only_integer => true
|
8
8
|
validates_presence_of :number, :unless => :has_payment_profile?, :on => :create
|
9
9
|
validates_presence_of :verification_value, :unless => :has_payment_profile?, :on => :create
|
10
10
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class ModelCacheCleaner < ActiveRecord::Observer
|
2
|
+
observe :shipping_method, :zone
|
3
|
+
|
4
|
+
def after_save(object)
|
5
|
+
return unless Rails.configuration.cache_classes
|
6
|
+
#clear cache collection
|
7
|
+
Rails.cache.delete("#{object.class}.all")
|
8
|
+
|
9
|
+
#pre-warn cache with new data
|
10
|
+
object.class.cached
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
data/app/models/order.rb
CHANGED
@@ -10,20 +10,20 @@ class Order < ActiveRecord::Base
|
|
10
10
|
after_create :create_checkout, :create_shipment, :create_tax_charge
|
11
11
|
|
12
12
|
belongs_to :user
|
13
|
-
has_many :state_events, :as => :stateful
|
13
|
+
has_many :state_events, :as => :stateful, :dependent => :destroy
|
14
14
|
|
15
15
|
has_many :line_items, :extend => Totaling, :dependent => :destroy
|
16
16
|
has_many :inventory_units
|
17
17
|
|
18
18
|
has_many :payments, :as => :payable, :extend => Totaling
|
19
19
|
|
20
|
-
has_one :checkout
|
20
|
+
has_one :checkout, :dependent => :destroy
|
21
21
|
has_one :bill_address, :through => :checkout
|
22
22
|
has_one :ship_address, :through => :checkout
|
23
23
|
has_many :shipments, :dependent => :destroy
|
24
24
|
has_many :return_authorizations, :dependent => :destroy
|
25
25
|
|
26
|
-
has_many :adjustments, :extend => Totaling, :order => :position
|
26
|
+
has_many :adjustments, :extend => Totaling, :order => :position, :dependent => :destroy
|
27
27
|
has_many :charges, :extend => Totaling, :order => :position
|
28
28
|
has_many :credits, :extend => Totaling, :order => :position
|
29
29
|
has_many :shipping_charges, :extend => Totaling, :order => :position
|
@@ -89,10 +89,10 @@ class Order < ActiveRecord::Base
|
|
89
89
|
transition :to => 'paid', :if => :allow_pay?
|
90
90
|
end
|
91
91
|
event :under_paid do
|
92
|
-
transition :to => 'balance_due', :from => ['paid', 'new', 'credit_owed', 'shipped', 'awaiting_return']
|
92
|
+
transition :to => 'balance_due', :from => ['paid', 'new', 'credit_owed', 'shipped', 'awaiting_return', 'canceled']
|
93
93
|
end
|
94
94
|
event :over_paid do
|
95
|
-
|
95
|
+
transition :to => 'credit_owed', :from => ['paid', 'new', 'balance_due', 'shipped', 'awaiting_return', 'canceled']
|
96
96
|
end
|
97
97
|
event :ship do
|
98
98
|
transition :to => 'shipped', :from => 'paid'
|
@@ -289,14 +289,12 @@ class Order < ActiveRecord::Base
|
|
289
289
|
|
290
290
|
self.adjustment_total = self.charge_total - self.credit_total
|
291
291
|
self.total = self.item_total + self.adjustment_total
|
292
|
-
|
293
|
-
self.checkout.enable_validation_group(:register) unless self.checkout.nil?
|
294
292
|
end
|
295
293
|
|
296
294
|
def update_totals!
|
297
295
|
update_totals
|
298
296
|
|
299
|
-
payments_total = self.payments.total
|
297
|
+
payments_total = self.payments.reload.total
|
300
298
|
if payments_total < self.total
|
301
299
|
#Total is higher so balance_due
|
302
300
|
self.under_paid
|
data/app/models/payment.rb
CHANGED
@@ -5,14 +5,14 @@ class Payment < ActiveRecord::Base
|
|
5
5
|
|
6
6
|
has_many :transactions
|
7
7
|
alias :txns :transactions
|
8
|
-
|
8
|
+
|
9
9
|
after_save :create_payment_profile, :if => :payment_profiles_supported?
|
10
10
|
after_save :check_payments, :if => :order_payment?
|
11
11
|
after_destroy :check_payments, :if => :order_payment?
|
12
12
|
|
13
13
|
accepts_nested_attributes_for :source
|
14
|
-
|
15
|
-
validate :amount_is_valid_for_outstanding_balance_or_credit, :if => :order_payment?
|
14
|
+
|
15
|
+
validate :amount_is_valid_for_outstanding_balance_or_credit, :if => :order_payment?
|
16
16
|
validates_presence_of :payment_method, :if => Proc.new { |payable| payable.is_a? Checkout }
|
17
17
|
|
18
18
|
named_scope :from_creditcard, :conditions => {:source_type => 'Creditcard'}
|
@@ -27,15 +27,15 @@ class Payment < ActiveRecord::Base
|
|
27
27
|
self.source = payment_method.payment_source_class.new(params)
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def process!
|
32
32
|
source.process!(self) if source and source.respond_to?(:process!)
|
33
|
-
end
|
34
|
-
|
33
|
+
end
|
34
|
+
|
35
35
|
def can_finalize?
|
36
36
|
!finalized?
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def finalize!
|
40
40
|
return unless can_finalize?
|
41
41
|
source.finalize!(self) if source and source.respond_to?(:finalize!)
|
@@ -43,7 +43,7 @@ class Payment < ActiveRecord::Base
|
|
43
43
|
save!
|
44
44
|
payable.save!
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def finalized?
|
48
48
|
payable.is_a?(Order)
|
49
49
|
end
|
@@ -54,19 +54,20 @@ class Payment < ActiveRecord::Base
|
|
54
54
|
end
|
55
55
|
|
56
56
|
private
|
57
|
-
|
57
|
+
|
58
58
|
def check_payments
|
59
59
|
return unless order.checkout_complete
|
60
60
|
#sorting by created_at.to_f to ensure millisecond percsision, plus ID - just in case
|
61
61
|
events = order.state_events.sort_by { |e| [e.created_at.to_f, e.id] }.reverse
|
62
62
|
|
63
|
-
|
63
|
+
|
64
64
|
if order.returnable_units.nil? && order.return_authorizations.size >0
|
65
65
|
order.return!
|
66
66
|
elsif events.present? and %w(over_paid under_paid).include?(events.first.name)
|
67
67
|
events.each do |event|
|
68
|
-
if %w(shipped paid new).include?(event.previous_state)
|
69
|
-
order.
|
68
|
+
if %w(shipped canceled paid new).include?(event.previous_state)
|
69
|
+
order.pay!
|
70
|
+
order.update_attribute("state", event.previous_state) if %w(shipped canceled returned).include?(event.previous_state)
|
70
71
|
return
|
71
72
|
end
|
72
73
|
end
|
@@ -74,7 +75,7 @@ class Payment < ActiveRecord::Base
|
|
74
75
|
order.pay!
|
75
76
|
end
|
76
77
|
end
|
77
|
-
|
78
|
+
|
78
79
|
def amount_is_valid_for_outstanding_balance_or_credit
|
79
80
|
if amount < 0
|
80
81
|
if amount.abs > order.outstanding_credit
|
@@ -84,12 +85,12 @@ class Payment < ActiveRecord::Base
|
|
84
85
|
if amount > order.outstanding_balance
|
85
86
|
errors.add(:amount, "Is greater than the outstanding balance (#{order.outstanding_balance})")
|
86
87
|
end
|
87
|
-
end
|
88
|
+
end
|
88
89
|
end
|
89
|
-
|
90
|
+
|
90
91
|
def order_payment?
|
91
92
|
payable_type == "Order"
|
92
|
-
end
|
93
|
+
end
|
93
94
|
|
94
95
|
def payment_profiles_supported?
|
95
96
|
source && source.payment_gateway && source.payment_gateway.payment_profiles_supported?
|
@@ -101,5 +102,5 @@ class Payment < ActiveRecord::Base
|
|
101
102
|
rescue ActiveMerchant::ConnectionError => e
|
102
103
|
gateway_error I18n.t(:unable_to_connect_to_gateway)
|
103
104
|
end
|
104
|
-
|
105
|
+
|
105
106
|
end
|