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,62 @@
<?php
namespace Gemini\AlfaBank\Sbp\Requests\DigitalRuble;
use Gemini\AlfaBank\Sbp\Data\DigitalRuble\CreateUniQrRequestData;
use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;
class CreateUniQrRequest extends Request implements HasBody
{
use HasJsonBody;
protected Method $method = Method::POST;
public function __construct(
protected CreateUniQrRequestData $data
) {}
public function resolveEndpoint(): string
{
return '';
}
protected function defaultBody(): array
{
$body = [
'command' => 'ReqUniQr',
'TermNo' => $this->data->TermNo,
'uniQrType' => $this->data->uniQrType,
];
// Conditional mappings
if ($this->data->amount !== null) $body['amount'] = $this->data->amount;
if ($this->data->paymentPurpose !== null) $body['paymentPurpose'] = $this->data->paymentPurpose;
if ($this->data->redirectUrl !== null) $body['redirectUrl'] = $this->data->redirectUrl;
if ($this->data->paymentPageUrl !== null) $body['paymentPageUrl'] = $this->data->paymentPageUrl;
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->qrTtl !== null) $body['qrTtl'] = $this->data->qrTtl;
if ($this->data->messageID !== null) $body['messageID'] = $this->data->messageID;
$queryData = [];
if ($this->data->notificationUrl !== null) $queryData['notificationUrl'] = $this->data->notificationUrl;
if ($this->data->SenderFIO !== null) $queryData['SenderFIO'] = $this->data->SenderFIO;
if ($this->data->SenderID !== null) $queryData['SenderID'] = $this->data->SenderID;
if ($this->data->SenderBankBIC !== null) $queryData['SenderBankBIC'] = $this->data->SenderBankBIC;
if (!empty($queryData)) {
$body['queryData'] = $queryData;
}
return $body;
}
public function createDtoFromResponse(\Saloon\Http\Response $response): array
{
return $response->json();
}
}