#solo0487

1 messages · Page 1 of 1 (latest)

main sinewBOT
surreal lagoon
#

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?

restive umbra
#

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);

};

surreal lagoon
#

Can you share the PaymentIntent ID (pi_xxx) with this issue?

restive umbra
#

pi_3NsjRaSCQ9eyVhGC19I3FQdX

surreal lagoon
#

Based on the error messages alone, could you try using httpS and see it it resolves the issue?

restive umbra
#

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

surreal lagoon
#

And did the payment work?

restive umbra
#

no still the same error
An unexpected error occurred.

surreal lagoon
#

Can you share a screenshot of your browser console and network errors?

#

I need more information on the exact error you get

restive umbra
surreal lagoon
#

In the newtrok tab, if you click on the red line that says 404, what do you see?

restive umbra
surreal lagoon
#

And what's in the "reponse" tab?

restive umbra
#

response headers(0) nothing

surreal lagoon
#

And there are no other errors in the network tab?

restive umbra
#

no

#

no other errors

last mirage
#

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?

restive umbra
#

yes

last mirage
#

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

restive umbra
#

getting the same error even after

last mirage
#

Is there somewhere I can reproduce this by running your code?