<?php
declare(strict_types=1);
namespace App\Infrastructure\Payment\ApiPlatform\Payload;
use ApiPlatform\Metadata\ApiProperty;
use App\Infrastructure\Payment\Validators\Constraints\UniqueExternalId;
use Symfony\Component\Validator\Constraints as Assert;
#[UniqueExternalId]
class PaymentPayload
{
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
#[Assert\Length(max: 256)]
public string $paymentId;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
public string $userId;
#[ApiProperty(
openapiContext: [
'type' => 'float',
'example' => 10.5,
]
)]
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('float')]
public float $amount;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'EUR',
]
)]
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Currency]
#[Assert\Type('string')]
public string $currency;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'Test payment',
]
)]
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
#[Assert\Length(max: 256)]
public string $description;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
public string $successUrl;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
public string $failureUrl;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
public string $pendingUrl;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Type('string')]
public string $notificationUrl;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'DK',
]
)]
#[Assert\Type('string')]
public ?string $countryCode = null;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'n26',
]
)]
#[Assert\Type('string')]
public ?string $bankId = null;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'John Doe',
]
)]
#[Assert\Type('string')]
#[Assert\Length(max: 255)]
public ?string $debtorName = null;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => 'DK5000400440116243',
]
)]
#[Assert\Type('string')]
#[Assert\Length(max: 50)]
public ?string $debtorIban = null;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => '<div class="container">${ibanxs}</div>',
]
)]
#[Assert\Type('string')]
public ?string $html = null;
#[ApiProperty(
openapiContext: [
'type' => 'string',
'example' => '.container { max-width: 500px; margin: 0 auto; }',
]
)]
#[Assert\Type('string')]
public ?string $css = null;
}