forked from apoloz/alfa-bank-sdk
42 lines
2.0 KiB
PHP
42 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for a Digital Ruble payment notification payload.
|
|
// RESPONSIBILITY: To hold and type-safely represent the details of an incoming Digital Ruble payment event.
|
|
// INPUTS: Raw array from a Digital Ruble payment webhook.
|
|
// OUTPUTS: A structured object containing payment notification details.
|
|
// LINKS: Sbp/Requests/DigitalRuble/Notifications/ParsePaymentDrNotification.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Sbp\Data\DigitalRuble\Notifications;
|
|
|
|
// <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 Digital Ruble payment notification.">
|
|
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for Digital Ruble payment notifications, crucial for reliably processing incoming payment events.">
|
|
class PaymentDrNotificationData extends Data
|
|
{
|
|
// <SECTION name="constructor_properties" intent="Define the properties of a Digital Ruble payment notification.">
|
|
// <BELIEF_STATE "The constructor includes mandatory fields such as `command`, `payrrn`, `BatchId`, `TermNo`, `CreditDatePos`, and `merchantName`. Optional fields provide additional context like `uniQrId`, `operationId`, `status`, `amount`, `timestamp`, and `purpose`, essential for a comprehensive payment record.">
|
|
public function __construct(
|
|
public string $command,
|
|
public string $payrrn,
|
|
public string $BatchId,
|
|
public string $TermNo,
|
|
public string $CreditDatePos,
|
|
public string $merchantName,
|
|
public ?string $uniQrId = null,
|
|
public ?string $operationId = null,
|
|
public ?string $status = null,
|
|
public ?string $amount = null,
|
|
public ?string $timestamp = null,
|
|
public ?string $purpose = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|