Google Wallet docs (for digital goods) say:
Note: These callback handlers are not secure. Someone could use Firebug or the Chrome Developer Tools to call one of the functions, mocking a success or failure. You should confirm the purchase on the server.
The link in the quote being to specifying a postback URL.
But since the jwt is signed by Google - why is that needed? We can simply check the signature of the success handler's jwt in the page's codebehind on the server.
(And if signing isn't enough - it shouldn't be enough at the postback url either, because if someone discovers the url - they might send a POST there and the problem returns.)
The documentation states *IF* you specify a postback url . So you can try not providing one and process the way you describe above (which is still "server side").
Assuming your test works, the difference between the two:
in the scenario with the postback url, all parties concerned, buyer, you and Google are "in sync" - if you can't fulfill for whatever reason, have some server issue on your end, etc., then the transaction fails (no order generated) for all.
in the scenario without the postback url, assuming a success, the transaction may have different states:
Hope this helps...
There is another "benefit" (could be critical in some flows) where security is concerned. With a postback url, you obtain the order details for yet-another-verification step (e.g. based on order-id). You can verify whether an order sent by/from client is "valid" (whatever business rule - e.g. if order-id exists then.....
) because the success callback happens after the postback.
e.g. mock by replaying the same (valid) JWT (within bounds of iat/any expiration)
There could be myriad flows that sellers/devs come up with in their app so using "postback url verification processes" mitigates possible issues.
Hth....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With