#neil-subscription
1 messages · Page 1 of 1 (latest)
Thanks! I guess the question boils down to "how do i confirm payment of a subscription using an existing payment method?"
is your subscription's collection_method set to automatically_charge?
let me see
do you have the subscription id? or the request id of the subscription creation? here's how you can find it https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Yeah subscription is set to the default charge_automatically
And yes i do have the subscription id
would be great if you could share it please
oh i'm sorry, i'm just in my test environment
when the subscription is set to automatically charge the payment method, there's no need for you to confirm the payment intent
I don't see the issue
Oh interesting. The subscription integration guide at this link says I should confirm payment
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment
Use stripe.confirmPayment to complete the payment using details from the Payment Element and activate the subscription. This creates a PaymentMethod and confirms the incomplete Subscription’s first PaymentIntent, causing a charge to be made. If Strong Customer Authentication (SCA) is required for the payment, the Payment Element handles the authentication process before confirming the PaymentIntent.
this is in the case where you're not passing a default_payment_method
i see! thank you!
basically for paying an invoice we look for the following defaults, in the following order, and use the first one we come across (as long as it’s compatible with the Subscription/Invoice):
- The Invoice’s default_payment_method
- The Invoice’s default_source
- The Subscription’s default_payment_method
- The Subscription’s default_source
- The Customer’s invoice_settings.default_payment_method
- The Customer’s default_source
if none of those are set, then you could get the latest_invoice.payment_intent.client_secret and pass it to the Stripe Elements on the front-end to gather the payment info
so when you create the Subscription you can expand on latest_invoice.payment_intent to get the client_secret
Got it. Great summary, thank you
last thing to add
when you do so, you can use this param https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method to tell the payment_intent that once the payment_method is gather to be saved on_subcription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and this will make the upcoming invoices use that same payment method
I think I covered it all now 🙈
ok perfect. I appreciate the help