На данном шаге можно получить QR-код по уникальному идентификатору запроса. Шаг является опциональным, поскольку все необходимые данные можно получить в Шаге 2 - Формирование запроса.
GET
/api/requests/qr-code/acba8198-92d9-4297-905f-eb55ea69f9c4
где:
id
- уникальный идентификатор документа из шага 2.
{
"uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAADSCAIAAACw+wkVAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAG6ElEQVR4nO3d227jOBBF0c5g/v+XM2+GGjBbLFcdbk1nr0eDluTkgChQvHx9f3//ks76h34A/UTGTgBjJ4CxE8DYCWDsBPj37adfX1/jd1qN1Ozc6/rdavuq6/VX9925/sm/4eq+O3/z6t+26u0z2NsJYOwEMHYCvK/trqbqpJ3Pq7VI9b5TOvVl9bd07tv5OyT+7y/2dgIYOwGMnQD3td3V1JhZtW7YGT/r1EwdiRqo+ruubRJjcuNjpfZ2Ahg7AYydALXabkpn/Ika69pps/Oc1XfTifoVX8lgbyeAsRPA2AnA1HZT40/Xzztz8nbaV98vV5+hU19Wv4uztxPA2Alg7ASo1XZT9UFiHli1HkqMk02NL54cR9wxXhfa2wlg7AQwdgLc13bpdQmduXSduWWduWhTNd/U51dTNV/0/25vJ4CxE8DYCfD1qFd16Vqts8Z2an1u4t3ro/6JO+ztBDB2Ahg7Ad7XdlPvTBN70Z2sddLvjhPrQjrSY4ov9nYCGDsBjJ0AtdousSdw5zpXJ8fkpsbeqveqttlxcn3ui72dAMZOAGMnwPzexYn6qaozf24lvY51dZ3Vc07da2Xqmp5LoacwdgIYOwHe13aJuWXV61T3OqHqwvRct/Ra3c463I9/u72dAMZOAGMnwP1aiqmxoievdTj5jjgxHpbe6258r2l7OwGMnQDGToD7+XYn13Um9oertk88/1RtlKjVOvsFVq/5Ym8ngLETwNgJMLOW4sljTlfp+WrpuYmJeXVTaz5W13zL3k4AYyeAsRNgZr5dpz6o7sGbGANL1HmJ2jRd+644305/A2MngLET4PP97RLnGUztuzF17sLUetXqs1Wfcwe1357z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TGTgBjJ8D8uRSdMbbEXseddSGrNp3nodampOvdUnt7OwGMnQDGToDaHiirNitT++HtXD+9brTaZmVqzHLnmun97VbfdS2FnsjYCWDsBLiv7VZOrjM9uVa0c82pPZM7EvVxlfvb6YmMnQDGToD7d7KJMZ6d61TrvKk1HCfn6l0lauWdNq6T1U9h7AQwdgJkzxzbMVVPTO33m7jvqn3nGRJjkDvXr3LcTk9h7AQwdgLUaruVqVohsf9cYo3tzn2rEvvnUXXqLXs7AYydAMZOgPfvZE/WczumxuQS0mtKOvc6uca2xN5OAGMngLETYP7Msa27BtZqJH5I4j3m//13jYzh2dsJYOwEMHYCfD5uV5U4Q2LVfucZ0vt9pM+3SO+l4jpZ/W2MnQDGToDP18nuODk37uSZGVNjeFO11NR72HRd+2JvJ4CxE8DYCVA7l+IJ+xV35op16rn0+t9EjUv9Lsft9ETGTgBjJ8D8mWNTpmqjxN54U2eLra65UzMdOx/s1974XKlGtLcTwNgJYOwE4Gu79Hyyqfl5K519Q1afp88xm3rm1Xdv29vbCWDsBDB2AtRqu8SazeqYULXOiK4J+MN9d9p0xvam2nfmL378XXs7AYydAMZOgPvaLr0/3M59kTNP/9C+c83O73raWuCPv2tvJ4CxE8DYCcDsb6cfzt5OAGMngLETwNgJYOwEMHYC/Af/gcIC8ontIwAAAABJRU5ErkJggg=="
}
где:
uri
- изображение QR-кода для отображения в браузере;raw
- изображение QR-кода в исходном формате.
Пример реализации Mitwork\Kalkan\Http\Actions\GenerateQrCode.php
Для использования реализации из текущего пакета необходимо добавить соответсвующий маршрут (route
) в приложение:
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::get('/requests/qr-code/{id}', [\Mitwork\Kalkan\Http\Actions\GenerateQrCode::class, 'generate'])->name(config('kalkan.actions.generate-qr-code'));
Так же, можно реализовать собственную логику данного шага, указав к конфигурации собственный именованный маршрут (route
):
// ...
'actions' => [
'generate-qr-code' => 'custom-generate-qr-code',
]
// ..
Либо переопределить используемый класс и метод в маршрутах.