#harcon_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/1298964630051487816
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Do you have an example Checkout Session I can look at? A cs_xxx ID would be great
give me a minute and i'll track one down. In the meantime here is our payment intent creation code in case that helps:
let paymentintentrequest = {
amount: convertdollarstocents(amount),
automatic_payment_methods: { enabled: true },
setup_future_usage: 'off_session',
currency: 'usd',
customer: stripecustomerid,
description: paymentdescription,
metadata,
};
const customersession = await stripelts.customersessions.create({
customer: stripecustomerid,
components: {
payment_element: {
enabled: true,
features: {
payment_method_redisplay: 'enabled',
payment_method_save: 'enabled',
payment_method_save_usage: 'off_session',
payment_method_remove: 'enabled',
},
},
},
});
const paymentintent = await stripe.paymentintents.create(paymentintentrequest);
Ah, sorry thought you meant you were using our Checkout product, but it looks like Payment Element with intents?
The issue is the setup_future_usage parameter that you set on creation. The card will always be saved if that is set regardless of whether the customer checks the box. Just omit that and it'll behave as you expect
That looks like an error thrown from your integration as opposed to Stripe specific. When is that thrown? When you click pay?
What's the intent ID?
Sorry there was a different error displayed before that
"The provided setup_future_usage (null) does not match the expected setup_future_usage (off_session). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements."
I guess you're using deferred intents and initialise Elements like this: https://docs.stripe.com/js/elements_object/create_without_intent
You'll need to remove the setupFutureUsage param from there too