forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
50
src/Sbp/Requests/CashLink/ChangeAccountForCashQrRequest.php
Normal file
50
src/Sbp/Requests/CashLink/ChangeAccountForCashQrRequest.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user