I use Stripe checkout with a webhook call on checkout.session.completed which activates a PHP script and a javascript call when the payment is completed:
const handleComplete = async function() {
_paiement.verif(checkout);
}
const checkout = await stripe.initEmbeddedCheckout({
clientSecret,
onComplete: handleComplete
});
I didn’t have a problem with test cards or normal bank cards but when doing a test with a virtual card (Pennylane) the javascript call is made before the webhook call which poses a problem for me because the javascript call I use to check that the webhook call went well.
Did I miss a setting, misuse these functions…?