Skip to content

Refund stripe charges unassociated with funding - #939

Merged
rgalanakis merged 2 commits into
mainfrom
stripe-charge-refund-unassociated
Jul 5, 2026
Merged

Refund stripe charges unassociated with funding#939
rgalanakis merged 2 commits into
mainfrom
stripe-charge-refund-unassociated

Conversation

@rgalanakis

Copy link
Copy Markdown
Member

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.

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

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.79%. Comparing base (57527f6) to head (0d3c8e7).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
rgalanakis force-pushed the stripe-charge-refund-unassociated branch from 8f8c6eb to 0d3c8e7 Compare July 5, 2026 16:59
@rgalanakis
rgalanakis merged commit a6a0db4 into main Jul 5, 2026
5 checks passed
@rgalanakis
rgalanakis deleted the stripe-charge-refund-unassociated branch July 5, 2026 18:18
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.

1 participant