#juchom_api

1 messages ¡ Page 1 of 1 (latest)

torn ruinBOT
#

👋 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/1386762785945420048

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

misty grotto
#

Hello,

I'm updating my dotnet solutions and I have a bunch of errors due to breaking changes.

I didn't find any migration guide, could you please help me fix this issues please

rocky thicket
#

Hi there, I'll be with you in a few minutes

#

Are you moving to 48.2.0?

misty grotto
#

yes

#

moving from 47.4

rocky thicket
misty grotto
#

I have read this docs, but there is not clear way on how we did before and how we have to do now

#

For exemple the following object Invoice had a PaymentIntentId, where am I supposed to find it now ?

rocky thicket
misty grotto
#

InvoiceSubscriptionItemOptions object does not exist anymore in the SDK, what am I supposed to use instead ?

rocky thicket
#

Could you give me more context on what you do with InvoiceSubscriptionItemOptions? I'm less familiar with the dotnet sdk but I'm sure this is related to another one of the breaking changes

misty grotto
#

Sure, here is what I do

public async ValueTask<SubscriptionQuote> GetQuote(string subscriptionId, long requestedSeats)
{
    var prorationDate = DateTime.UtcNow;
    var subscriptionService = new SubscriptionService();
    var subscription = await subscriptionService.GetAsync(subscriptionId);

    var itemInfo = subscription.Items.Data[0];

    var items = new List<InvoiceSubscriptionItemOptions>
    {
        new() { Id = itemInfo.Id, Price = itemInfo.Price.Id, Quantity = requestedSeats }
    };


    long actualSeats = itemInfo.Quantity;
    decimal nextInvoicePrice = (Convert.ToDecimal(itemInfo.Price.UnitAmount!.Value) * requestedSeats) / 100;

    // Proration price only happens when we request more seats than the actual number of seats;
    decimal? prorationPrice = null;

    if (requestedSeats > actualSeats)
    {
        var options = new UpcomingInvoiceOptions
        {
            Customer = subscription.CustomerId,
            Subscription = subscriptionId,
            SubscriptionItems = items,
            SubscriptionProrationBehavior = "always_invoice",
            SubscriptionProrationDate = prorationDate
        };

        var invoiceService = new InvoiceService();
        var invoiceDraft = await invoiceService.UpcomingAsync(options);

        prorationPrice = (Convert.ToDecimal(invoiceDraft.AmountDue) / 100);
    }

Actually when a customer want to change the number of seats, we first give him a quote

#

InvoiceSubscriptionItemOptions and InvoiceSubscriptionItemOptions and UpcomingAsync have been removed

rocky thicket
#

looking

torn ruinBOT
tardy falcon
#

Hello
I'm taking over here
Catching up

misty grotto
#

hello

#

ok

#

I will check these two docs and see how things are going