diff --git a/app/Services/Qr/QrCodeManagerService.php b/app/Services/Qr/QrCodeManagerService.php index f2faee3..b76bdea 100644 --- a/app/Services/Qr/QrCodeManagerService.php +++ b/app/Services/Qr/QrCodeManagerService.php @@ -35,12 +35,12 @@ class QrCodeManagerService public function create(User $user, array $data): QrCode { $wallet = $this->walletFor($user); + $type = (string) ($data['type'] ?? ''); if ($type !== QrCode::TYPE_PAYMENT && ! $wallet->canCreateQr()) { throw new RuntimeException('Add at least GHS ' . number_format(QrWallet::pricePerQr(), 2) . ' to your QR wallet before creating codes.'); } - $type = (string) ($data['type'] ?? ''); $validated = $this->payloadValidator->validateForCreate($type, $data); $style = $type === QrCode::TYPE_PAYMENT ? QrStyleDefaults::defaults()