Using the receipt validator with the cordova purchase plugin is as simple as adding a single line in your code at plugin initialization.
store.validator = "https://validator.iaptic.com/v3/validate?appName=[APP_NAME]&apiKey=[PUBLIC_KEY]";
[APP_NAME] with values from your account.
Receipt validation is being called when you do
p.verify(). Some demo code omit this line, so make sure that
p.verify() is called from the
approved event, then
p.finish() called from the
store.when('product') .approved(p => p.verify()) .verified(p => p.finish());
You might have to edit your existing handlers for
approved events to make sure it doesn't call
Depending on how your app is configured, security policy may prevent you to make requests to the validation service (DOM Exception 18 / Error 0). To prevent this, it make sure
validator.iaptic.com is listed in your HTML file’s meta "Content-Security-Policy", in the
Here is an example of what that looks like:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval'; connect-src https://validator.iaptic.com; style-src 'self' 'unsafe-inline'; media-src *">