forked from apoloz/alfa-bank-sdk
fix(formating)
This commit is contained in:
@@ -14,9 +14,10 @@ namespace Apoloz\AlfaBank\Sbp\Data;
|
||||
// <SECTION name="module_imports" intent="Import necessary attributes and base class for defining the DTO.">
|
||||
// <BELIEF_STATE "Spatie's Laravel Data package provides powerful features for DTOs, including automatic mapping, validation, and serialization. Using its attributes (`MapName`, `Data`) simplifies the DTO's definition and functionality.">
|
||||
use Spatie\LaravelData\Attributes\MapName;
|
||||
use Spatie\LaravelData\Attributes\MapOutputName; // Note: Not used directly here, but generally relevant for output mapping
|
||||
// Note: Not used directly here, but generally relevant for output mapping
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Mappers\NameMapper; // Note: Not directly used, but part of the Spatie Data ecosystem
|
||||
|
||||
// Note: Not directly used, but part of the Spatie Data ecosystem
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define the DTO for an SBP QR Code generation request.">
|
||||
@@ -29,53 +30,53 @@ class QrCodeRequestData extends Data
|
||||
// <BELIEF_STATE "The `TermNo` is a mandatory identifier for the payment terminal. Using `#[MapName]` allows the internal property to be `termNo` (camelCase) while the API expects `TermNo` (PascalCase).">
|
||||
#[MapName('TermNo')]
|
||||
public string $termNo,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `qrcType` specifies whether the QR code is static ('01') or dynamic ('02'). Providing a default value simplifies usage for the most common scenario.">
|
||||
#[MapName('qrcType')] // Although same name, good to be explicit
|
||||
public string $qrcType = '01',
|
||||
|
||||
public string $qrcType = '01',
|
||||
|
||||
// <BELIEF_STATE "The `amount` is optional for static QRs but mandatory for dynamic ones. It's stored as a string to avoid floating-point precision issues with currency.">
|
||||
public ?string $amount = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `currency` is typically 'RUB' for SBP, but it's explicitly defined for clarity and future extensibility.">
|
||||
public string $currency = 'RUB',
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `paymentPurpose` provides a human-readable description for the payment, improving reconciliation.">
|
||||
public ?string $paymentPurpose = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `redirectUrl` is where the user is sent after completing the payment, essential for web-based flows.">
|
||||
public ?string $redirectUrl = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `messageID` provides an optional, unique identifier for the request, useful for idempotency or tracking.">
|
||||
public ?string $messageID = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "Width and height allow customization of the generated QR code image dimensions.">
|
||||
public ?string $width = null,
|
||||
public ?string $height = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `notificationUrl` specifies where the bank should send webhook notifications about payment status changes.">
|
||||
public ?string $notificationUrl = null,
|
||||
|
||||
|
||||
// Dynamic QR specific fields
|
||||
// <BELIEF_STATE "The `OrderNumber` is specific to dynamic QRs, providing a unique identifier for the order in the merchant's system.">
|
||||
#[MapName('OrderNumber')]
|
||||
public ?string $orderNumber = null,
|
||||
|
||||
|
||||
// <BELIEF_STATE "The `qrTtl` defines how long a dynamic QR code remains valid, specified in minutes.">
|
||||
public ?string $qrTtl = null,
|
||||
|
||||
public ?string $qrTtl = null,
|
||||
|
||||
// <BELIEF_STATE "Subscription service identifiers are used for recurring payment scenarios with SBP.">
|
||||
public ?string $subscriptionServiceId = null,
|
||||
public ?string $subscriptionServiceName = null,
|
||||
|
||||
|
||||
// Optional user data for Dynamic QR (often part of sender identification)
|
||||
// <BELIEF_STATE "Sender details are crucial for identifying the payer in certain SBP scenarios. `#[MapName]` ensures these follow API conventions.">
|
||||
#[MapName('SenderFIO')]
|
||||
public ?string $senderFio = null,
|
||||
|
||||
|
||||
#[MapName('SenderID')]
|
||||
public ?string $senderId = null,
|
||||
|
||||
|
||||
#[MapName('SenderBankBIC')]
|
||||
public ?string $senderBankBic = null,
|
||||
) {}
|
||||
|
||||
Reference in New Issue
Block a user