<?php

namespace App\Enums;

use App\Traits\EnumHelper;

enum PaymentStatusEnum: string
{
    use EnumHelper;

    case PENDING     = 'pending';
    case PROCESSING  = 'processing';
    case AUTHORIZED  = 'authorized';
    case PAID        = 'paid';
    case FAILED      = 'failed';
    case CANCELLED   = 'cancelled';

    public function message(): string
    {
        return match ($this) {
            self::PAID       => __('messages.payment_confirmed'),
            self::AUTHORIZED => __('messages.payment_pending_confirmation'),
            self::PROCESSING => __('messages.payment_pending_confirmation'),
            self::PENDING    => __('messages.payment_pending_confirmation'),
            self::FAILED     => __('messages.payment_not_confirmed'),
            default          => __('messages.created'),
        };
    }
}
