#moves-invoice-paymenturl
1 messages · Page 1 of 1 (latest)
@feral girder Mostly you can't and you have a real misunderstanding overall of our products (which is totally normal/fine)
is this even the right approach?
since checkout sessions generally handle everything
There's no way to use Checkout to pay an existing Invoice. But you can use the Hosted Invoice Page instead. Look at https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url which is a URL to that page
moves-invoice-paymenturl
i have this working, but the hosted page does not show the default payment method for the user, so the payment form pops up blank.
That is why I was trying to setup the checkout-session (with customer id) because that thing shows the default payment method.
is there a way, the hosted page shows the payment method on file for the customer?
No that's impossible
alright, can you point me in the right direction, if I were to let's say, collect payment on my app for the invoice?
without the hosted page
The Invoice has a PaymentIntent, that PaymentIntent has a client_secret and you can use that to render a payment page with PaymentElement: https://stripe.com/docs/payments/payment-element
PaymentElement does not handle existing/saved/default PaymentMethods though. You would have to build your own UI for this like what Amazon does where they show you the list of saved cards and you pick the one you want.
so i ready up the UI as per my requirements.
I get hold of the payment method id, i already have the client_secret for the payment_intent (invoice).
I should follow this guide right?
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements&client=react
passing payment_method in confirmParams for stripe.confirmPayment
sure, I'd say pause and try and see what happens!