2
votes

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!

2

2 Answers

1
votes

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.

0
votes

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