#gab-gab_api

1 messages ยท Page 1 of 1 (latest)

west lilyBOT
quick pineBOT
#

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.

west lilyBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253660655651651605

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

shrewd field
#

HI
setupFutureUsage is a PaymenIntent property, you should make the update on the PaymentIntent using the backend.

queen hawk
#

I'm creating the intent after

shrewd field
#

Ah I see that makes sense.

queen hawk
#

In my case I don't want at all setupFutureUsage in the case of Twint, and I want on_session for credit card for instance

#

toggling 'on_session'/'off_session' works but not removing setupFutureUsage

shrewd field
#

Ok, thanks for the explanation! have you had the chance to try elements.update({setupFutureUsage: undefined}) ?

west lilyBOT
queen hawk
#

Both nothing working

ripe bison
#

To unset a parameter you need to pass an empty string to the API

queen hawk
#

from available types ("on_session" | "off_session" | null | undefined) I cannot.
I anyway tried with an empty string but it doesn't work

ripe bison
#

What do you mean by 'doesn't work'?

queen hawk
#

For instance, In case the current element is "card", it doesn't remove the text indicating the card will be saved.

#

Also in my use case, it doesn't allow me to pick Twint because the payment element is still in 'on_session'

ripe bison
#

Can you share the exact code you're using?

queen hawk
#

elements.update({ setupFutureUsage: null })

#

also I try to do this:
elements.update({
setupFutureUsage: null,
paymentMethodTypes: ['twint']
})

ripe bison
#

Did you try setupFutureUsage: ""? That is how you unset fields in the API โ€“ nullish parameters are removed from the payload. I realise it's untyped, but you can ts-ignore that part and let's just see if it works

queen hawk
#

yes i tried to ignore the type and to use "". But it won't apply.

#

with the following code, it will apply the new paymentMethodTypes but 'on_session' will be kept.
elements.update({
setupFutureUsage: ''",
paymentMethodTypes: ['twint']
})

ripe bison
#

Are there any logs in the console?

queen hawk
#

In case i do this code:

  setupFutureUsage: '',
  paymentMethodTypes: ['twint']
 })```
I will have an error because twint is not supported with 'on_session'.

In case i just update setupFutureUsage trying to removing it, it won't do anyhting (no element update, no trigger to the stripe api, no error).
```elements.update({ 
  setupFutureUsage: '',
 })```
ripe bison
#

Seems like this isn't supported in the deferred flow then

queen hawk
#

3 days I try to add Twint without losing the ability to save credits cards..

#

Ok.. cannot explain where in my code analyse I miss it.
Using the latest stripe api '2024-04-10' is working removing the parameter with null

ripe bison
#

Hmm, API version shouldn't matter

queen hawk
#

you right it doesn't change anything switching the api

ripe bison
#

So, setupFutureUsage: null works all along?

queen hawk
#

it is working but I cannot understand why.. I didn't do changes before I start the support chat ๐Ÿ™‚

ripe bison
#

Great!