forked from apoloz/alfa-bank-sdk
55 lines
2.8 KiB
PHP
55 lines
2.8 KiB
PHP
<?php
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for the request payload when creating a test RUB payment in the sandbox.
|
|
// RESPONSIBILITY: To hold and validate all necessary information for simulating a ruble payment.
|
|
// INPUTS: Various payment details for payer, payee, amount, purpose, and optional digital signatures.
|
|
// OUTPUTS: A structured, type-safe object for the `CreateRubPaymentRequest` payload.
|
|
// LINKS: Requests/Sandbox/Payments/CreateRubPaymentRequest.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\Sandbox\Payments;
|
|
|
|
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
|
// <BELIEF_STATE "This DTO can include `DigestSignatureData` as a collection, so `DataCollectionOf` is used for type safety.">
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\Data;
|
|
use Spatie\LaravelData\DataCollection;
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for creating a sandbox RUB payment.">
|
|
// <BELIEF_STATE "This DTO provides a robust contract for simulating payments, ensuring all test payment data is strictly typed and correctly structured.">
|
|
class CreateRubPaymentRequestData extends Data
|
|
{
|
|
// <SECTION name="constructor_properties" intent="Define all properties for the test RUB payment request.">
|
|
// <BELIEF_STATE "The constructor includes comprehensive payment details covering `externalId`, `amount`, `date`, `number`, `operationCode`, full payer/payee information (`payeeAccount`, `payeeBankBic`, etc.), `purpose`, and default values for `priority` and `deliveryKind`. Optional fields like `digestSignatures` and departmental/VAT info provide flexibility for detailed testing.">
|
|
public function __construct(
|
|
public string $externalId,
|
|
public float $amount,
|
|
public string $date,
|
|
public string $number,
|
|
public string $operationCode,
|
|
public string $payeeAccount,
|
|
public string $payeeBankBic,
|
|
public string $payeeInn,
|
|
public string $payeeName,
|
|
public string $payerAccount,
|
|
public string $payerBankBic,
|
|
public string $payerInn,
|
|
public string $payerName,
|
|
public string $purpose,
|
|
public string $priority = '5',
|
|
public string $deliveryKind = 'электронно', // "electronically"
|
|
public string $urgencyCode = 'NORMAL',
|
|
public ?string $payerKpp = null,
|
|
public ?string $payeeKpp = null,
|
|
public ?string $payerBankCorrAccount = null,
|
|
public ?string $payeeBankCorrAccount = null,
|
|
#[DataCollectionOf(DigestSignatureData::class)]
|
|
public ?DataCollection $digestSignatures = null,
|
|
public ?array $departmentalInfo = null, // Can be a nested DTO
|
|
public ?array $vat = null, // Can be a nested DTO
|
|
) {}
|
|
// </SECTION>
|
|
}
|