Skip to content

Commit

Permalink
Add new balance transaction methods (#1423)
Browse files Browse the repository at this point in the history
* Add new balance transaction methods

* wip

* Update ManagesCustomer.php

Co-authored-by: Taylor Otwell <taylorotwell@gmail.com>
  • Loading branch information
driesvints and taylorotwell authored Aug 19, 2022
1 parent 1ca34f6 commit 4b91bc9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Concerns/ManagesCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,32 @@ public function balanceTransactions($limit = 10, array $options = [])
});
}

/**
* Credit a customer's balance.
*
* @param int $amount
* @param string|null $description
* @param array $options
* @return \Laravel\Cashier\CustomerBalanceTransaction
*/
public function creditBalance($amount, $description = null, array $options = [])
{
return $this->applyBalance(-$amount, $description, $options);
}

/**
* Debit a customer's balance.
*
* @param int $amount
* @param string|null $description
* @param array $options
* @return \Laravel\Cashier\CustomerBalanceTransaction
*/
public function debitBalance($amount, $description = null, array $options = [])
{
return $this->applyBalance($amount, $description, $options);
}

/**
* Apply a new amount to the customer's balance.
*
Expand Down

0 comments on commit 4b91bc9

Please sign in to comment.