42 lines
1.9 KiB
PHP
42 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// 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;
|
|
use Spatie\LaravelData\Attributes\MapName;
|
|
|
|
// </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,
|
|
public ?string $TermNo = null,
|
|
public ?string $amount = null,
|
|
public ?string $currency = null,
|
|
public ?string $messageID = null,
|
|
public ?string $trxDT = null,
|
|
public ?string $trxId = null,
|
|
public ?string $payrrn = null,
|
|
#[MapName('RestAmount')]
|
|
public ?string $restAmount = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|