51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Gemini\AlfaBank\Sbp\Requests\CashLink;
|
|
|
|
use Saloon\Contracts\Body\HasBody;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Traits\Body\HasJsonBody;
|
|
|
|
class ChangeAccountForCashQrRequest extends Request implements HasBody
|
|
{
|
|
use HasJsonBody;
|
|
|
|
protected Method $method = Method::POST;
|
|
|
|
public function __construct(
|
|
protected string $TermNo,
|
|
protected string $qrcId,
|
|
protected string $account,
|
|
protected ?string $NewTermNo = null,
|
|
protected ?string $NewMerchantId = null,
|
|
protected ?string $redirectUrl = null,
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
protected function defaultBody(): array
|
|
{
|
|
$body = [
|
|
'command' => 'ChangeAccForCashQRc',
|
|
'TermNo' => $this->TermNo,
|
|
'qrcId' => $this->qrcId,
|
|
'account' => $this->account,
|
|
];
|
|
|
|
if ($this->NewTermNo !== null) $body['NewTermNo'] = $this->NewTermNo;
|
|
if ($this->NewMerchantId !== null) $body['NewMerchantId'] = $this->NewMerchantId;
|
|
if ($this->redirectUrl !== null) $body['redirectUrl'] = $this->redirectUrl;
|
|
|
|
return $body;
|
|
}
|
|
|
|
public function createDtoFromResponse(\Saloon\Http\Response $response): array
|
|
{
|
|
return $response->json();
|
|
}
|
|
}
|