forked from apoloz/alfa-bank-sdk
first commit
This commit is contained in:
47
src/Sbp/Requests/Reversal/GetQrcReversalStatusRequest.php
Normal file
47
src/Sbp/Requests/Reversal/GetQrcReversalStatusRequest.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Gemini\AlfaBank\Sbp\Requests\Reversal;
|
||||
|
||||
use Gemini\AlfaBank\Sbp\Data\Reversal\GetQrcReversalStatusRequestData;
|
||||
use Gemini\AlfaBank\Sbp\Data\Reversal\GetQrcReversalStatusResponseData;
|
||||
use Saloon\Contracts\Body\HasBody;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
class GetQrcReversalStatusRequest extends Request implements HasBody
|
||||
{
|
||||
use HasJsonBody;
|
||||
|
||||
protected Method $method = Method::POST;
|
||||
|
||||
public function __construct(
|
||||
protected GetQrcReversalStatusRequestData $data
|
||||
) {}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function defaultBody(): array
|
||||
{
|
||||
$body = [
|
||||
'command' => 'GetQRCreversalStatus',
|
||||
'TermNo' => $this->data->TermNo,
|
||||
];
|
||||
|
||||
if ($this->data->payrrn !== null) $body['payrrn'] = $this->data->payrrn;
|
||||
if ($this->data->originalTrxId !== null) $body['originalTrxId'] = $this->data->originalTrxId;
|
||||
if ($this->data->trxId !== null) $body['trxId'] = $this->data->trxId;
|
||||
if ($this->data->messageID !== null) $body['messageID'] = $this->data->messageID;
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): GetQrcReversalStatusResponseData
|
||||
{
|
||||
return GetQrcReversalStatusResponseData::from($response->json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user