j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

Problem with fovea validator #1550

Open yiannis-spyridakis opened 1 month ago

yiannis-spyridakis commented 1 month ago

Observed behavior

I am working on a project that uses the paid version of the fovea validator of the form:

https://validator.fovea.cc/v1/validate?appName=APP_NAME&apiKey=API_KEY

We are currently integrating v13.x of the plugin and I have tested Android/Google Playstore for the time being. The problem is that in case of successful validation the success payload is returned with an empty .collection (VerifiedPurchase[]). This causes CdvPurchase.Product.owned to always return false (even for owned products) because CdvPurchase.Store.verifiedPurchases remains unpopulated.

A custom/dummy validator function that populates the collection with {id, purchaseDate, isExpired} fixes the issue.

Expected behavior

I don't know if it is an issue with the fovea validator or it is expected. In the later case should CdvPurchase.Product.owned use a different check? e.g. check for acknowledged transactions with the product?