Search code examples
phpgoogle-checkout

How do I identify orders with the Google Checkout Notification API (using PHP)?


I am using the Google Checkout API to code a simple store. I have gotten as far as letting the user select items, edit the cart, and checkout/pay with Google Checkout. The notification API (with XML) is being used to read notifications sent by Google after receiving orders. How can I connect the order notifications with the orders information in my SQL database? Can I send an "order ID" or something like that to Google with the initial order? I have coded that portion (ordering) with the HTML API.

Thanks in advance!


Solution

  • 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.

    See this answer for a solution to a similar issue.