Hi there!
My wife (www.momsup.de) offers courses with Payment Type “FREE” and “OFFLINE” in the Database Bookings/Services (wix Premium). With “FREE” everything works fine, with “OFFLINE”, the checkoutBooking() function always stucks without any ERROR-Message. I’ve read and tried out almost everything but nothing works (set up manual Payment in the Dashboard, tried out CouponCodes, read every Documentation, Examples, Tutorials etc.)
Please help!
The relevant Code:
async function bookingFunction (payment, bookingInfo) {
if (payment === "FREE") {
let bookingStat = await bookingCheckout (bookingInfo);
console.log("bookingStat:",bookingStat);
return bookingStat;
}
else {
let options ={
"paymentType": "wixPay_Offline",
"couponCode": "" //tried without "couponCode" & with an existing Code
}
let bookingStat = await bookingCheckoutPay (bookingInfo, options);
console.log("bookingStat:",bookingStat);
return bookingStat;
}
}
My bookingCheckoutPay function:
async function bookingCheckoutPay (bookingInfo, options) {
console.log("BookingInfo(Pay):",bookingInfo);
console.log("Options:",options);
return wixBookings.checkoutBooking(bookingInfo, options) //this stucks!
.then( (results) => {
let id = results.bookingId;
console.log("Buchungsnr.:",id);
let status = results.status;
console.log("Buchungsstatus:",status);
$w('#confirmationText').text = status;
return status;
} );
}
My bookingCheckout function (for “FREE” Payment, works perfect!):
async function bookingCheckout (bookingInfo) {
//console.log(bookingInfo);
return wixBookings.checkoutBooking(bookingInfo)
.then( (results) => {
let id = results.bookingId;
console.log("Buchungsnr.:",id);
let status = results.status;
console.log("Buchungsstatus:",status);
$w('#confirmationText').text = status;
return status;
} );
}
Monitoring the test on live site:
The bookingInfo is okay, it stucks because of the paymentOptions, any Ideas?
Thanks a lot for your support!
Greetings,
Tom