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

Added InAppBilling.VerifyPreviousPurchaseAsync() #210

Merged
merged 1 commit into from Aug 17, 2019

Conversation

rihadavid
Copy link

So I was thinking, what should I do if user purchases the product in the store but the verification on our server fails. I was looking for a way to call the verification on this purchase again, but did not find a solution.

Calling InAppBillingImplementation.GetPurchasesAsync() with verification will try to verify all the previous purchases, which is not what I want - it will fail on the server because it had been verified before and also the server request will be pointless for those already verified purchases. And if user just tries to purchase the product again, it will fail with PurchaseError.AlreadyOwned and the verification will not be performed, right?

I've been thinking about many ways how this could be implemented, but I think this one is the easiest. Tell me what you think, it's my first PR here.

Changes Proposed in this pull request:

  • added BaseInAppBilling.VerifyPreviousPurchaseAsync() method to support verifying a single previous purchase, internally using GetPurchasesAsync() method with verification limited to the specified product
  • changed InAppBillingImplementation.GetPurchasesAsync() methods to protected to support the additional parameter and moved the original public method to BaseInAppBilling

@InquisitorJax
Copy link

InquisitorJax commented Apr 10, 2019

@jamesmontemagno This would definitely be useful

@jamesmontemagno jamesmontemagno merged commit 144c3b0 into jamesmontemagno:master Aug 17, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants