forked from apoloz/alfa-bank-sdk
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 an SBP QR Code reversal request payload.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the parameters needed to initiate a QR Code reversal.
|
||||
// INPUTS: Terminal number (TermNo), currency, and various optional reversal identifiers.
|
||||
// OUTPUTS: A structured, type-safe object for the `QrcReversalRequest` payload.
|
||||
// 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 arrays and provides DTO benefits.">
|
||||
use Spatie\LaravelData\Data;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for SBP QR Code reversal request.">
|
||||
// <BELIEF_STATE "This DTO ensures the reversal request payload is strictly typed and complete, supporting clear communication for critical financial operations with the SBP API.">
|
||||
class QrcReversalRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties for the QR Code reversal request.">
|
||||
// <BELIEF_STATE "The constructor includes the mandatory `TermNo` and `currency`. Optional identifiers like `qrcId`, `payrrn`, `trxId`, `trxDT`, `amount`, `messageID`, `notificationUrl`, and `ReturnRestAmount` provide flexibility for various reversal scenarios.">
|
||||
public function __construct(
|
||||
public string $TermNo,
|
||||
public ?string $qrcId = null,
|
||||
@@ -19,4 +33,5 @@ class QrcReversalRequestData extends Data
|
||||
public ?bool $ReturnRestAmount = null,
|
||||
// extJsonParams not fully implemented as it's optional and dynamic
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user