Tracking Role Changes in SaaS System with Wave

Solved
dev42 ・

Jan 15th, 2023 04:55 PM

I am setting up a SaaS system with Wave and I have a question. When a user purchases a pro membership, their information is updated and their account becomes pro. How do I update their information when the subscription period ends? How can I track the user's subscription status and automatically update it if changes occur?

When a user makes a purchase, their role changes, but I need to keep track of this when the membership expires. Is there a way to do this? I may have missed it, but I couldn't find any information about it in all the videos and resources I reviewed.

bobbyiliev ・

Jan 16th, 2023 02:17 AM

Hi there,

What you could do is use the Paddle webhooks:

Working with Paddle webhooks

In the input for the URL add your_wave_domain.com/paddle/webhook. Then make sure to select the subscription events so that they get triggered.

That way when someone stops paying for their subscription, their account will be automatically downgraded to a free one as Paddle will hit the /paddle/webhook route on your Wave app, where the Wave\Http\Controllers\[email protected] method handles the respective action.

Hope that this helps!

Report
1
dev42 ・

Jan 16th, 2023 04:29 AM

I guess I was so tired yesterday I didn't see the hooks, thanks.

dev42 ・

Jan 16th, 2023 04:56 AM

The big drawback is that there is no video on this topic, there is a video explanation about everything else but not about paddle hooks. Honestly I don't know how to do it, I don't know about hooks, I added my_wave_domain.com/paddle/webhook. to the URL entry. I guess I don't understand the logic, I need to make requests to webhooks periodically, I think I need some special help.screenshot-sandbox-vendors.paddle.com-2023.01.16-15_51_47.png

bobbyiliev ・

Jan 16th, 2023 07:55 AM

・

Best Answer

Hi there,

Thanks for that feedback. I will look into writing a tutorial on how to set that up or updating the Wave documentation to add a reference for the webhooks in there directly.

Just tick the Webhook checkbox next to the subscription actions.

There is no need run this manually, everytime there is an change on the Paddle end, a request will be sent to the webhook URL that you've specified. The request payload will contain the information of what has changed, like a failed payment, a canceled payment and etc. based on that information, Wave will change the role fo the user. You can see all that logic in the controller that I've mentioned above.

Webhooks is a comment practice and is not something specific for Wave, a good place to start is the Paddle documentation that I've linked above where they explain how it all works.

Let me know if you have any questions!

Report
1
dev42 ・

Jan 16th, 2023 11:53 AM

I checked all the boxes, then saved and created a sample user, defined a subscription, then canceled the manual subscription on the Paddle side and when I checked the user information again, there is no change.

I understood from what you said that I need to add the Webhook url address of my site to the Paddle Webhook url section and select Webhook Subscription options, I did these, I saved the page, but as you said, the processes do not work automatically, there is no changing situation, there is an error, there is an error, my site cannot communicate with Paddle or I do not understand, but there are other things I need to do.

This shouldn't be this difficult, I'm making a mistake somewhere but I don't know what.

dev42 ・

Jan 16th, 2023 01:09 PM

I made a new installation and the result is everything is fine, I think I made a mistake somewhere, so it didn't work, in fact, the wave that made a mistake from the beginning works in a structure that works very well, the problem was with me :). Thanks for all your answers.

bobbyiliev ・

Jan 16th, 2023 01:21 PM

No problem at all! Happy to hear that it is all working now well! πŸ™Œ

Report
1