Files
alfa-bank-sdk/src/Sbp/Data/Reversal/GetQrcReversalDataResponseData.php

45 lines
2.0 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the data structure for the response of a QR Code reversal data request.
// RESPONSIBILITY: To hold and type-safely represent detailed information about an SBP QR Code reversal.
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing detailed reversal data.
// LINKS: Sbp/Requests/Reversal/GetQrcReversalDataRequest.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 detailed SBP QR Code reversal data response.">
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for the detailed outcome of a reversal data query, crucial for reconciliation and error analysis.">
class GetQrcReversalDataResponseData extends Data
{
// <SECTION name="constructor_properties" intent="Define the properties of the QR Code reversal data response.">
// <BELIEF_STATE "The constructor includes mandatory error codes and messages, along with optional detailed information about the reversal such as `TermNo`, `messageID`, payer details, `payrrn`, `qrcId`, `trxDT`, `trxId`, and `restAmount`.">
public function __construct(
public int $ErrorCode,
public string $message,
public ?string $TermNo = null,
public ?string $messageID = null,
public ?string $payerBnkBIC = null,
public ?string $payerBnkName = null,
public ?string $payerId = null,
public ?string $payerPam = null,
public ?string $payrrn = null,
public ?string $qrcId = null,
public ?string $trxDT = null,
public ?string $trxId = null,
#[MapName('RestAmount')]
public ?string $restAmount = null,
) {}
// </SECTION>
}