Skip to main content
Question

Webook renewal event is sent if product is already purchased

  • 31 July 2024
  • 2 replies
  • 49 views

Hi!

Main Flow:
My backend listens to Revenue Cat webhook events. I listen to renewal to mark old subscription as in active and create a new active subscription with full in-app balance.

Currently if user clicks on product he already purchased, Revenue cat react native client throws error with code Purchases.PURCHASES_ERROR_CODE.PRODUCT_ALREADY_PURCHASED_ERROR which is correct. But then I get webhook event on purchase. 

Question:
Why this happens if Apple doesn’t let to re-subscribe to plan which hasn’t expired yet. 

From my understanding after client PRODUCT_ALREADY_PURCHASED_ERROR was thrown no webhook event should come to backend. 

Hey @kikitik,

You’re right, it wouldn’t be expected for the purchase to go through after this error is thrown. What webhook event are you currently receiving after this error, and have you bee able to reproduce this with a test user? 

If so, it’d be great if you were able to share the debug logs to support@revenuecat.com so that we can troubleshoot further. 


@kaitlin 

Hi!
> What webhook event are you currently receiving after this error?
A: I am receiving Renewal event. 

> have you bee able to reproduce this with a test user? 
A: Yes, I created a few users via Apple Sandbox and this flow happens every time.

> it’d be great if you were able to share the debug logs
A: I’m not sure what do you mean by debug logs, I only see the stadard error on client and then webhook even received on my backend.
I’m using latest react-native-purchases version 7.28.1 on client
And subscribed on a few webhooks events including Renewal. 

As a workaround I can fetch my current user subscription before showing offers in paywall and exclude showing already purchased ones + add additional check on backend but it would be nice if flow would work out of box. Should I maybe downgrade react-native-purchases version?