wallet handling

This commit is contained in:
2026-06-15 11:25:10 +03:30
parent e9ddcacdb6
commit 81dfdbdb96
5 changed files with 30 additions and 22 deletions
@@ -47,8 +47,9 @@ class RequestsController extends Controller
$data['total_fee'] = $data['amount'] * $data['difference'];
$myCustomer = Customer::find($customer_id);
$wallet_interface = new WalletInterface($customer_id, 2);
$wallet = Wallet::where('owner', $customer_id)->whereNull('fund_id')->first();
$ownerType = (int) ($myCustomer?->type ?? 2);
$wallet_interface = new WalletInterface($customer_id, $ownerType);
$wallet = $wallet_interface->wallet;
$response = [];