forked from apoloz/alfa-bank-sdk
fix(formating)
This commit is contained in:
@@ -19,6 +19,7 @@ use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Http\Response;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define the request to get the status of a CashLink Uni QR Code.">
|
||||
@@ -46,6 +47,14 @@ class GetCashUniQrStatusRequest extends Request implements HasBody
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetCashUniQrStatusResponseData` DTO provides a type-safe and structured object for the status of the CashLink Uni QR Code.">
|
||||
public function createDtoFromResponse(Response $response): GetCashUniQrStatusResponseData
|
||||
{
|
||||
return GetCashUniQrStatusResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="body_builder" intent="Construct the JSON body for the request.">
|
||||
// <BELIEF_STATE "The `command` field specifies the operation to the SBP API. The `TermNo`, `uniQrId`, and `paramsId` identify the target. Optional fields like `messageID` and `payrrn` provide additional context.">
|
||||
protected function defaultBody(): array
|
||||
@@ -57,18 +66,14 @@ class GetCashUniQrStatusRequest extends Request implements HasBody
|
||||
'paramsId' => $this->data->paramsId,
|
||||
];
|
||||
|
||||
if ($this->data->messageID !== null) $body['messageID'] = $this->data->messageID;
|
||||
if ($this->data->payrrn !== null) $body['payrrn'] = $this->data->payrrn;
|
||||
if ($this->data->messageID !== null) {
|
||||
$body['messageID'] = $this->data->messageID;
|
||||
}
|
||||
if ($this->data->payrrn !== null) {
|
||||
$body['payrrn'] = $this->data->payrrn;
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetCashUniQrStatusResponseData` DTO provides a type-safe and structured object for the status of the CashLink Uni QR Code.">
|
||||
public function createDtoFromResponse(Response $response): GetCashUniQrStatusResponseData
|
||||
{
|
||||
return GetCashUniQrStatusResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user