| 1234567891011121314151617181920212223242526 |
- <?php
-
- namespace App\Enums;
-
- enum OrderStatus: string
- {
- /** The shopper started checkout but has not paid (yet). */
- case Pending = 'pending';
-
- case Paid = 'paid';
-
- /**
- * Still not paid a day later: the shopper gave up. The double-check stops asking about it.
- * A payment that still arrives (from the webhook or the shopper's return page) marks it paid.
- */
- case Unpaid = 'unpaid';
-
- public function label(): string
- {
- return match ($this) {
- self::Pending => 'Awaiting payment',
- self::Paid => 'Paid',
- self::Unpaid => 'Not paid',
- };
- }
- }
|