#geimsdin-SubscriptionSchedule

1 messages ยท Page 1 of 1 (latest)

woeful harbor
#

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?

pastel swan
#

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

woeful harbor
#

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

pastel swan
#

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.

flint reef
#

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.

pastel swan
#

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

flint reef
#

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.

pastel swan
#

I will try and let you know, thanks a lot Jack ๐Ÿ‘

pastel swan
#

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?

flint reef
#

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.

pastel swan
#

With setup intent the payment is collected directly? Or will be the subscription that will collect also the first payment?

flint reef
#

The SetupIntent will collect the payment method and attach it to the customer.

#

Why do you want to collect again with subscription?

pastel swan
#

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

flint reef
#

No, you just need to collect the payment method once, and use it for all 6 recurring payments of the subscription.

pastel swan
#

Then the payment method doesn't charge

flint reef
#

No need to change.

pastel swan
#

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

flint reef
#

Sorry I don't understand what you mean by payment method doesn't charge

pastel swan
#

Sorry, I mean the SetupIntent will only collect payment data without charging the customer.

flint reef
#

Yes you are right

pastel swan
#

And you are very kind and competent, thanks Jack

flint reef
#

No problem!

pastel swan
#

I will work this way

#

In case I have problems you will see me in Discord again ๐Ÿ™‚

flint reef
#

Sure thing ๐Ÿ™‚ Looking forward to seeing you again!