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 detailed QR Code reversal data.">
|
||||
@@ -46,6 +47,14 @@ class GetQrcReversalDataRequest extends Request implements HasBody
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetQrcReversalDataResponseData` DTO provides a type-safe and structured object for the detailed reversal data.">
|
||||
public function createDtoFromResponse(Response $response): GetQrcReversalDataResponseData
|
||||
{
|
||||
return GetQrcReversalDataResponseData::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. Other fields from the DTO are conditionally added, ensuring the payload precisely matches the API specification.">
|
||||
protected function defaultBody(): array
|
||||
@@ -56,12 +65,4 @@ class GetQrcReversalDataRequest extends Request implements HasBody
|
||||
);
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetQrcReversalDataResponseData` DTO provides a type-safe and structured object for the detailed reversal data.">
|
||||
public function createDtoFromResponse(Response $response): GetQrcReversalDataResponseData
|
||||
{
|
||||
return GetQrcReversalDataResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
@@ -27,6 +27,11 @@ class GetQrcReversalHistoryRequest extends Request implements HasBody
|
||||
return '';
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): ReversalHistoryResponseData
|
||||
{
|
||||
return ReversalHistoryResponseData::from($response->json());
|
||||
}
|
||||
|
||||
protected function defaultBody(): array
|
||||
{
|
||||
return [
|
||||
@@ -35,9 +40,4 @@ class GetQrcReversalHistoryRequest extends Request implements HasBody
|
||||
'payrrn' => $this->payrrn,
|
||||
];
|
||||
}
|
||||
|
||||
public function createDtoFromResponse(Response $response): ReversalHistoryResponseData
|
||||
{
|
||||
return ReversalHistoryResponseData::from($response->json());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 QR Code reversal.">
|
||||
@@ -46,6 +47,14 @@ class GetQrcReversalStatusRequest extends Request implements HasBody
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetQrcReversalStatusResponseData` DTO provides a type-safe and structured object for the status of the reversal.">
|
||||
public function createDtoFromResponse(Response $response): GetQrcReversalStatusResponseData
|
||||
{
|
||||
return GetQrcReversalStatusResponseData::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. Other fields from the DTO are conditionally added, ensuring the payload precisely matches the API specification.">
|
||||
protected function defaultBody(): array
|
||||
@@ -56,12 +65,4 @@ class GetQrcReversalStatusRequest extends Request implements HasBody
|
||||
);
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `GetQrcReversalStatusResponseData` DTO provides a type-safe and structured object for the status of the reversal.">
|
||||
public function createDtoFromResponse(Response $response): GetQrcReversalStatusResponseData
|
||||
{
|
||||
return GetQrcReversalStatusResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
@@ -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 initiate a QR Code reversal.">
|
||||
@@ -46,6 +47,14 @@ class QrcReversalRequest extends Request implements HasBody
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `QrcReversalResponseData` DTO provides a type-safe and structured object for the result of the reversal.">
|
||||
public function createDtoFromResponse(Response $response): QrcReversalResponseData
|
||||
{
|
||||
return QrcReversalResponseData::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. Other fields from the DTO are conditionally added, ensuring the payload precisely matches the API specification.">
|
||||
protected function defaultBody(): array
|
||||
@@ -56,12 +65,4 @@ class QrcReversalRequest extends Request implements HasBody
|
||||
);
|
||||
}
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="response_caster" intent="Map the JSON response to a DTO.">
|
||||
// <BELIEF_STATE "Casting the response to a `QrcReversalResponseData` DTO provides a type-safe and structured object for the result of the reversal.">
|
||||
public function createDtoFromResponse(Response $response): QrcReversalResponseData
|
||||
{
|
||||
return QrcReversalResponseData::from($response->json());
|
||||
}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user