Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: execute callback when android is done processing payment #22

Closed
Robert-van-Barlingen opened this issue Aug 2, 2020 · 2 comments

Comments

@Robert-van-Barlingen
Copy link

On android, when you initiate the IapHub.buy() function, it shows the google play purchase UI. When the payment in finished processing in the google play purchase UI is still takes some time before the buy() Promise is resolved. (I assume it verifies the purchase receipt during this time.) However, as soon as the google play purchase UI is closed I would like to show an element letting the user know that his payment is being processed further. Would it be possible to pass a callback to the buy() function that is executed as soon as the google play purchase UI closes?

@iaphub
Copy link
Owner

iaphub commented Aug 3, 2020

Correct @Astrejoe, this is an interesting option to add, we'll take a look at it.

@iaphub
Copy link
Owner

iaphub commented Aug 5, 2020

The onReceiptProcess option has been added in the latest release 🙂

var transaction = await Iaphub.buy("pack10_tier15", {
    onReceiptProcess: (receipt) => {
      console.log('Purchase success, processing receipt...');
    }
});

@iaphub iaphub closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants