Skip to main content

I am using RevenueCat for in-app purchases in my Ionic Capacitor React app. I have a question regarding the scenario when a user purchases or subscribes to a plan. If the payment enters a pending state, how can I check whether the payment was eventually successful or failed?

And also how i am check if the user are not cancel their subscription after plan purchase.

Hi @nishi,

The payment shouldn’t enter a pending state - it’s only successful when the funds have been retrieved correctly. Our SDK throws error messages in case anything goes wrong during the transaction so make sure to handle those cases.

If you set up our webhooks, you can get notified of every single change in the subscription state. You can also always check in the SDK if a user has an active subscription or not.
 

if (Object.entries(customerInfo.entitlements.active).length) {
//user has access to some entitlement
}

Best,