#hassan-schedule-future
1 messages · Page 1 of 1 (latest)
Hi 👋 sorry, this is pretty vague, and Subscription Schedules are pretty complex, so I'm not really sure what to suggest without getting more context on what you're trying to do.
Can you elaborate on what you're trying to accomplish, what you've tried so far, and why that didn't meet your needs?
The way i currently was doing subscriptions is to retireve the setup intent or payment intent from a subscription. I updated my code to subscription schedule, adding a phase and other stuff, but dont know how to allow the user to authorise (setup intent or payment intent)
and the reason i need schedules is subscription pro-rates the amount at end of period. I dont want that
this is what i got now. It does this as soon as user goes to checkout page on my charity website
Do you have an example of how you're creating the Subscription Schedule? If you want a Subscription to cancel at the end of a specific period, using a Subscription Schedule is likely the right approach.
I dont have an example to hand as i removed what i wrote, but basically what I want is the following:
- The code creates a new subscription schedule
- Return a payment intent or setup intent (this is based on if the user is already within the timeframe of the event. The event lasts 10 days. So some users sign up before start date, others after start date)
- The user now sees a checkout form to complete their card details
- Subscription schedule is created. Those who signed up before the event start date will wait until first payment is taken out. Those who signed up after start date will see a payment coming out and the next period it should take it out 9pm GMT)
- Subscription schdeule and Subscription is cancelled on the end date
I only managed to do number 1 in the above
Do you know how I can retrieve a payment intent or setup intent straight away after creating a subscription schedule?
OR alternatively, could you give me a stratgey on how other companies do this? I might be missing something here. The docs do not explain how to actually integrate subscription schedules.
Depends on how you created the Subscription Schedule, which is why I was hoping to see how you were doing that. If you're setting start_date to something in the future, then that Subscription Schedule won't immediately create a Subscription and therefore won't generate associated intents.
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-start_date
If they are creating Subscriptions immediately, then you can find the ID of the associated Subscription in the Subscription Schedule's subscription field:
https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-subscription
You can then find the associated intent per usual for that Subscription.
Ah interesting. Il try that. So it seems it's possible to get the intent to process to the stripe JS library. Thank you
How do I deal with the case where I want to add a user to a schedule but with a future start date. I also want to capture their payment method at the same time
You first need to create a Customer for them, and collect payment method details for future usage.
Several flows for setting up payment methods can be found here:
https://stripe.com/docs/payments/save-and-reuse
Create customer > collect PM for future payments> then create subscription schedule and attach the payment method and customer.
Can I create the subscription schedule in advance and then after I collect payment method, update the schedule with it
Yup, should be able to do that.
hassan-schedule-future
I have some cases where I need to take payment from user as soon as they setup a payment method. Am I able to charge in a server after I process a webhook