diff --git a/src/app/Http/Controllers/API/V4/Admin/UsersController.php b/src/app/Http/Controllers/API/V4/Admin/UsersController.php --- a/src/app/Http/Controllers/API/V4/Admin/UsersController.php +++ b/src/app/Http/Controllers/API/V4/Admin/UsersController.php @@ -90,6 +90,31 @@ $result->push($owner); } } + // A mollie customer ID + } elseif (substr($search, 0, 4) == 'cst_') { + $setting = \App\WalletSetting::where( + [ + 'key' => 'mollie_id', + 'value' => $search + ] + )->first(); + + if ($setting) { + if ($setting->wallet()) { + if ($owner = $wallet->owner()->withTrashed()->first()) { + $result->push($owner); + } + } + } + // A mollie transaction ID + } elseif (substr($search, 0, 3) == 'tr_') { + $payment = \App\Payment::find($search); + + if ($payment) { + if ($owner = $payment->wallet()->owner()->withTrashed()->first()) { + $result->push($owner); + } + } } elseif (!empty($search)) { $wallet = Wallet::find($search);