Once a user uses PayPal subscription button, how do I lock/unlock content?

sirblack
Contributor
Contributor

I'm brand new to PayPal. I have created a payment plan and have copied and pasted code for a PayPal subscription button into my website. But once a user subscribes or unsubscribes, how do I lock/unlock website content based on the user's subscription status? I have created a website using glitch.com and have connected that website to my Firebase Realtime Database that I have created. I am hoping to write server-side PayPal code that will simply write the user's subscription status to the Firebase database. From there, I can easily have website content lock or unlock based on the status saved to the database, and also by using Firebase security rules. All I need is to figure out that server side PayPal code to write to the database.

Login to Me Too
1 REPLY 1

vaishnavib
Moderator
Moderator

Good day @sirblack

 

Thank you for posting to the PayPal community.

 

I would like to inform you that by utilizing webhooks, you will receive notifications when a user subscribes or unsubscribes. These notifications will enable you to make the necessary changes in your database. To gain a better understanding of webhooks and how they work, I kindly suggest referring to the following link: https://developer.paypal.com/api/rest/webhooks/event-names/.

 

However, I regret to inform you that at this time, we do not have a PayPal code available that allows for the direct updating of subscription statuses in the database. To make the required changes, I recommend reaching out to your website developer who can assist you further with this matter.

 

If you still facing the issue, please create a MTS ticket via -   https://www.paypal-support.com/s/?language=en_US with detailed error information. 

 

Sincerely,

Vaishnavi

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.