In app purchase 2 receipt validation CORS

Hi there,

I have an app which uses In App Purchase 2, however my submission was rejected due to requiring receipt validation.

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.

They link me to the following for validation urls, however when I try hit the urls I get cors errors:

[Error] Preflight response is not successful
[Error] XMLHttpRequest cannot load due to access control checks.
[Error] Failed to load resource: Preflight response is not successful (verifyReceipt, line 0)

This is how I implemented it in the code for now:

//TODO try production first
this.inAppPurchase.validator = "";

Have I missed something? I am using capacitor 3.2.0

Thanks in advance


I was of the understanding receipt validations were only required for subscriptions (not a one off in app purchase)

Actually I don’t think this is and issue. Its not a subscription so therefore should not require back end validation