Skip to content

[ubp] reset usage on chargebee cancellation #15362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Dec 15, 2022

Description

Creates a credit note for negative balance for users that are canceled (team slot or individual), so that those users start with a zero balance.

I've tested teamsubscription, teamsubscription2, individual subscription.

Related Issue(s)

Fixes #15055

How to test

  • create a team "Chargebee something" and sign up with chargebee
  • create usage with one of the team's users
  • cancel chargebee
  • verify the usage has been reset.

Note: the AddUsageCreditNote endpoint uses entire credits and can't handle creditcents. So if balance is 12.34 the credit note will be 12.

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-payment
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-sefftinge-ubp-handle-chargebee-15055.1 because the annotations in the pull request description changed
(with .werft/ from main)

@svenefftinge svenefftinge force-pushed the sefftinge/ubp-handle-chargebee-15055 branch 2 times, most recently from 1ba9010 to a5d366c Compare December 15, 2022 12:07
@svenefftinge svenefftinge force-pushed the sefftinge/ubp-handle-chargebee-15055 branch from a5d366c to e83cd4f Compare December 15, 2022 12:37
@svenefftinge svenefftinge marked this pull request as ready for review December 15, 2022 13:08
@svenefftinge svenefftinge requested review from a team December 15, 2022 13:08
@github-actions github-actions bot added team: SID team: webapp Issue belongs to the WebApp team labels Dec 15, 2022
Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! Code changes look good to me (modulo one nit), and they appear to work flawlessly! 🎯

I've tested:

  • Accruing usage (visible in /usage and the /billing balance)
  • Cancelling a Chargebee TeamSubscription2 -- worked flawlessly ✅
  • Cancelling a legacy Chargebee TeamSubscription (of which one seat was assigned to me) -- worked flawlessly ✅
  • Cancelling a personal Chargebee plan -- worked flawlessly ✅

Holding for one optional nit.

/hold

@svenefftinge
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 5c6a1af into main Dec 15, 2022
@roboquat roboquat deleted the sefftinge/ubp-handle-chargebee-15055 branch December 15, 2022 15:32
@roboquat roboquat added the deployed: webapp Meta team change is running in production label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production release-note-none size/L team: SID team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UBP] Handle Chargebee cancellations
4 participants