Prefill business QR creation from CRM contact links.
Deploy Ladill QR Plus / deploy (push) Successful in 51s
Deploy Ladill QR Plus / deploy (push) Successful in 51s
Decode CRM prefill tokens so contact name, phone, email, and address carry into QR Plus. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -73,6 +73,12 @@ class QrCodeController extends Controller
|
||||
$wallet = $this->manager->walletFor($account);
|
||||
$qrSettings = $account->getOrCreateQrSetting();
|
||||
|
||||
$prefill = \App\Support\CrmPrefillCodec::decode($request->query('prefill'));
|
||||
$defaultType = $qrSettings->resolvedDefaultType();
|
||||
if (($prefill['kind'] ?? null) === 'qr_business' && ! empty($prefill['type'])) {
|
||||
$defaultType = (string) $prefill['type'];
|
||||
}
|
||||
|
||||
return view('qr-codes.create', [
|
||||
'wallet' => $wallet,
|
||||
'types' => QrTypeCatalog::all(),
|
||||
@@ -84,8 +90,9 @@ class QrCodeController extends Controller
|
||||
'minTopup' => QrWallet::minTopupGhs(),
|
||||
'ladillWalletBalance' => $this->platformBilling->balanceMinor($account->public_id) / 100,
|
||||
'topupUrl' => 'https://'.config('app.account_domain').'/wallet',
|
||||
'defaultType' => $qrSettings->resolvedDefaultType(),
|
||||
'defaultType' => $defaultType,
|
||||
'accountDefaultStyle' => $qrSettings->resolvedDefaultStyle(),
|
||||
'prefill' => ($prefill['kind'] ?? null) === 'qr_business' ? $prefill : null,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user