Skip to content

Commit 291559c

Browse files
author
Babichev Maxim
committed
add trans
1 parent f8b5e1b commit 291559c

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.phpstorm.meta.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PHPSTORM_META {
44

5+
use Bavix\Wallet\Interfaces\Rateable;
56
use Bavix\Wallet\Models\Transaction;
67
use Bavix\Wallet\Models\Transfer;
78
use Bavix\Wallet\Models\Wallet;
@@ -18,6 +19,7 @@
1819
Wallet::class => Wallet::class,
1920
Transfer::class => Transfer::class,
2021
Transaction::class => Transaction::class,
22+
Rateable::class => Rateable::class,
2123
]));
2224

2325
}

resources/lang/en/errors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
'product_stock' => 'The product is out of stock',
66
'wallet_empty' => 'Wallet is empty',
77
'insufficient_funds' => 'Insufficient funds',
8+
'confirmed_invalid' => 'The translation has already been confirmed',
9+
'owner_invalid' => 'You are not the owner of the translation',
810
];

resources/lang/ru/errors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
'product_stock' => 'Товар отсутствует',
66
'wallet_empty' => 'Кошелёк пуст',
77
'insufficient_funds' => 'Недостаточно средств',
8+
'confirmed_invalid' => 'Перевод уже подтвержден',
9+
'owner_invalid' => 'Вы не владелец перевода',
810
];

resources/lang/zh-CN/errors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
'product_stock' => '库存不足',
66
'wallet_empty' => '钱包为空',
77
'insufficient_funds' => '余额不足',
8+
'confirmed_invalid' => '翻译已经确认',
9+
'owner_invalid' => '您不是翻译的所有者',
810
];

src/Traits/CanConfirm.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ public function forceConfirm(Transaction $transaction): bool
6969
->getWallet($self);
7070

7171
if ($transaction->confirmed) {
72-
throw new ConfirmedInvalid(); // todo
72+
throw new ConfirmedInvalid(trans('wallet::errors.confirmed_invalid'));
7373
}
7474

7575
if ($wallet->id !== $transaction->wallet_id) {
76-
throw new WalletOwnerInvalid(); // todo
76+
throw new WalletOwnerInvalid(trans('wallet::errors.owner_invalid'));
7777
}
7878

7979
return $transaction->update(['confirmed' => true]) &&

0 commit comments

Comments
 (0)