forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,19 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for an SBP QR Code subscription registration request payload.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the parameters needed to register a new SBP subscription.
|
||||
// INPUTS: Terminal number (TermNo), subscription purpose, notification URL, and various optional QR Code parameters.
|
||||
// OUTPUTS: A structured, type-safe object for the `RegQrSubRequest` payload.
|
||||
// LINKS: Sbp/Requests/Subscription/RegQrSubRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Sbp\Data\Subscription;
|
||||
|
||||
// <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 SBP QR Code subscription registration request.">
|
||||
// <BELIEF_STATE "This DTO ensures the subscription registration payload is strictly typed and complete, supporting clear communication with the SBP API for recurring payments.">
|
||||
class RegQrSubRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties for the QR Code subscription registration request.">
|
||||
// <BELIEF_STATE "The constructor includes mandatory `TermNo`, `subscriptionPurpose`, `notificationUrl`, and defaults `qrcType` to '03' (subscription). Optional fields like `qrTtl`, `redirectUrl`, `subscriptionServiceId`, and `subscriptionServiceName` provide flexibility for detailed subscription setup.">
|
||||
public function __construct(
|
||||
public string $TermNo,
|
||||
public string $subscriptionPurpose,
|
||||
public string $notificationUrl,
|
||||
public string $qrcType = '03',
|
||||
public string $qrcType = '03', // '03' = Subscription
|
||||
public ?string $qrTtl = null,
|
||||
public ?string $redirectUrl = null,
|
||||
public ?string $subscriptionServiceId = null,
|
||||
public ?string $subscriptionServiceName = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user