#omri-subscriptionschedules

1 messages · Page 1 of 1 (latest)

shell oyster
#

hello! you need to separate it into two requests. You can't update the phases at the same time you create a SubscriptionSchedule from an existing Subscription.

#
  1. create a SubscriptionSchedule from an existing Subscription
  2. Update the newly created SubscriptionSchedule
snow lance
#

thank you

#

I getting the error : You cannot migrate a subscription that is currently in the `incomplete` status. It must be in `active, past_due, unpaid, trialing` status to be released

#

how can I fix it?

shell oyster
#

you need to at least ensure the first invoice is paid

snow lance
#

I have to work with webhooks

#

?

shell oyster
#

yep, you should use webhooks to listen for changes to your Subscriptions

snow lance
#

which webhook event should I use?

shell oyster
#

have you implemented the relevant code to collect the PaymentMethod and pay the first payment for the Subscription yet?

snow lance
#

I create subscription like that:subscription = Stripe::Subscription.create({ customer: @customer.id, items: [{ price: price.id, }], payment_behavior: 'default_incomplete', payment_settings: {save_default_payment_method: 'on_subscription'}, expand: ['latest_invoice.payment_intent'] }, stripe_account: entity.stripe_uid)

shell oyster
#

and then create a Subscription Schedule from that Subscription

snow lance
#

ok, thank you..

#

but if the payment failed? how can I popup message to the user immediately?

shell oyster
snow lance
#

from the subscription object, how I know which invoice number is it?

uncut skiff
#

Hi! I'm taking over this thread.

snow lance
#

Hey

uncut skiff
snow lance
#

I mean how match invoice paid has to a certain subscription

uncut skiff
#

So for each invoice you can know the corresponding subscription.

snow lance
#

subscription property is the subscription_id string, I know

#

but how I know how match invoice.paid has to this subscription after I retrieve the subscription?

#

sorry

#

I mean to word much

#

how much invoice.paid?

uncut skiff
#

I'm sorry I'm not sure I understand. What exactly are you trying to do?

snow lance
#

English is not my native language

uncut skiff
#

You have a subscription ID, and you want to know how much the customer paid for the last invoice?

snow lance
#

no

#

how many times the customer paid, if this is the first time..

uncut skiff
snow lance
#

if invoice.billing_reason=subscription_create it is mean it is the first invoice of that subscription?

uncut skiff
#

That's correct!

snow lance
#

cool thank you

#

how can I create SubscriptionSchedule with quarterly or annually payment?

hazy osprey
#

what have you tried?

snow lance
#

not related to the previous issue we has before.
I need have option to create subscription with 3 differences interval payments, monthly, quarterly, annually

hazy osprey
#

there is a rich API for describing phases with various start and end dates and 'interations' to repeat a certain phase for a certain number of months. I don't know what a "quarterly or annually payment" means exactly but you can almost certainly do it, just experiment with some code and the API.

hazy osprey
#

so if you want something else like 'quarterly' you need to do more manual work like using trial periods to skip from one month to the end of a quarter or something

snow lance
#

how can I fix that: The subscription schedule update is missing at least one phase with a `start_date` to anchor end dates to ?

hazy osprey
hazy osprey
snow lance
#

Sory

#

req_BX91eSmopH6Pe1

hazy osprey
#

will look later, it's busy right now

#

as it says, you need a start_date

#

a good option is to try setting it to to the current_period_start value of the subscription you created the schedule from.

snow lance
#

thank you

torpid leaf
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!