Search code examples
djangodjango-templatesgoogle-checkout

Google Checkout and Django integration question


I haven't used Google Checkout before, but their integration seems pretty simple. I do have a question, though. I plan to integrate Google Checkout with Django, but how would I be able to specify the amount of a product available in the Django CMS and have it sync for when someone buys a product. Example: 1 product of a t-shirt. Person buys the 1 t-shirt through Google Checkout -- I would want the CMS to set that quantity to 0 until a user puts the quantity back to more than 0. Also, there will be t-shirt sizes from XS to XL, so would it make the process more complicated?

Am I correct that I can do something like this when integrating Google Checkout to the Django template?

<div class="product">
  <img class="product-image" src="{{ product.image }}"/><br/>
  <span class="product-title">{{ product.title }}</span><br/>
  <span class="product-price">{{ product.price }}</span><br/>
  <div  role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"></div>
</div>

Then upon clicking checkout, it will automatically go to the Google Checkout process.


Solution

  • For inventory management systems you should consider using the Google Checkout Notifications API and Order Processing API. You will receive callbacks that will inform you on the state of the order, which will allow you to update the inventory accordingly. Without notifications you have no guarantee that the user has completed the purchase order after leaving your website.

    http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_API.html

    http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Processing.html#order_processing_api