#davethecust
1 messages · Page 1 of 1 (latest)
Hello! Typically when a Customer has an incomplete Subscription you would have them attempt to pay that Subscription's Invoice instead of creating another Subscription for them.
using stripe node library these are the arguments i'm passing into subscription create
customer: customerID,
off_session: true,
items: [
{
price,
},
],
trial_period_days: 0,
payment_behavior: "default_incomplete",
});
hmmm
so we'd need to bring back the existing subscription and force an invoice payment?
I would say attempt instead of force, but yeah. 🙂
What do you mean?
i am not sure i am following how to trigger an invoice for an existing canceled subscription
or even what resource would be called to make this happen
Are you doing client-side confirmation?
we use stripe elements to process the initial payment for the subscription
and then create a subscription on the backend
i can share with you some customerids or something if it's helpful
Okay, so every Subscription creates Invoices, and every Invoice creates a Payment Intent. You can confirm that Payment Intent like any other.
So if you're using Stripe Elements, you can pass the Payment Intent's client secret to your frontend and have them pay/confirm it to get the Subscription going.
Subscriptions have a latest_invoice property: https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice
Invoices have a payment_intent property: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
ohhh
ok ok i think it's becoming more clear to me
so i need to grab the invoice and actually confirm it at the time of subscription creation NOT at the setup intent time or do i have that backwards?
It sounds like you might be creating a standalone Payment Intent now, taking payment, then creating a Subscription after that?
Is that correct?
i think that's correct but instead of payment intent i believe i am creating a setup intent
Yeah, that's not correct. Do people pay up front for your Subscriptions or is there a trial period?
there's a trial period
unless they are returning users i.e. they cancel and come back, they should be charged immediately
Okay, so when you create a Subscription it has a pending_setup_intent it creates for you: https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
So create the Subscription first, then confirm that pending_setup_intent to set up their payment info for use when the trial is over.
Or, if you're taking an initial payment, confirm the Payment Intent associated with the Subscription's Invoice.