first commit

This commit is contained in:
2026-01-14 16:40:33 +03:00
commit f803480f7b
184 changed files with 5573 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace Gemini\AlfaBank\Sbp\Requests\CashLink;
use Gemini\AlfaBank\Sbp\Data\CashLink\RegCashQrRequestData;
use Gemini\AlfaBank\Sbp\Data\CashLink\RegCashQrResponseData;
use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Http\Response;
use Saloon\Traits\Body\HasJsonBody;
class RegCashQrRequest extends Request implements HasBody
{
use HasJsonBody;
protected Method $method = Method::POST;
public function __construct(
protected RegCashQrRequestData $data
) {}
public function resolveEndpoint(): string
{
return '';
}
protected function defaultBody(): array
{
$body = [
'command' => 'RegCashQRc',
'TermNo' => $this->data->TermNo,
];
if ($this->data->mediaType !== null) $body['mediaType'] = $this->data->mediaType;
if ($this->data->width !== null) $body['width'] = $this->data->width;
if ($this->data->height !== null) $body['height'] = $this->data->height;
if ($this->data->redirectUrl !== null) $body['redirectUrl'] = $this->data->redirectUrl;
if ($this->data->qrcId !== null) $body['qrcId'] = $this->data->qrcId;
return $body;
}
public function createDtoFromResponse(Response $response): RegCashQrResponseData
{
return RegCashQrResponseData::from($response->json());
}
}