How do I get notified when orders are charged to Google Wallet?

I transfer payment processing for my site from Google Checkout to Google Wallet (Digital Goods API), but I am having a problem with a payment notification. My goal is only to send licenses to customers after orders are charged, but I do not see how this is possible.

I am currently sending licenses to users when I receive a JWT with postback, but this is not the behavior that I want, because according to my tests, it actually takes about 30-60 minutes to actually charge the client after purchase ( up to this point the order is in the CHARGEABLE state). This is a problem because I often ordered orders to be canceled before they are charged - I obviously do not want to send licenses when this happens.

So my questions are:

1) Why do customers not charge immediately? According to the documentation, "Google Wallet for orders for digital goods charges automatically" , but there is no explanation for the delay.

2) Is there a way to get a notification after a customer is charged? The success callback and callback described in the documentation are not suitable for this, because they both start when the order enters CHARGEABLE, and not CHARGED.

I hope there is some kind of system, for example, the XML API for checking Google Checkout, where various notifications are sent at each stage of the purchase process, but there is no mention of such a system in the Google Wallet documentation.

3) Regarding the note, is there a way to receive email notifications when orders are completed? Google Checkout did this, but Google Wallet does not seem to offer this option.

+4
source share
1 answer

3.) I suggest you send an email via success_handler via javascript. I would probably use an ajax call, for example jQuery.post, and transfer all the values, such as order ID, etc., to the php file and send an email from there. https://developers.google.com/commerce/wallet/digital/docs/jsreference#successhandler

1 + 2) This is how I understand it: CHARGEABLE means that the credit card is authorized, and everything that should happen between banks and everything that happens. CHARGED means that Google actually received money from banks. Thus, the explanation of the delay (I believe) will be the same as if you bought something in a store with a debit card, and then look at the account statement and the charge is still there as β€œwaiting”. I believe that you can rely heavily on the state of CHARGEABLE and believe that it is paid. Whatever happens after this is probably the same risk as when someone used a fraudulent credit card and the charge comes back later, or the client disputes the charge in their statement.

How did your customers cancel fees? If this happens, can you revoke the license?

+3
source

Source: https://habr.com/ru/post/1492841/


All Articles