#solo0487
1 messages · Page 1 of 1 (latest)
Hi there!
Can you share the PaymentIntent ID (pi_xxx) with this issue?
But based on the error message, it looks like you should be using httpS but aren't?
I am not using https right now as I am developing my project from scratch
aftr clicks pay now a modal will be pop up but suddenly closes and return error
const handleSubmit = async (e) => {
e.preventDefault();
if (!stripe || !elements) {
// Stripe.js hasn't yet loaded.
// Make sure to disable form submission until Stripe.js has loaded.
return;
}
setIsLoading(true);
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: "http://localhost:3000",
},
});
// 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") {
setMessage(error.message);
} else {
setMessage("An unexpected error occurred.");
}
setIsLoading(false);
};
Can you share the PaymentIntent ID (pi_xxx) with this issue?
pi_3NsjRaSCQ9eyVhGC19I3FQdX
Thanks! That PaymentIntent was correct created: https://dashboard.stripe.com/test/logs/req_yJqfof6ckFUvbZ
However no paymentmethod was added to it on the frontend.
Based on the error messages alone, could you try using httpS and see it it resolves the issue?
used https
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: "https://localhost:3000",
},
});
now
Refused to load the image 'data:image/png;base64,iVBORw0KGgo=' because it violates the following Content Security Policy directive: "img-src 'self'". only this error
And did the payment work?
no still the same error
An unexpected error occurred.
Can you share a screenshot of your browser console and network errors?
I need more information on the exact error you get
In the newtrok tab, if you click on the red line that says 404, what do you see?
And what's in the "reponse" tab?
And there are no other errors in the network tab?
Can you confirm which error we're debugging here? I don't believe the CSP image related one is from Stripe.js
Seems like confirmPayment is erroring, yes?
Are you able to try this in an incognito/private window?
Also try disabling any third-party browser extensions
My guess is something is preventing either the 3DS modal loading and/or the redirect
getting the same error even after
Is there somewhere I can reproduce this by running your code?
Maybe via https://stackblitz.com/ or similar