Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
depsimon committed Aug 13, 2018
2 parents ef5e0dd + c600904 commit 9f147c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ public function actualBalance()
{
$credits = $this->wallet->transactions()
->whereIn('type', ['deposit', 'refund'])
->where('accepted', 1)
->sum('amount');

$debits = $this->wallet->transactions()
->whereIn('type', ['withdraw', 'payout'])
->where('accepted', 1)
->sum('amount');

return $credits - $debits;
}
}
}

0 comments on commit 9f147c8

Please sign in to comment.