stripe-payments

Stripe .NET There is no PaymentIntent.ClientSecret On Subscription Object


subscription.LatestInvoice.PaymentIntent.ClientSecret is not available as a property

enter image description here

I have added expands but the property is not available in the model for some reason.

Stripe Version used

<PackageReference Include="Stripe.net" Version="48.5.0" />

EDIT: adding example url

https://github.com/stripe-samples/subscription-use-cases/blob/main/fixed-price-subscriptions/server/dotnet/Controllers/BillingController.cs


Solution

  • Version 48.5.0 of the .NET library is pinned to API version 2025-08-27.basil[0]. This means that all requests initiated by the SDK use that API version by setting the version header[1], which overrides your account’s default API version. Effectively, this means that all requests made with that SDK version use that API version.

    API version 2025-03-31.basil introduced a breaking change[2], which removed the payment_intent field from the Invoice object (due to the introduction of support for multiple partial Invoice Payments).

    For API versions 2025-03-31.basil, and later, the first PaymentIntent's client_secret can now be accessed from the Invoice object in invoice.confirmation_secret.client_secret [3]. You should use this instead of invoice.payment_intent.client_secret.

    [0] https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md#4850---2025-08-27

    [1] https://docs.stripe.com/api/versioning

    [2] https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices

    [3]https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#use-for-payment-element-integrations