Skip to content

Commit

Permalink
Fixing balance update
Browse files Browse the repository at this point in the history
  • Loading branch information
depsimon committed Feb 22, 2018
1 parent b12998e commit 64169a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function canWithdraw($amount)
*/
public function deposit($amount, $type = 'deposit', $meta = [])
{
$this->balance += $amount;
$this->wallet->balance += $amount;
$this->save();

$this->transactions()
Expand All @@ -71,7 +71,7 @@ public function withdraw($amount, $type = 'withdraw', $meta = [], $shouldAccept
$accepted = $shouldAccept ? $this->canWithdraw($amount) : true;

if ($accepted) {
$this->balance += $amount;
$this->wallet->balance += $amount;
$this->save();
}

Expand Down

0 comments on commit 64169a2

Please sign in to comment.