#scmitton
1 messages · Page 1 of 1 (latest)
Here is where I'm trying to confirm the setup
const confirmSetup = async () => {
stripe.confirmSetup({
clientSecret,
confirmParams: {
payment_method_data: {
card: elements.getElement(CardElement),
billing_details: {
name: document.getElementById('name-on-card').value,
email: JSON.parse(sessionStorage.getItem("user")).email,
address: {
city: document.getElementById('city').value.split(',')[0],
state: document.getElementById('city').value.split(',')[1],
postal_code: document.getElementById('zip').value
}
}
},
return_url: ${window.location.origin}/success
}
}).then((result) => {
if (result.error) {
setErrMsg(result.error.message)
} else {
if (result.paymentIntent.status === 'succeeded') {
setSucceeded(true)
}
}
})
}
Do you have the request id? from https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
req_e86sp9LTphBbEr
You cannot confirm this SetupIntent because it's missing a payment method. Update the SetupIntent with a payment method and then confirm it again.
const {error} = await stripe.confirmSetup({
//`Elements` instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: 'https://example.com/account/payments/setup-complete',
}
});
When using confirmSetup you should pass the elements directly here
What about the client secret?
Just the client secret then how do you pass in the payment info of the customer?
Hmm you used card: elements.getElement(CardElement)
Is there a Doc you are following?
In that scenario I was using what copilot suggested
I don't believe that's correct. Please follow the Doc here. The step is "Submit the payment to Stripe"
No. CardElement has the confirmCardSetup method instead