forked from apoloz/alfa-bank-sdk
refactor(qr)
This commit is contained in:
39
src/Sbp/Data/GetQRCdQueryData.php
Normal file
39
src/Sbp/Data/GetQRCdQueryData.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the response when generating an SBP QR Code.
|
||||
// RESPONSIBILITY: To provide a strongly-typed structure for the API's response to QR code generation requests, including status, potential error messages, and the generated QR code data (image, payload, ID).
|
||||
// INPUTS: Raw array data from the SBP QR Code generation API response.
|
||||
// OUTPUTS: An instantiated DTO with properties mapped from the input array.
|
||||
// LINKS: Sbp/Requests/GetQrCodeRequest.php, README.md#sbp-api
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Sbp\Data;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import the base Spatie\LaravelData class.">
|
||||
// <BELIEF_STATE "This class extends `Spatie\LaravelData\Data` to leverage its robust data mapping and type safety, ensuring consistent and predictable handling of SBP QR Code response payloads.">
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
// </SECTION>
|
||||
/**
|
||||
*
|
||||
* "queryData":
|
||||
{
|
||||
"notificationUrl":"https://sbp-payments",
|
||||
"SenderFIO":"Иванов|Иван|Иванович",
|
||||
"SenderID":"0079123456789",
|
||||
"SenderBankBIC":"44525593"
|
||||
}
|
||||
*
|
||||
* */
|
||||
// <SECTION name="class_definition" intent="Define the QR Code response data structure.">
|
||||
// <BELIEF_STATE "The `QrCodeResponseData` DTO encapsulates all possible fields returned by the SBP QR Code generation API. Fields are explicitly typed as nullable to accommodate variations in API responses, particularly for error scenarios where certain data might be absent.">
|
||||
class GetQRCdQueryData extends Data
|
||||
{
|
||||
public function __construct(
|
||||
public string $notificationUrl,
|
||||
public string $SenderFIO,
|
||||
public string $SenderID
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user