2

I'm having trouble wrapping my head around this and Google's sprawling documentation isn't helping (I can't even find a list of response types and their properties).

I have my storefront built in PHP and my shopping cart is stored in the session. When I hit the Google Checkout button, it posts to a different window (using the HTML API) and I get the Google sign-in where everything looks more or less right.

However, I don't know how I'm supposed to clear my shopping cart once somebody finishes an order. I haven't actually been through a test order because I can't get the sandbox directions to work (it keeps "forgetting" any settings). Does my callback page recieve any sort of message I should be handling? I'd like to do custom order processing someday but resetting the shopping cart is absolutely critical!

John Conde
  • 217,595
  • 99
  • 455
  • 496

2 Answers2

1

You can use the Notification API to get updates on various stages of order processing:

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

Additionally use the merchant-private-data field to pass any custom data about your order.

When you get back the notification, read the custom info from the merchant-private-data field and based on that reset the session.

See this answer for a solution to a similar issue.

Community
  • 1
  • 1
Mihai Ionescu
  • 2,108
  • 1
  • 12
  • 15
0

I think just clearing your cart session would clear shopping cart. Just unset your cart session.

Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
  • That much is obvious. The question is when. Does Google ping back at some point where the landing page would unset the session? Am I supposed to do it before I post the cart to Google and risk a customer hitting the back button to find an empty cart? It really doesn't seem like there's much integration going on if I can't get some sort of "order submitted" response to balance out my books. – Ryan Killian Dec 12 '11 at 23:47