#girlgonoph
1 messages · Page 1 of 1 (latest)
Hello
When you see this CSP error what happens exactly?
It is preventing the 3DS modal from displaying?
So is there any issue here with actually completing the payment?
yup it is
yes there is an issue I get incomplete transaction on my dashboard
So when you hit the "Complete" button there what happens?
once I click on complete I get this error:
and then the screen shows an unexpected error occured
this is the meta tag I am using :
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' https://js.stripe.com; frame-src http: https: http://localhost:4242 https://js.stripe.com https://hooks.stripe.com; img-src * data: https:;"
/>
Try adding 'self' to img-src * so: img-src * 'self'
yes let me test that out
still shows the same error
using this card number: 4000000000003220
meta tag:
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' https://js.stripe.com; frame-src http: https: http://localhost:4242 https://js.stripe.com https://hooks.stripe.com; img-src * 'self' data: https:;"
/>
sure
Hmm okay can you try testing in incognito real quick?
Would you mind sending the ID of a Payment Intent that you tested this with? I am getting the same error in my dev console but 3DS is working for me.
So this error may be a red herring
Thanks, I see the error but am not immediately sure how to address. Looking in to it and will get back to you
Sure
So according to the error I can see in your logs. This is happening because Indian regulations require that you provide a description for export transactions
In the API that means provide a string to the description parameter when creating your intents https://stripe.com/docs/india-accept-international-payments#international-payments-for-services
I am a little surprised that this error was not more explicitly returned in your code. Do you have code to check for an error returned by confirmPayment and prints it out if present? https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
If we aren't returning this error the way that we normally do, I can raise something to fix it so it isn't as confusing.
Ohh okay I got it
this is the frontend code for payment confirm:
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: ${window.location.origin}/completion,
},
});
if (error.type === "card_error" || error.type === "validation_error") {
setMessage(error.message);
} else {
setMessage("An unexpected error occured.");
}
setIsProcessing(false);
};
Hi there 👋 sincere apologies for the delay here. Looking back at the history of the thread, it seems like things are resolved here, but please let me know if that is not correct and there are still outlying concerns I can assist with.