// use Apoloz\AlfaBank\Sbp\Data\CashLink\RegCashQrRequestData; use Apoloz\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 ''; // Endpoint is determined by SbpConnector's base URL } //
//
// 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()); } //
}