My idea is to make a wallet collection in database which I will create manually through wix velo code. After a pricing plan is purchased by the user where to do I call onPlanPurchased( ) method to add the amount in 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);
}
}