refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the response of a QR Code reversal request.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the outcome of an SBP QR Code reversal operation.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: A structured object containing reversal confirmation details.
|
||||
// LINKS: Sbp/Requests/Reversal/QrcReversalRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Sbp\Data\Reversal;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import the base Spatie Laravel Data class.">
|
||||
// <BELIEF_STATE "Extending `Spatie\LaravelData\Data` enables automatic casting from JSON and provides DTO benefits.">
|
||||
use Spatie\LaravelData\Data;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for SBP QR Code reversal response.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for the confirmation details of an SBP reversal, crucial for verifying the transaction.">
|
||||
class QrcReversalResponseData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of the QR Code reversal response.">
|
||||
// <BELIEF_STATE "The constructor includes mandatory `ErrorCode` and optional fields like `message`, `TermNo`, `amount`, `currency`, `messageID`, `trxDT`, `trxId`, `payrrn`, and `restAmount`. These fields provide the status and key identifiers of the reversal.">
|
||||
public function __construct(
|
||||
public int $ErrorCode,
|
||||
public ?string $message = null,
|
||||
@@ -18,4 +32,5 @@ class QrcReversalResponseData extends Data
|
||||
public ?string $payrrn = null,
|
||||
public ?string $restAmount = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user