Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

receiptValidator never return when validating expired subscription #24

Open
antemond opened this issue Feb 26, 2019 · 2 comments
Open

Comments

@antemond
Copy link

antemond commented Feb 26, 2019

I use the receipt validator to verify if a user has an active subscription. When the subscription is active , the validator is very quick. When it is not , it never resolves.

export async function validateSubscription(email: string, purchases: any[]): number {
  const sortedPurchases = sortPurchases(purchases);
  const validationData = await receiptValidator(sortedPurchases[0].transactionReceipt);
  if (validationData.auto_renew_status === 1) {
    return +validationData.receipt.expires_date;
  }
  return 0;
}
@kesha-antonov
Copy link

Same after purchase. Just hangs

@ssac
Copy link

ssac commented Sep 3, 2020

I think you may access the data in a wrong way.
The expire_date path should be validationData.latest_receipt_info[latestInfoIndex].expires_date_ms. (or .expires_date for Date format).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants