How to put the Buyer info in the Events.js

Hello, set up my paid plan using corvid, everything is working fine, but I have a question, how can I add the buyer info into the Database (Collection) at this moment, and in the tutorial, we only have the title and the data, but the data does not contain the name of who purchased.

Thanks in advance for the asistance you can provide.

Hi Ruben,

You can use the wix-paid-plans API’s onPlanPurchased() function to add the buyer info into a database collection.

You can create a custom database collection with whatever fields you like and insert the data there.

Since a user has to be logged in to purchase a plan you can use the currentUser property to determine who is purchasing the plan.

Hope this helps!

Dara | Corvid Team