#Elian Braja

1 messages · Page 1 of 1 (latest)

opal ospreyBOT
haughty spindle
#

I want to get the recurring interval type (month or year) and I can't when I have more than 1 subscription item. Why?

cold schooner
#

The plan property is a copy of the price property that is propagated to ensure legacy backwards compatibility. When you have more than one subscription item they both need to have the same recurring price interval.

haughty spindle
#

I do have the same recurring price interval

#

because otherwise the subscription cannot be created

#

is a must for the subscription creation to have same recurring interval for subscription items

#

so I do not see any point why plan type should be empty

cold schooner
#

Do you have an example request where you are trying to create a subscription with two items?

haughty spindle
#

yes I have but is nested in code. I just want to know hoe can I get the subscription interval from the subscription object?

cold schooner
#

The interval exists on the Price object

haughty spindle
#

so if I get at least the interval of one of the subscription item's price it will also be the interval of the overall subscription?

#

because we can only have same interval items on a subscription

#

is that correct?

cold schooner
#

Yes that is correct

haughty spindle
#

ok plase another question regarding webhooks

#

In the backend is it better to take actions directly after i get the response of Stripe::Subscription.create

#

or is it better to wait for the subscription.created event?

versed pilot
#

please let me know which option is better recomended

cold schooner
#

Creation of a Subscription is a synchronous event so you can take action after receiving a response when creating them. But we do recommend webhooks as a way to deal with processes that are asynchronous

versed pilot
#

got it. Ok thank you