#qaim
1 messages · Page 1 of 1 (latest)
Hi there, I'm afraid that the PaymentElement doesn't provide UI to show existing cards, you need to build one by yourself.
i dont want to show existing cards just populate the last used card
so the user doesnt hv to enter the card number and expiry again
cvv is fine
You don't need to ask the customer to enter again, Since you already have the card details, you can create an off-session charge from backend, and only ask your customer authenticate if a 3DS is required.
👍 not exactly what i needed but i will give it a try. But no way to prepopulate a PaymentElement or CardElement with a saved card?
The purpose of PaymentElement or CardElement is to collect card details from customer, so I don't think you need to use either of them if you already have the details
https://www.youtube.com/watch?v=HrqSXUzW7_w
this is stripe example on youtube
In this episode, you'll learn from Matt about how to prefill the card, with a previously saved card in Checkout, when a user returns to your site.
Presenter
Matthew Ling - Developer Advocate at Stripe - https://twitter.com/mattling_dev
Resources
Official client library: https://github.com/stripe/stripe-ruby
Official documentation:
h...
i want to do this with payment elemebt
We just have a single payment page used in various diffrent places so any additional logic outside of the payment page would need to be replicated 5 6 different places
I see, this is a Checkout page, and Checkout page can pre-populate the last used payment method for the same customer.
so with paymentElements we will hv to create a new ui, with list of cards and whichever user chooses we charge it from the backend
and no way to do it with paymentElement
Yes you are right.