#paul-paymentelement-subscription

1 messages ยท Page 1 of 1 (latest)

tough roseBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

warped egret
#

paul-paymentelement-subscription

#

๐Ÿ‘‹ Hey Paul! Sorry this is a bit confusingly worried and it shows you're quite lost overall with our products and set up (which is totally normal)

What are you really trying to do exactly? Do you have an existing Subscription and the Customer wants to enter new card details and then use that new card for the Subscription? Or something else?

lament zephyr
#

Thank you for your understanding & empathy. I currently use a BillingPortal configuration to allow the user to add/edit payment methods for their subscription. I want to change this to allow them to update their payment methods in the app without any redirects to an external page ๐Ÿ™‚

tough roseBOT
storm thunder
#

Hello, stepping in as koopajah has to leave soon. If you are looking to implement your own custom form to save card details for existing users, the PaymentElement does sound like the right fit. In this case you would create a new SetupIntent using the existing Customer's ID.

#

And once the intent is confirmed you would set the newly created payment method as the customer's default payment method by updating their invoice_settings[default_payment_method] property https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method

lament zephyr
#

So it sounds like I will have to create a new SetupIntent each time the client decides to update their payment method. What happens if the client decides midway not to finish updating their payment method? Does the SetupIntent get deleted automatically after sometime? Or should I retrieve the latest created SetupItnent for this user the next time they decide to update their payment method?

storm thunder
#

Intents don't get automatically deleted, their lifespan is indefinite as long as they don't succeed or manually get deleted

#

So that may be better in your situation

lament zephyr
#

Is it a requirement to have a SetupIntent to use the PaymentElement? Is it possible to use it without a SetupIntent?

storm thunder
#

In that doc that I just sent it shows how to initiate the payment element without an intent

#

You will need a SetupIntent at some point to save these new PaymentMethods properly, but you don't need one to initially render the payment element

lament zephyr
#

Ah sorry, I meant to ask if I can save the payment method to the subscription without a SetupItntent, but I guess you answered that question as well

storm thunder
#

Yep, so you will want a SetupIntent to manage things like 3DS

lament zephyr
#

Is it best practice to delete an existing payment method and add a new one as opposed to updating an existing payment method? Asking because this seems to be the only option in the BillingPortal

storm thunder
#

Yep, that is actually what the customer portal does behind the scenes

#

Actually it may not do the deleting part, it may just add the payment method. But that is the basic concept

lament zephyr
#

Is there a way to delete a payment method? I don't see a way to delete a SetupIntent or a PaymentMethod

storm thunder
lament zephyr
#

I see! Thank you so much for your help ๐Ÿ™‚

storm thunder
#

You would tokenize their info into a PaymentMethod object, pass the PM to your server, and confirm a SetupIntent with that PM