Atom-based Shopping Cart

Last modified 07:10, 24 Apr 2017

Workflow

  1. cart is submitted to checkout
  2. checkout responds with pricing & availability
  3. client accepts pricing & availability or (branch) to negotiate
  4. if acceptance, server challenges for payment details (payment may require payment-type-specific workflow)
  5. If payment succeeds, client recieves confirmation
  6. ... time passes ...
  7. optional activity might include order cancellation during this time or delivery changes
  8. Order is delivered
  9. Any post-sales workflow

I think that covers the outline workflow of pretty much all checkout in the real world

Shopping Cart Media-Type

Below is a complete shopping cart Atom feed.  In the next sections, we're looking at its building blocks.

<feed xmlns='http://www.w3.org/2005/Atom' xmlns:cart='http://schemas.acme.corp/cart/2008'>
  <id>http://www.acme.corp/carts/bob%40gmail.com/full</id>
  <updated>2008-07-11T22:10:30.252Z</updated>
  <title type="text">Bob's Shopping Cart</title>
  <link rel="self" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/full"/>
  <author>
    <name>Bob</name>
    <email>bob@gmail.com</email>
  </author>
  <generator version="1.0" uri="http://www.acme.corp/cart">ACME Shopping Cart</generator>
  <entry>
    <id>http://www.acme.corp/carts/bob%40gmail.com/item1</id>
    <published>2008-07-11T22:10:30.257Z</published>
    <updated>2008-07-11T21:46:35.000Z</updated>
    <title type="text">Rasperry Jello</title>
    <link rel="alternate" type="text/html" href="http://www.acme.corp/products/jello"/>
    <link rel="self" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item1"/>
    <link rel="edit" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item1"/>
    <cart:quantity value="2"/>
    <cart:unit-price value="$0.99"/>
  </entry>
  <entry>
    <id>http://www.acme.corp/carts/bob%40gmail.com/item2</id>
    <published>2008-07-11T22:10:30.258Z</published>
    <updated>2008-07-11T21:50:15.000Z</updated>
    <title type="text">Trident Bubblegum Megapack</title>
    <link rel="alternate" type="text/html" href="http://www.acme.corp/products/trident"/>
    <link rel="self" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item2"/>
    <link rel="edit" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item2"/>
    <cart:quantity value="1"/>
    <cart:unit-price value="$1.99"/>
  </entry>
</feed>

Items in the shopping cart are captured by Atom entries.

<entry xmlns='http://www.w3.org/2005/Atom' xmlns:cart='http://schemas.acme.corp/cart/2008'>
  <id>http://www.acme.corp/carts/bob%40gmail.com/item1</id>
  <published>2008-07-11T22:10:30.257Z</published>
  <updated>2008-07-11T21:46:35.000Z</updated>
  <title type="text">Rasperry Jello</title>
  <link rel="alternate" type="text/html" href="http://www.acme.corp/products/jello"/>
  <link rel="self" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item1"/>
  <link rel="edit" type="application/atom+xml" href="http://www.acme.corp/carts/bob%40gmail.com/item1"/>
  <cart:quantity value="2"/>
  <cart:unit-price value="$0.99"/>
</entry

The <title> element contains the name of the itme.  The <link rel="alternative"> link points to the item's description page.  And the <link rel="edit"> link indicates where a client can submit PUT requests to modify the contents of the item or submit DELETE to remove the item from the shopping cart.

To do

Describe how to add new items to cart.

Describe workflow transitions.

Page statistics
3897 view(s) and 8 edit(s)
Social share
Share this page?

Tags

This page has no custom tags.
This page has no classifications.

Comments

You must to post a comment.

Attachments