When we built the Order
model in Chapter 3, Handling Customers and Their Orders, we included a field and related model to manage the status of particular orders. This status was designed to be simple and lightweight, but capable of describing a variety of circumstances. Some simple example status messages could be:
Awaiting Payment
Payment Received
Shipped
Closed
When we initially constructed the simple checkout view in Chapter 3, we did not integrate our Order
model. This was added in the last chapter as part of our more general purpose checkout and payment processors. We wrote the following method into our payment processor base class:
def save_order(self): cart = self.get_shopping_cart() self.order = make_order_from_cart(order, customer=self.request.user)
Here we convert the customer's shopping cart into an Order
object. This happens prior to completing the checkout process with the payments provider (Google Checkout or Amazon). As a result...