voltrue2/in-app-purchase

Cannot Find Attribute "sandbox" in validate() result

BabyToy opened this issue · 0 comments

As stated, I need to find out if the validated receipt is a sandboxed purchase, but I cannot find the attribute "sandbox".

This is my code:

validatedData = await iap.validate(receipt);
if (!iap.isValidated(validatedData)) {
  throw new Error("Purchase validation error");
}
if (validatedData.sandbox) {
  throw new Error("Sandbox receipt used in production");
}

I have read this issue but then I get the error Property 'sandbox' does not exist on type 'ValidationResponse'

Can anybody tell me what I am doing wrong?

[EDIT: typo]