#muzzamil

1 messages · Page 1 of 1 (latest)

fleet shoalBOT
solid garden
#

hi! what part isn't working exactly?

#

that code you posted looks like it will create a PaymentIntent that, when you accept a payment with it, will save the payment method used to the Customer ID you are using; so that seem good.

upper sequoia
#

first time payment is working fine but if i want to use the saved card person it will not work for them

#

suppose if i checkout for the first time what i need is to save my card details so if i come next time then it should have my card details that part is missing

solid garden
solid garden
upper sequoia
#

I did create the PaymentSheet but it not showing the saved card details

solid garden
#

are you using the same Customer ID that you previously saved cards to?

upper sequoia
#

no that part i wanted to know

#

who should i get the customer id

solid garden
#

you need to authenticate the user

#

so for example the customer logs into some account in your app before getting to the payment pages. In your databases where you manage user accounts, you store the cus_xxx ID. When the app sends a request to the backend, you look up the authenticated user and select the cus_xxxx for them

upper sequoia
#

for now i'm not using the Authentication is there any other way to do it

#

without authentication

solid garden
#

not really no

#

you need to know who the user is so you can select the right cus_xxx

upper sequoia
#

actually i've guest section the users are not authenticated so how do i create saving card features for them

solid garden
#

well you wouldn't, if they're guests then you wouldn't save the card