#geimsdin-SubscriptionSchedule
1 messages ยท Page 1 of 1 (latest)
Hi, I think you mixed up quite a few things here. Subscription Schedule is a different thing than Subscription, and Checkout is also another thing
What are you trying to achieve specifically?
Sorry, I was not clear: in my ecommerce I have a checkout page (not stripe checkout), I want to offer monthly payments using Stripe scheduled subscriptions. I created the Products, Prices, Customers but I don't know how to collect the payment data through the paymentElement and connect that to the SubscriptionSchedule.
I hope I'm clear now
It sounds like you want a normal Subscription. You don't seem to need Subscription Schedule
If you only collect monthly payment, then Subscription that is. Subscription Schedule is for some fancy / custom setup, like you want 1 month with a price, then 3 weeks with another price, then 5 weeks with another different prices
So you want this basically https://stripe.com/docs/billing/subscriptions/build-subscriptions
As far as I understand subscriptionSchedule is what I need because I use it only to split a product price in 3, 6, 9 or 12 installments. Once the total amount is reached I terminate the subscription. Can I achieve the same with subscription object?
And I would like to collect the payment data in my website without redirecting to stripe, seems like with any kind of subscription that is not possible.
Hi @pastel swan I'm taking over this thread
You can achieve it with Subscriptions API, but you need to manually cancel the Subscription when all installments end.
Alternatively you can use Subscription schedule to end the subscription at a specific time.
Hi Jack, ok understand. I believe it is better to rely on your code and use Subscription schedule. Can you tell me if I can collect the payment for the first installment using a Paymentelement and then attach it to the subscription for the recurring payments? I would like to avoid to redirect the customer to stripe for the payment
Yes, you can specify a default_payement_method (https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-default_payment_method)m and set collection_method (https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-collection_method) to charge_automatically when creating a subscription schudle, and Stripe will use this payment method to attempt payments.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I will try and let you know, thanks a lot Jack ๐
I did go through documentation thanks to your hints, please correct me if I'm wrong, the process should be as follows:
1 - On my checkout page I create a PaymentElement that will collect the first payment
2 - As soon as Stripe confirm that the payment is succesful I create a subscription specifying in the Phase as default_payment the payment_id I just used and set the collection_method as "charge_automatically"
3 - The next cycle (1 month in my case), Stripe will automatically try to charge the same payment method using the data collected for the first payment
Am I correct?
For Step 1, I'll suggest to use SetupIntent to collect the payment method, because you don't have the PaymentIntent at this moment as the subscription(and the associated invoice) is not yet created.
I agree with Step 2 and 3. You should also listen to webhook events to handle (https://stripe.com/docs/billing/subscriptions/webhooks#additional-action) when an invoice's PaymentIntent becomes requires_action.
With setup intent the payment is collected directly? Or will be the subscription that will collect also the first payment?
The SetupIntent will collect the payment method and attach it to the customer.
Why do you want to collect again with subscription?
Let's try with a real example: my product will be sold in 6 installments,
SetupIntent will collect the first and I setup the subscription to collect the other 5. Is that right?
1 every month
No, you just need to collect the payment method once, and use it for all 6 recurring payments of the subscription.
Then the payment method doesn't charge
No need to change.
The subscription will still be of 6 iteration starting now
Then I just collect from webhook to know if the first one (and the next) was succesful
"charge", not change
Sorry I don't understand what you mean by payment method doesn't charge
Sorry, I mean the SetupIntent will only collect payment data without charging the customer.
Yes you are right
And you are very kind and competent, thanks Jack
No problem!
Sure thing ๐ Looking forward to seeing you again!