We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd24d05 commit 778ccdcCopy full SHA for 778ccdc
cloudflare-worker/src/routes/index.ts
@@ -2044,8 +2044,8 @@ const statsRoutes = (router: Router, env: Env) => {
2044
// Calculate total refunded amount
2045
const refundedAmount = userRefunds.reduce((total, refund) => total + refund.amount, 0);
2046
2047
- // Calculate the balance (difference)
2048
- const balance = purchasedAmount - refundedAmount;
+ // Calculate the balance (difference) credit/debit credit means that the user has refunded more than they purchased
+ const balance = refundedAmount - purchasedAmount ;
2049
2050
return new Response(
2051
JSON.stringify({
0 commit comments