#BRData

1 messages · Page 1 of 1 (latest)

inner nimbusBOT
sturdy tendon
#

"message": "You cannot provide a new payment method to a PaymentIntent when it has a status of requires_capture. You should either capture the remaining funds, or cancel this PaymentIntent and try again with a new PaymentIntent."
"type": "invalid_request_error"

#

req_QjMJPv6SlQPMDg

zinc gate
sturdy tendon
#

req_QjMJPv6SlQPMDg

zinc gate
#

Thanks, looking

#

Okay the message basically makes sense. You already confirmed the payment intent and it's status is requires_capture. You cannot re-confirm it with a different payment method, you can only capture the funds.

sturdy tendon
#

What exactly do you mean by re-confirm it?

#

Is that saying that my webhook is trying to re-confirm it?

zinc gate
#

You make a second API call to the /confirm endpoint. I don't know why but that is what is happening

sturdy tendon
#

With the stripe iframe is it possible for them to double click the pay button to cause this to happen

zinc gate
#

What Stripe product are you using? Payment Element, Checkout, etc?

sturdy tendon
#

This is currently what I have:

#
            e.preventDefault();
            //setLoading(true);
            document.getElementById("button-text").innerHTML = "Loading..."
            var payload = removeAfterSecondUnderscore(paymentIntentIDSend)
            reportRequest = $.ajax({
                method: "POST",
                url: "/Cart/CheckPaymentStatus",
                data: { paymentIntent: payload },
                success: function (data) {
                    if (data != "failed") {
                        //setLoading(false)
                        document.getElementById("button-text").innerHTML = ""
                        document.getElementById('confirmMessage').style.display = 'block';
                        document.getElementById('lbOrderID').innerHTML = 'Order ID: '+ data
                    } else {
                        document.getElementById("button-text").innerHTML = "Pay Now"
                        alert("Something went wrong");
                    }
                }
            });
        

        const { error } = await stripe.confirmPayment({
            elements,
            redirect: "if_required",
            confirmParams: {
                // Make sure to change this to your payment completion page
                return_url: windowLocation,
                receipt_email: emailAddress,
            },
        });

        // This point will only be reached if there is an immediate error when
        // confirming the payment. Otherwise, your customer will be redirected to
        // your `return_url`. For some payment methods like iDEAL, your customer will
        // be redirected to an intermediate site first to authorize the payment, then
        // redirected to the `return_url`.
        if (error.type === "card_error" || error.type === "validation_error") {
            showMessage(error.message);
        } else {
            showMessage("An unexpected error occurred.");
        }

        setLoading(false);
    }```
#

The CheckPaymentStatus function is a function I created to check the webhook.

zinc gate
#

Okay so the submit button is not controlled by Stripe, only the Payment (or Card) element that collects the payment method details. If your customer double clicked the button that could trigger a second confirmation call which would fail with this error message

#

But it looks like they clicked 12 seconds after the successful confirmation call

sturdy tendon
#

But does that realistically even break anything?

zinc gate
#

No