WIX Pay API custom success and error message

I am making a custom check out process with Wix Pay API. It all works perfectly except for when I attempt to add a custom success and error page.

This is the code I am using:

import wixPay from ‘wix-pay’;
import {createPaymentForProduct} from ‘backend/BE_PayAPI’;
import {createPaymentForProduct2} from ‘backend/BE_PayAPI’;
import wixWindow from ‘wix-window’;
export function submit_click(event, $w) {
createPaymentForProduct()
.then( (payment) => {
wixPay.startPayment(payment.id, {“showThankYouPage”: false })
.then( (result) => {
if (result.status === “Successful”) {
wixWindow.openLightbox(“Success Box”);
} else if (result.status === “Pending”) {
wixWindow.openLightbox(“Pending Box”);
}
} );
} );
}
export function submitP_click(event) {
createPaymentForProduct2().then(payment => [{]({
wixPay.startPayment(payment.id);
});
}
)
[wixPay.startPayment(payment.id);]({
wixPay.startPayment(payment.id);
});
}
)
[});]({
wixPay.startPayment(payment.id);
});
}
)
[}]({
wixPay.startPayment(payment.id);
});
}
)

The second submit button works perfectly where there is no custom messages, however the first submit button does not even bring up the pay box when clicked.