#coach-leyton_api

1 messages ¡ Page 1 of 1 (latest)

dim swiftBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217285875176706128

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

warm kite
#

test

midnight craneBOT
elder jetty
#

hello! are you upgrading to a new version?

warm kite
#

Hi! technically yes. Starting a new code-base and this new-version will have access to the new version of the API

#

Will my old code (On the old code-base, using the old version of the Stripe .NET library) still operate as normal? Or must it be updated?

elder jetty
#

your old code will still work. We do generally always recommend upgrading to the latest version so you have access to newer features

warm kite
#

That's good news

#

In my new project, I'm using the newer version of the Stripe .NET library, and therefore it's more up-to-date with the current latest API. How does the removal of the "recurring" option within a price update change things for me? I can't even remember what it did tbh

#

For example, here's the old code:

await _stripePriceService.UpdateAsync(price.Id, new Stripe.PriceUpdateOptions()
{
    Active = plan.Active,
    Recurring = new Stripe.PriceRecurringOptions() 
    { 
        TrialPeriodDays = plan.TrialPeriodDays    
    }
}, null, cancellationToken);

I can't remember why I ever needed to specify a "Recurring" object there

elder jetty
#

Remove support for recurring on Price#update - there's no replacement for this. We no longer allow updating the Price's recurring data after it's been created via the API. Really though, if you need to change the Price, you should ideally create a new Price

warm kite
#

wait, you don't allow the updating of a price at all?

elder jetty
#

sorry, we allow you to update certain parameters

#

but not whether it's recurring

warm kite
#

What does it mean for a price to "recur" again? Isn't it the Subscription that manages the frequency of payments?

#

Or does that information (for example, monthly or annually) exist on the Price itself, and the Subscription just uses a particular Price, and charges the customer at the interval specified by the Price?

#

if that makes sense, and wasn't rambling nonsense

elder jetty
warm kite
#

I seeeeeee

#

and those subscription line-items can be a list of items, where some may use a one-time price, and some may be a recurring price?

#

so for example, I could specify two line items when creating a subcription. One for a one-time sign-up fee, and then another for a recurring subscription fee

elder jetty
#

well, you only can pass in recurring prices here : https://docs.stripe.com/api/subscriptions/create#create_subscription-items, you pass in one-time prices here : https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items

In essence though, yes, you can specify two line items when creating a subcription. One for a one-time sign-up fee, and then another for a recurring subscription fee

warm kite
#

One last thing, if I ever wanted to update the trialPeriodDays of a price, the approach now is to archive it, and make a new one?

elder jetty
warm kite
#

why would the API allow to specify the trialPeriodDays on the Price and the Subscription at the same time?

#

I presume the trialPeriodDays on the Subscription overrides the one on the Price if they're both specified and have different values?

elder jetty
#

I presume the trialPeriodDays on the Subscription overrides the one on the Price if they're both specified and have different values?

Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See Using trial periods on subscriptions to learn more.

why would the API allow to specify the trialPeriodDays on the Price and the Subscription at the same time?

We don't recommend setting the trialPeriodDays on the Price. If you look at the Price object in the API docs, it no longer has trialPeriodDays : https://docs.stripe.com/api/prices/create

warm kite
#

I see. Cool, thank you for your help!