Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get notified when orders get charged on Google Wallet?

Tags:

android-pay

I'm moving my site's payment processing from Google Checkout to Google Wallet (Digital Goods API), but I'm running into an issue involving payment notification. My goal is to only send licenses to customers after orders are charged, but I don't see how this is possible.

Right now I'm sending licenses to users when I receive the postback JWT, but this isn't the behavior that I want, because, according to my tests so far, it takes about 30-60 minutes to actually charge the customer after the purchase (until then, the order is in a CHARGEABLE state). This is a problem because I've frequently had orders be cancelled before they are charged - I obviously don't want to send out licenses when this happens.

So my questions are:

1) Why aren't customers charged immediately? According to the documentation, "Google Wallet for digital goods orders are charged automatically", but there's no explanation of the delay.

2) Is there any way to receive a notification after the customer is charged? The postback and the success callback that are described in the documentation are both no good for this, because they're both triggered when the order enters the CHARGEABLE, rather than CHARGED state.

I'm hoping that there is some system like the Google Checkout Notification XML API, where different notifications are sent out at each stage of the purchase process, but the Google Wallet documentation makes no mention of such a system.

3) On a related note, is there any way for me to get email notifications when orders are complete? Google Checkout did this, but Google Wallet does not seem to offer this option.

like image 865
BadgerPriest Avatar asked Oct 21 '22 04:10

BadgerPriest


1 Answers

3.) I suggest you send yourself an email through the success_handler via javascript. I'd probably use and ajax call like jQuery's .post and pass all the values such as order ID and so on to a php file and send the email from there. https://developers.google.com/commerce/wallet/digital/docs/jsreference#successhandler

1+2) Here's how I understand it: CHARGEABLE means the credit card has been authorized, and whatever needs to happen between the banks and all that is in progress. CHARGED means google has actually received money from the banks. So the explanation of the delay (I believe) would be the same as if you buy something at the store with your debit card, then look at the account statement and the charge still is in there as "pending". I am under the assumption that you can pretty much rely on the CHARGEABLE state and consider it paid. Whatever happens after that is probably the same risk as when someone used a fraudulent credit card, and the charge gets returned later, or the customer disputes the charge on their statement.

How did your customers cancel the charges? If that happens, could you revoke the license?

like image 90
olli Avatar answered Dec 23 '22 16:12

olli