Question about the wix-pay API triggered from form submission

I have a form that a user enters data into and upon submitting, a payment window opens. I want to hold off on submitting the form until a payment is completed.

I was looking through the API trying to figure out the best way to code this:

Should I have onWixFormSubmit() return True only if the payment == successful? If so, should I have it return false? What about with pending, etc.?

$w("#wixForms2").onWixFormSubmit((event) => {
        //grabs the index of the chosen radio button
        let selectedIndex = $w("#radioGroup3").selectedIndex;
        let customInput = $w("#input23").value; // Saves the value of the custom amount input
        let emailInput = $w("#input10").value;

    // Payment API. Opens a lightbox on success
        createPaymentForProduct(selectedIndex, customInput).then(payment => {
            wixPay.startPayment(, {"showThankYouPage": false})
            .then((result) => {
                if (result.status === "Successful") {
                    setTimeout(function() {
                    }, 500);

                    setTimeout(function() {
                    }, 8000);

                } else {

        if () {
            return false;
        } else {
            return true;

My code above. I have a commented out if/else statement because I was reading around and thought I could stop the submission if the payment status wasn’t “successful” but I can’t figure out how to access the results.status in the above function… Any advice?

Bumping with included code