Skip to content

Fix Stripe.net v51 breaking API changes#87

Merged
NickLetts2 merged 2 commits into
mainfrom
copilot/fix-errors-after-upgrade
Apr 12, 2026
Merged

Fix Stripe.net v51 breaking API changes#87
NickLetts2 merged 2 commits into
mainfrom
copilot/fix-errors-after-upgrade

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Stripe.net 51.0.0 (API version 2026-03-25.dahlia) removed three properties used in StripeService, causing build failures after the version bump in #78.

Breaking changes addressed

  • Subscription.CurrentPeriodEnd removed — moved to SubscriptionItem. ResolveCurrentPeriodEnd now reads from the first item, retaining the raw JSON fallback:

    var firstItem = sub.Items?.Data?.FirstOrDefault();
    var itemPeriodEnd = new DateTimeOffset(firstItem.CurrentPeriodEnd, TimeSpan.Zero);
  • Invoice.SubscriptionId removed — restructured under Invoice.Parent. Updated MapInvoicePaymentFailedEvent:

    invoice.Parent?.SubscriptionDetails?.SubscriptionId
  • Invoice.ChargeId removed — charges now live in the Invoice.Payments collection. CreateRefundAsync expands data.payments and selects the paid charge:

    Expand = ["data.payments"],
    // ...
    latestInvoice.Payments?.Data
        ?.FirstOrDefault(p => p.Status == "paid" && p.Payment?.ChargeId is not null)
        ?.Payment?.ChargeId

    Filtering by Status == "paid" avoids selecting a charge from a prior failed payment attempt.

@NickLetts2 NickLetts2 marked this pull request as ready for review April 12, 2026 21:29
@NickLetts2 NickLetts2 merged commit 7c7bcf9 into main Apr 12, 2026
5 checks passed
@NickLetts2 NickLetts2 deleted the copilot/fix-errors-after-upgrade branch April 15, 2026 07:59
NickLetts2 added a commit that referenced this pull request Jun 1, 2026
* chore: update Stripe.net from 47.* to 51.* with breaking change fixes

Agent-Logs-Url: https://github.com/NickLetts2/Curvit/sessions/06233414-0726-49ab-9939-932032bc3418

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>

* fix: address Stripe.net v51 breaking changes in StripeService

Agent-Logs-Url: https://github.com/NickLetts2/Curvit/sessions/06233414-0726-49ab-9939-932032bc3418

Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants