#garv_api

1 messages ยท Page 1 of 1 (latest)

ivory dewBOT
#

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

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

dull willow
#

Code containing payment intent creation!

#

If you need any further info to solve this please let me know, I am also able to screen share if that helps!

ivory dewBOT
alpine pumice
dull willow
#

const customerSession = await stripe.customerSessions.create({
customer: {{CUSTOMER_ID}},
components: {
payment_element: {
enabled: true,
features: {
payment_method_redisplay: 'enabled',
},
},
},
});

This gives me error of undefined!

#

stripe.customerSessions is undefined

silent pebble
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

#

what SDK version are you using?

dull willow
#

stripe@13.11.0

silent pebble
#

it's a very old version

#

you need to upgrade the version to get access to customerSessions

dull willow
#

Okay can you let this thread be open for 10-20 minutes, I'll try and get back to you if it still doesn't work!

silent pebble
#

so you need to upgrade at least to that

dull willow
#

So it shows only 2 cards, however I have added 8+ Cards do you know why might that be?

silent pebble
#

did you set the allow_redisplay to always on all of them?

dull willow
#

How do I ensure that this is set to true for cards stored after payment!

#

Since I was under the knoledge that cards used for payment are auto saved!

silent pebble
#

you can update the PaymentMethods as per the doc I sent you

dull willow
#

great! It works now one last thing, I am also using setup intent and CardElement to add a new card from my UI to Stripe, do I need to update that manually as well or is there someway I can pass a parameter to ensure its already enabled

silent pebble
#

CardElement doesn't support saved PMs

#

and why are you using CardElements?

#

you're already using PaymentElement here

dull willow
#

We have also created a page where we show all saved cards of user and allow them to either create new card or update older cards

silent pebble
#

you should use the same component in all of these different UIs for a better UX

dull willow
#

I understand but this is not a new payment its just adding a new card to stripe, can that be done using PaymentElement with no charge being deducted?

silent pebble
#

even though

silent pebble
#

PaymentElement is just the name of the element

#

that doesn't mean it will charge the card

#

it depends on the intent you're passing

#

if you're using SetupIntents w/ PaymentElement then the card will only be saved

dull willow
#

Got it thank you!