You can first offer these packages using Wix pricing plans .
Displaying these on a page for members to purchase, and then coding it so on payment successful, you add a certain number to a database with their info. So for example if I purchase the a plan with 5 credits, my user email and credits are added to a database.
Here is some example code on how it could be done.
import wixPaidPlans from 'wix-paid-plans';
import wixData from 'wix-data';
$w.onReady(function () {
$w("#button").onClick(()=> {
wixPaidPlans.purchasePlan("planId") // you can get the plan id from the paid plans db
.then((results)=> {
if (results.wixPayStatus === "Successful") {
let toInsert = {
email: "userEmail",
credits: 5
}
wixData.insert("DBNAME", toInsert)
.then((res)=> {
console.log(res)
})
}
})
})
});
Here are some more helpful links -
Wix Data
Wix Paid Plans