j3k0 / cordova-plugin-purchase

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

bug : store.validator is not defined #1612

Open gxolin opened 2 weeks ago

gxolin commented 2 weeks ago

Observed behavior

The CdvPurchase.store.validator exposes a store.validator property, but this property is not defined in the store final build (same for validator_privacy_policy)

Trying to call it will throw errors : store.validator = (r,c) => {} tried calling InAppPurchase3.validator, but the InAppPurchase3 plugin is not installed. (error catching by awesome-cordova-plugins when something is not defined)

Expected behavior

No inaccessible properties defined in store.ts src but not accessible in store.js build

System Info

package.json :

    "@awesome-cordova-plugins/core": "^6.10.0",
    "@awesome-cordova-plugins/in-app-purchase-3": "^6.10.0",
    "cordova-plugin-purchase": "^13.11.1",

Output of cordova info. cordova: command not found

Dexus commented 12 hours ago

Then just use it properly! https://github.com/j3k0/cordova-plugin-purchase/blob/master/www/store.js#L100-L110

maybe you need to install cordova?

gxolin commented 11 hours ago

Thanks for the advice, but my setup is based on a workaround due to #1610, and I don't use Iaptic as a backend, I have my own. I should have put the context in my issue, sorry:

Dexus commented 8 hours ago

did you setup the capacitor config? and sync?

gxolin commented 7 hours ago

yes, using the cordova-plugin-purchase through the @awesome-cordova-plugins/in-app-purchase-3 is working fine beside the validator function, I've tested the whole subscription purchase with both Android and iOS stores, and live subscription until payment, so I think everything is well configured