Skip to content

Commit d4bc8e1

Browse files
authored
[Dashboard] Fix Stripe balance calculation in getStripeBalance function (#7269)
1 parent 4edf1eb commit d4bc8e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/dashboard/src/@/actions/stripe-actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ export async function getStripeBalance(customerId: string) {
6969
if (customer.deleted) {
7070
return 0;
7171
}
72-
// Stripe returns a positive balance for credits, so we need to multiply by -1 to get the actual balance (as long as the balance is not 0)
73-
return customer.balance === 0 ? 0 : customer.balance * -1;
72+
// Stripe returns a positive balance for credits, so we need to divide by -100 to get the actual balance (as long as the balance is not 0)
73+
return customer.balance === 0 ? 0 : customer.balance / -100;
7474
}

0 commit comments

Comments
 (0)