My plan involves creating a wallet collection in the database manually using Wix Velo code. Once a pricing plan is purchased by the user, I need to determine where to call the onPlanPurchased() method to add the amount to the wallet
import wixData from 'wix-data';
export function wixPaidPlans_onPlanPurchased(event) {
if (event.order.price.amount === 0) {
let orderData = {
"title": "Free plan purchased",
"data": event.order
};
wixData.insert("planEvents", orderData);
} else {
let orderData = {
"title": "Regular plan purchased",
"data": event.order
};
wixData.insert("planEvents", orderData);
}
}