#lord_confirmationtoken-sfu

1 messages ยท Page 1 of 1 (latest)

loud inletBOT
simple wadiBOT
#

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.

loud inletBOT
#

๐Ÿ‘‹ 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.

deep tulip
#

@subtle vessel do you have an exact error?

subtle vessel
#

yes one sec

deep tulip
#

lord_confirmationtoken-sfu

subtle vessel
#

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.

deep tulip
#

how did you create the PaymentIntent? Can you share that code and the exact PI id?

subtle vessel
#

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

deep tulip
#

can you share that CT id?

subtle vessel
#

ctoken_1PJOMJQ6PD4queU45AKmgthR

#

ctoken_1PJODmQ6PD4queU4p63GtoBC

Actually do this one

#

it's the most recent request

deep tulip
#

yeah that CT doesn't have setup_future_usage set

subtle vessel
#

so is my syntax off then?

deep tulip
#

why is you setup_future_usage outside of params? I think that might be the issue

subtle vessel
#

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.

deep tulip
#

it's still null unfortunately so you don't seem to be passing that parameter properly

subtle vessel
#

any ideas on what I'm missing? I stuck it inside the payment method data portion and it didn't work there either

deep tulip
#

sorry wrong thread

#

Trying to reproduce give me a few minutes

subtle vessel
#

thanks koopa

deep tulip
#

ugh it's setupFutureUsage I think

subtle vessel
#

nice

#

I'll give that a shot one sec

deep tulip
#

you need to pass it when you initialize Elements

subtle vessel
#

ohhhhhhh

#

that makes sense

deep tulip
#

I don't know why we don't error when you pass it to the CT creation, that would have been clearer ๐Ÿ˜…

subtle vessel
#

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}
deep tulip
#

yes

subtle vessel
#

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

deep tulip
#

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

subtle vessel
#

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?

deep tulip
#

yes!

subtle vessel
#

sweet that is exactly how I need it thank you again