<?php

declare(strict_types=1);

namespace apexl\Io\modules\payment\Dto;

/**
 * A tokenised payment method, brand/last-4 only — never PAN.
 *
 * Returned from list / attach. Consumers mirror to their local
 * `payment_methods` table so they can show "Visa ending 4242" in
 * checkout-summary UIs without re-hitting the gateway.
 */
final readonly class PaymentMethodDescriptor
{
    public function __construct(
        public string  $gatewayPaymentMethodRef,
        public string  $type,                  // 'card' / 'sepa_debit' / 'bacs_debit' / 'paypal_account' / 'us_bank_account'
        public ?string $brand = null,          // 'visa' / 'mastercard' / 'amex' / 'discover' / ...
        public ?string $last4 = null,
        public ?int    $expMonth = null,
        public ?int    $expYear  = null,
        public bool    $isDefault = false,
        public ?string $billingName  = null,
        public ?string $billingEmail = null,
    ) {}
}
