Question

In PHP, when handling the postback from Google Wallet confirming a purchase, it's possible that the server will not reply within the ten second time limit--this is sometimes completely undetectable serverside.

What should I do to prevent this? Is there a way to confirm the purchase was successful?

Was it helpful?

Solution

Google Wallet for Digital Goods will fail for both you (merchant) and the user/buyer if you don't respond to the postback as required.

Important: If you specify a postback URL, your server must respond promptly and correctly to the HTTP POST messages that Google sends for each transaction. Otherwise, the transaction will be canceled.

REF: https://developers.google.com/commerce/wallet/digital/docs/postback

If you're saying your system may think the trnx is "good" and it just took time to respond (at which point Google already canceled) - there is a "verification step" that occurs on successful transactions - success handler. You can use that to "confirm" the order on your end. So if Google canceled the transaction, your system will not get this final (re)confirmation (because your success handler will not be called).

I guess you could also use the failure handler for this, though it won't have an "orderId"

Hth...


As a side note on the comments, Google Checkout was also renamed Wallet at some point. If memory serves, it was really more for buyers than for merchants...so yes, do check on what API you are referring to.

This answer is specific to Wallet For Digital Goods (it is completely separate from Google Checkout/Wallet, which also included some support for digital purchases).

See this link announcement

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top