#adsaeed
1 messages · Page 1 of 1 (latest)
Yes you need to choose between direct API (ie. PaymentElement) vs Checkout
With Checkout the backend will be a bit different too. But generally Checkout is easier and recommended
It's just to create an URL and redirect
Our previous BE logics in the case of payment intent failture, price update during order is still in the process, refunds etc will remain the same?
Or would we have to implement these again as well?
You will need to implement new endpoint for BE
Does checkout allow the user to add/store/ manage multiple cards?
Can user choose primary/ default card?
No not really. That would requires custom integration via direct API (Payment Element)
How would be the flow like in that case? where do i choose between my cards as a useR?
To be able to choose the saved card you need to implement your own UI to render the saved cards.
Let's say first time I have your customer paid, you will have a Customer object with attached PaymentMethod Id
You list all Payment Methods attached to that Customer, in backend, then pass the array back to frontend, ie. those last4
Then in frontend, you display ****xxxx and let your customer choose, with some hidden field tighted to its PaymentMethod Id pm_xxx. Whenever they chose, you send the corresponding PaymentMethod Id back to your server to charge them
I see, thanks for explaining! in this case, there wouldn't be redirection to the checkout page?
Yes this is a different flow to Checkout
Alright! Thanks in your opinion the effort of implementing a new endpoint for BE and switching to API - what's the effort like?