forked from apoloz/alfa-bank-sdk
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Apoloz\AlfaBank\Sbp\Requests\Reversal;
|
|
|
|
use Apoloz\AlfaBank\Sbp\Data\Reversal\ReversalHistoryResponseData;
|
|
use Apoloz\AlfaBank\Utils\CmsSigner;
|
|
use Saloon\Contracts\Body\HasBody;
|
|
use Saloon\Enums\Method;
|
|
use Saloon\Http\Request;
|
|
use Saloon\Http\Response;
|
|
use Saloon\Traits\Body\HasStringBody;
|
|
|
|
class GetQrcReversalHistoryRequest extends Request implements HasBody
|
|
{
|
|
use HasStringBody;
|
|
|
|
protected Method $method = Method::POST;
|
|
|
|
public function __construct(
|
|
protected string $payrrn,
|
|
protected string $TermNo,
|
|
) {}
|
|
|
|
public function resolveEndpoint(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function createDtoFromResponse(Response $response): ReversalHistoryResponseData
|
|
{
|
|
return ReversalHistoryResponseData::from($response->json());
|
|
}
|
|
|
|
protected function defaultBody(): string
|
|
{
|
|
$bodyArray = [
|
|
'command' => 'GetQRCreversalHistory',
|
|
'TermNo' => $this->TermNo,
|
|
'payrrn' => $this->payrrn,
|
|
];
|
|
|
|
return CmsSigner::canonicalize($bodyArray);
|
|
}
|
|
}
|