#fkaib
1 messages · Page 1 of 1 (latest)
Hello! Do you have a specific question?
yes so when the user tries to purchase a subscription, how do they select the payment method they want to use? is that what the ExpressCheckout is for?
In the Checkout page UI they'd see a bunch of payment method type options and they'd provider their payment details there
how do I display those UI? is there a specific component I should be using for this?
Sorry mixed up my threads there for a second
If you're using PaymentElement you'd see what I mentioned - the UI will have a bunch of tabs w/ each payment method type
The PaymentElemtn is meant to be used when you accept NEW payment methods
If you want a UI that shows your customer's existing payment methods you'd have to build your own or use somethign like the customer portal for managing those
When the user tries to purchase something, is there a way to automatically charge the card that has been added previously in the billing page?
Yes, you'd create a PaymentIntent and set payment_method to the payment method you want to use
so I can't do tripe.Subscription.create()? I'd have to create a payment intent?
Hello! I'm taking over and catching up...
hi
To summarize, are you asking if there's a Stripe UI component for displaying already-saved Payment Methods on your website?
yes.
and if not is there a way to automatically charge the payment method that the user has added in the past already?
Confirm.tsx:143 Error occurred while confirming payment: IntegrationError: Invalid value for stripe.confirmPayment(): elements should have a mounted Payment Element or Express Checkout Element.
at h (v3:1:425586)
at g.betas (v3:1:427508)
at y (v3:1:427878)
at v3:1:365450
This is the error I get when I use the code that I sent at the top.
There is no UI component for that, but you can build your own UI for it using the API.
To confirm a payment using an existing Payment Method you should use this: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method
that's exactly what I use. Not sure why I get this error
Sounds like you're passing in elements as well?
changing elements to clientSecret resolved the error I was getting earlier. However I'm getting a new error now:
shared-36a7a23d6f6ae10182102d1e91d95784.js:1 POST https://api.stripe.com/v1/payment_intents/pi_3Nb5WqEvUNDxHSmf10E4i4yn/confirm 400
Can you give me the request ID showing that error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_Ks0yukiy1niDM9
The error is accurate; you can't confirm a Payment Intent that doesn't have a Payment Method associated with it.
You need to specify the Payment Method to use to confirm it.
so I need to add a payment method inside stripe.Subscription.create()?