#pawan_code

1 messages ยท Page 1 of 1 (latest)

cunning kilnBOT
#

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

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

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.

lilac drum
#

๐Ÿ‘‹ how may I help?

sand flare
#

Hi Tarzan I Want to Know Couple of Things

lilac drum
#

please next time define clearly your ask when you fill the form in #help

sand flare
#

I have an e-commerce site built with React,
and in the "My Account" section under the user's profile, I want to display the Stripe Payment Element form. The goal is to collect the user's card details and save them to their Stripe account for future use.

Note: I do not want the user to save their card information during checkout.

lilac drum
#

this way we could help you faster

sand flare
#

Which Approach Is Fine

  1. Collecting the Payment Details and Crating the payment Method and Attaching to a customer is it the Correct Approach
    I am Using Stripe Payment Element
lilac drum
#

you can use SetupIntents if you just want to save a PaymentMethod without charging

sand flare
#

What about the Approach I told

sand flare
lilac drum
#

that's the same approach that I suggested

sand flare
#

Yes I Tried This But The Issue i am facing is Sometimes I am Not Getting Checkbox to Save The Card from stripe Payment Element

lilac drum
#

this is not a PaymentIntent

#

this is a SetupIntent

sand flare
lilac drum
#

which is meant to be used to save for future usage

#

that's why you don't see the checkbox

#

are you creating a SetupIntent correctly?

sand flare
#

Yes

#

Let me Share the code

lilac drum
#

yes then you're good to go

sand flare
#

To Show The Checkbox We Need to create Customer Session Right

sand flare
# sand flare

As shown in this Image i am creating customerSession & passing to Element option to get the checkbox if i am not creating then i am not getting

lilac drum
#

the Checkbox will only show if you're saving during payment

sand flare
#

Okay if i am Not Showing the Checkbox then in payment method allow_redisplay in coming as unspecified ?

#

why so ?

cunning kilnBOT
unkempt vapor
#

because it's just how it works, the customer/you have to explicitly indicate that the card should be available for reuse

sand flare
#

Hi karl

#

I am using Setup intent to save User card in MY Account Scection so that customer can reuse it later
As Shown in above Image

#

In payment Form You can Observe Save Checkbox is comming which is coming when i am cretaing customer session

#

if we are not showing then card is saving but allow_redisplay is unspecified because of that saved card is not showing

unkempt vapor
#

sounds right yes

sand flare
#

So for That we need to create customer Session ?

sand flare
unkempt vapor
#

I don't understand what your specific question is, sorry.

sand flare
#

I have an e-commerce site built with React,
and in the "My Account" section under the user's profile, I want to display the Stripe Payment Element form. The goal is to collect the user's card details and save them to their Stripe account for future use.

Here Is The Steps what i am Using

After landing to Account - Payment Section : Creating the Customer Session [To Show the Checkbox to save the Card]
then Creating the SetupIntent
On Click of Save button Confirming the Intent [via clientSeceret]

#

UI of My Site below

#

Are you there @unkempt vapor

unkempt vapor
#

yes. You didn't ask a question though so I was waiting for that.

sand flare
#

Above Approach i am Following is that correct or

#

I need to remove customerSession ?

unkempt vapor
#

I don't know because I don't know what your problem is that you're trying to fix.

#

generally a question would be like "here is what I'm trying to do, here is what I did, here is what I expected to see, here's what I saw instead" and you've only really included the first part.

unkempt vapor
#

please elaborate on what you expect to see and what you see instead.

sand flare
#

for SetupIntent also i need to create customer Session ?

#

to save the card

unkempt vapor
#

you never need to create a CustomerSession, it's an optional feature to add extra functionality like viewing existing saved cards.

sand flare
#

If i am not Creating the Session then I am Not Getting the checkBox in Payment Element form.

So The Card is Getting saved but for that allowRedisplay is unspecified because of that i am Not able to see the card in Saved Card what to do to avoid this ?

unkempt vapor
sand flare
#

Little Confused karl can you eleborate ?

unkempt vapor
#

sure, what part are you confused about specifically

sand flare
#

we already creating setupIntent using that automatically created payment method , then why to update the payment method for allow_redisplay why its not updating automatically

unkempt vapor
#

I guess it just doesn't, I don't know why it's designed that way. So if you want the PM to have allow_redisplay you can do the two options in my previous message.

sand flare
#

The Two Options Are bellow correct.

  1. customerSession
    2.updatePaymentMethod

any one of the above i can follow correct ?

unkempt vapor
#

yes

sand flare
#

Thanks karl

#

I'm facing another issue: we've enabled Amazon Pay from the dashboard, and I want to display it in the checkout process. However, I need to hide Amazon Pay in the "My Account" profile section. Could you help with that as well?

#

How can we Do that ?

unkempt vapor
#

you could create a PaymentMethodConfiguration that doesn't inclide AmazonPay and use that with the SetupIntent you create, instead of the default.

sand flare
#

getting below error

cunning kilnBOT
unkempt vapor
#

I didn't tell you to use payment_method_types:["card"], I told you to use PaymentMethodConfigurations, which would not lead to this error. That's why I said it.

sand flare
#

Sure, @unkempt vapor Iโ€™m checking that method. Thanks for the help!

sage grotto
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!