Refund stripe charges unassociated with funding - #939
Merged
Conversation
It is possible that we create captured Stripe charges,
but the transaction fails due to a database outage or other error,
and the suma side never commits.
We can detect this has happened by looking for charges which:
- Are captured,
- Have the expected metadata ('suma_funding_transaction_id'),
- Do not have a corresponding strategy row.
These charges can be refunded.
We track where this happens with a support ticket,
both to make sure it isn't common,
and because a user may reach out about the charge in the meantime.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #939 +/- ##
========================================
Coverage 99.78% 99.79%
========================================
Files 755 755
Lines 38071 38221 +150
========================================
+ Hits 37991 38141 +150
Misses 80 80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
It is possible we charged the user but lost the charge due to a DB failure. Before creating a new charge, look for an existing orphan charge.
rgalanakis
force-pushed
the
stripe-charge-refund-unassociated
branch
from
July 5, 2026 16:59
8f8c6eb to
0d3c8e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is possible that we create captured Stripe charges, but the transaction fails due to a database outage or other error, and the suma side never commits.
We can detect this has happened by looking for charges which:
These charges can be refunded.
We track where this happens with a support ticket, both to make sure it isn't common,
and because a user may reach out about the charge in the meantime.