Two weeks ago, I coded everything to allow users to buy a plan on a custom page… everything was working well since today.
This is the code:
import wixUsers from 'wix-users';
import wixPaidPlans from 'wix-paid-plans';
let planId = '4d845741-717a-43e5-a884-25ef3cbd3905';
$w.onReady(function () {
$w('#buyNow').onClick((event) => {
let user = wixUsers.currentUser;
let isLoggedIn = user.loggedIn;
if (!isLoggedIn) {
wixUsers.promptLogin().then(() => {
wixPaidPlans.purchasePlan(planId)
.then((myPurchase) => {
let myOrderId = myPurchase.orderId;
let myWixPayOrderId = myPurchase.wixPayOrderId;
let myWixPayStatus = myPurchase.wixPayStatus;
})
})
} else {
wixPaidPlans.purchasePlan(planId)
.then((myPurchase) => {
let myOrderId = myPurchase.orderId;
let myWixPayOrderId = myPurchase.wixPayOrderId;
let myWixPayStatus = myPurchase.wixPayStatus;
}
)}
})
})
When testing the code on preview, this message appears… without any clue of how to solve it
Please give me a hand friends