#harcon_api

1 messages ยท Page 1 of 1 (latest)

ocean crestBOT
#

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

arctic dome
#

Do you have an example Checkout Session I can look at? A cs_xxx ID would be great

tribal raptor
#

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);
arctic dome
#

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

tribal raptor
#

I have tried omitting that but get an error, I will find it now for you

arctic dome
#

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?

tribal raptor
#

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."

arctic dome
#

You'll need to remove the setupFutureUsage param from there too

tribal raptor
#

Got you, i'll give that a try. now

#

Nice that seems to have solved the issue! thank you for your help ๐Ÿ™‚