#BRData
1 messages · Page 1 of 1 (latest)
"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
HI 👋
Can you share the request ID of the API request that returns this error? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_QjMJPv6SlQPMDg
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.
What exactly do you mean by re-confirm it?
Is that saying that my webhook is trying to re-confirm it?
You make a second API call to the /confirm endpoint. I don't know why but that is what is happening
With the stripe iframe is it possible for them to double click the pay button to cause this to happen
What Stripe product are you using? Payment Element, Checkout, etc?
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.
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
But does that realistically even break anything?
- Successful confirm: https://dashboard.stripe.com/logs/req_WUJjU32VqwVjGV 2023-09-25 12:04:41 UTC
- Failure: https://dashboard.stripe.com/logs/req_QjMJPv6SlQPMDg 2023-09-25 12:04:41 UTC
No