#TheUchi007-subs

1 messages · Page 1 of 1 (latest)

sharp sparrow
#

Hello! Are you following any particular subscriptions docs to understand how that payment process works?

valid prairie
#

I am not following a guide, I am simply referring to the API docs

sharp sparrow
valid prairie
#

Hmmm I do it pretty much like that. The one thing I do see is:

payment_settings: { save_default_payment_method: 'on_subscription' }

#

Is that what I need to be able to re-use the payment method in order to make other purchases?

sharp sparrow
#

No, there isn't anything specific you need to do to re-use the payment method - once you finish collecting the payment information and confirm the payment intent, the payment method is automatically attached to the customer and can be used for other payments

valid prairie
#

ah really? I thought I needed an extra step. I do see that to retrieve it, I use:

stripe.paymentMethods.retrieve

However, I do still need the paymentMethodId. How do I retrieve that?

#

FYI, I am using stripe.customers.retrieve to get customer's info

sharp sparrow
valid prairie
#

Awesome, that's exactly what I was looking for, thank you!

#

one last question. If I wanted the user to add a new method(like a new CC) for different things(like one for the subscription, and another for normal payments), Do I just make the user re-fill the payment form and it will create a new one?

sharp sparrow
#

If you wanted to collect another Payment Method you'd likely need to create a SetupIntent, use that intent with the payment form to collect the information, and that will save the payment method to the customer (see https://stripe.com/docs/payments/save-and-reuse)

valid prairie
#

Awesome, thank you so much! I do have one very last question, I promise! So, on the sample you sent, it is exactly what I want. However, what if I am using CardNumberElement instead of PaymentElement? It saysthe PaymentElement provides the list to choose the payment method, but not sure about the other. Worst case, I'll moveto using PaymentElement, but I like the ability to control the look and position of the fields(well, on the borders and such at least)

sharp sparrow
valid prairie
#

Awesome, perfect. Thank you!

#

I really appreciate your help!