#lord_confirmationtoken-sfu
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- l0rdandbooz_best-practices, 2 hours ago, 30 messages
๐ 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/1242977998723092520
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
@subtle vessel do you have an exact error?
yes one sec
lord_confirmationtoken-sfu
error - StripeInvalidRequestError: The provided setup_future_usage (off_session) does not match the setup_future_usage from the provided confirmation_token (null). Try confirming with a Payment Intent that is configured to use the same parameters as the ConfirmationToken.
how did you create the PaymentIntent? Can you share that code and the exact PI id?
const intent = await stripe.paymentIntents.create({
confirm: true,
amount,
currency: 'usd',
description: Donation to ${name},
customer: customerId,
return_url: "https://yourwebsite.com/payment-success",
// In the latest version of the API, specifying the `automatic_payment_methods` parameter is optional because Stripe enables its functionality by default.
automatic_payment_methods: {enabled: true},
confirmation_token: confirmationTokenID, // the ConfirmationToken ID sent by your client
setup_future_usage: 'off_session',
}, {
stripeAccount: connectAccountID,
});
I don't think I have a payment intent ID as it's getting stuck when I create it here
can you share that CT id?
ctoken_1PJOMJQ6PD4queU45AKmgthR
ctoken_1PJODmQ6PD4queU4p63GtoBC
Actually do this one
it's the most recent request
yeah that CT doesn't have setup_future_usage set
so is my syntax off then?
why is you setup_future_usage outside of params? I think that might be the issue
I had it in there earlier and moved it out because it wasn't working. I'll try again rq
same error:
"ctoken_1PJOTwQ6PD4queU4ELRSKPfj"
const {error, confirmationToken} = await stripe.createConfirmationToken({
elements,
params: {
payment_method_data: {
billing_details: {
name: firstName + " " + lastName,
email: email,
phone: phone,
}
},
setup_future_usage: 'off_session',
}
});
error - StripeInvalidRequestError: The provided setup_future_usage (off_session) does not match the setup_future_usage from the provided confirmation_token (null). Try confirming with a Payment Intent that is configured to use the same parameters as the ConfirmationToken.
it's still null unfortunately so you don't seem to be passing that parameter properly
any ideas on what I'm missing? I stuck it inside the payment method data portion and it didn't work there either
thanks koopa
ugh it's setupFutureUsage I think
you need to pass it when you initialize Elements
I don't know why we don't error when you pass it to the CT creation, that would have been clearer ๐
like this right?
const options = {
// clientSecret: setupIntent,
mode: 'payment',
amount: selectedValue,
currency: 'usd',
paymentMethodCreation: 'manual',
setupFutureUsage: 'off_session',
}
};
return (
<Elements stripe={stripe} options={options}>
<CombinedForm {...props}
yes
Hey that worked!!!
Thank you
yeah it'd be nice if it threw it on the CT creation
If you want some customer feedback haha
yeah I'll flag internally because I expected it to, we usually validate unexpected params
this was in beta for a long time so maybe we were worried to break people ๐
really sorry for the confusion I should have caught it earlier
NP man I appreciate your help!
and then the payment method returned from that payment intent can be used in the future and for recurring purchases right?
yes!
sweet that is exactly how I need it thank you again