From b524bf19686b1973d9fbf1986f27a37370cbdd89 Mon Sep 17 00:00:00 2001 From: mac Date: Tue, 24 Nov 2020 11:55:07 +0300 Subject: [PATCH] txn fix --- src/Services/WalletService.php | 2 +- src/Types/WalletTransactionType.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Services/WalletService.php b/src/Services/WalletService.php index 58d28b4..45ae391 100644 --- a/src/Services/WalletService.php +++ b/src/Services/WalletService.php @@ -25,7 +25,7 @@ public function create(WalletTransactionType $types) $wallet->balance = $wallet->balance + $types->getAmount(); $wallet->save(); } - $types->setTxn($wallet->id); + $types->setTxn(); return $wallet->transactions()->create($types->getAll()); } diff --git a/src/Types/WalletTransactionType.php b/src/Types/WalletTransactionType.php index 51f3c42..b538e9e 100644 --- a/src/Types/WalletTransactionType.php +++ b/src/Types/WalletTransactionType.php @@ -121,11 +121,11 @@ public function getTxn() } /** - * @param mixed $walletId + * @param mixed */ - public function setTxn($walletId) + public function setTxn() { - $this->txn = Hash::make($walletId.microtime()); + $this->txn = Str::random(32); } /** * @return array