#shakilkhan496_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1369325203854987386
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
// Fetch Client Secret
const fetchClientSecret = async (amount) => {
try {
const response = await fetch("https://api.stripe.com/v1/payment_intents", {
method: "POST",
headers: {
Authorization: Bearer ${import.meta.env.VITE_STRIPE_SK},
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
amount: (amount * 100).toString(),
currency: "gbp",
"payment_method_types[]": "card",
}),
});
const data = await response.json();
return data.client_secret;
} catch (error) {
console.error("โ Error creating payment intent:", error);
throw error;
}
};
This is my code part
I want to disable AMEX card
any way to do that ?
Hello, not on the payment intent. The best way that I am aware of to do this now is to create a confirmationtoken before confirming your intent. A CT is an object that captures payment method details and lets you examine them before confirming the intent. You can use this to error out if you see an Amex card https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#create-ct
Otherwise you can try reaching out to support and mention blocking amex in the payment element, there may be something they can enable for you but I am not sure