The upcoming version of Spree contains some major changes to the workflow that developers should be aware of. Newly placed orders are now placed in the
new state once the checkout process is completed. Prior to this, orders were generally considered to be
charged. This provides a common starting point for all orders that have yet to be paid.
New orders are not considered to be
paid yet because the credit card has only been authorized and not yet captured during the checkout process. Yes, we’re aware that many sites like to capture the credit card payment at the time of sale. We have a plan to deal with this but we probably won’t have the solution in time for the upcoming release. Spree supports customization of the state machine so its easy enough to place your orders in the
paid state when the checkout is complete if that is a requirement for you. Again, this is a temporary situation and soon after the release we’ll be providing the ability to configure Spree so that new credit card charges can be either authorized or captured.
New orders will now have a credit card payment associated with them which is visible in a new tab. The payment will list the authorization transaction along with the amount, response code and date/time stamp. In the case of authorization, the amount of the authorization transaction will be for the order total but the amount of the payment is actually zero. This is important because we are moving towards a more sensible accounting system. The payment hasn’t been captured yet so the order is not paid.
You will notice that if you “Edit” the payment you will see a “Capture” link at the bottom of the page. This will capture the payment through your gateway using the amount and response code information from the authorization transaction. If the capture is successful, the payment amount will change to the amount captured (usually the order total) and the order will automatically move to the paid state.
We will soon support other types of payments (check, coupon, merchant credit, etc.) and this type of accounting will be extremely useful. Store owners will want to ensure that the payment is 100% accounted for before shipping the order. In fact, the default behavior in Spree is to not allow the order to be shipped until the order reaches the paid state. This should work nicely with Paypal Websites Standard and other offsite payment services where the payment may not be in the form of a credit card authorization performed through the site.
There is also a slight change to shipments. Orders can no longer be marked “shipped” from the listing of all orders. Instead you must click on the “Shipments” tab for the individual order. You can edit the individual shipment for an order and enter a tracking number as well as record the actual cost of the shipment (as opposed to what the customer was charged.) You can also mark the shipment as “shipped” and this will then move the order to the
shipped state, assuming all shipments are now shipped.
Currently Spree only supports a single shipment. We’re preparing for eventual support of multiple shipments and the database is already modeling orders as having multiple shipments even if the user interface doesn’t yet support it. Its complicated and we’re trying to get it right so we’re taking our time.
So these are some major changes to the post checkout part of the workflow but we hope you’ll agree that they represent signficant improvements. We’re already looking beyond the 0.6.0 release to some of the exciting new features and improvements in the pipeline. If you want to checkout these new features feel free to visit the online demo which has been updated to the latest code. We’re still working out a tiny glitch related to the currency formatting but you’ll get the idea.