From cb1945ac31717b7be1817a73a3a0b4e766453dc7 Mon Sep 17 00:00:00 2001 From: Babichev Maxim Date: Sun, 12 May 2019 22:02:12 +0300 Subject: [PATCH 1/2] add abs --- src/Traits/HasWallet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/HasWallet.php b/src/Traits/HasWallet.php index 88affe156..1e72b4275 100644 --- a/src/Traits/HasWallet.php +++ b/src/Traits/HasWallet.php @@ -190,7 +190,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $ 'from_id' => $this->getKey(), 'to_type' => $wallet->getMorphClass(), 'to_id' => $wallet->getKey(), - 'fee' => $withdraw->amount - $deposit->amount, + 'fee' => \abs($withdraw->amount) - \abs($deposit->amount), 'uuid' => Uuid::uuid4()->toString(), ]); } From 6cea7b97ccbb57d5298ea5a61fa223a79c3baf2e Mon Sep 17 00:00:00 2001 From: Babichev Maxim Date: Sun, 12 May 2019 22:04:06 +0300 Subject: [PATCH 2/2] add changelog --- changelog.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 4d9634f4a..23a8b30b7 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.2] - 2019-05-12 +### Fixed +- fixed fee counting. see issue #25 ## [2.2.1] - 2019-02-17 ### Added @@ -199,7 +202,8 @@ The operation is now executed in the transaction and updates the new `refund` fi - Exceptions: AmountInvalid, BalanceIsEmpty. - Models: Transfer, Transaction. -[Unreleased]: https://github.com/bavix/laravel-wallet/compare/2.2.1...HEAD +[Unreleased]: https://github.com/bavix/laravel-wallet/compare/2.2.2...HEAD +[2.2.2]: https://github.com/bavix/laravel-wallet/compare/2.2.1...2.2.2 [2.2.1]: https://github.com/bavix/laravel-wallet/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/bavix/laravel-wallet/compare/2.1.0...2.2.0 [2.1.0]: https://github.com/bavix/laravel-wallet/compare/2.0.1...2.1.0