fix payments
This commit is contained in:
@@ -7,6 +7,8 @@ final class FinancialStatus
|
||||
public const INVOICE_UNPAID = 'unpaid';
|
||||
public const INVOICE_PARTIALLY_PAID = 'partially_paid';
|
||||
public const INVOICE_PAID = 'paid';
|
||||
public const INVOICE_OVERPAID = 'overpaid';
|
||||
public const INVOICE_CANCELLED = 'cancelled';
|
||||
|
||||
public const PAYMENT_RECORDED = 'recorded';
|
||||
public const PAYMENT_VOIDED = 'voided';
|
||||
@@ -18,6 +20,23 @@ final class FinancialStatus
|
||||
public const PAYMENT_CANCELED = 'canceled';
|
||||
public const PAYMENT_CANCELLED = 'cancelled';
|
||||
|
||||
public const PAYMENT_TRANSACTION_STATUSES = [
|
||||
self::PAYMENT_RECORDED,
|
||||
self::PAYMENT_VOIDED,
|
||||
self::PAYMENT_REFUNDED,
|
||||
self::PAYMENT_FAILED,
|
||||
self::PAYMENT_REVERSED,
|
||||
self::PAYMENT_CHARGEBACK,
|
||||
];
|
||||
|
||||
public const INVOICE_STATUSES = [
|
||||
self::INVOICE_UNPAID,
|
||||
self::INVOICE_PARTIALLY_PAID,
|
||||
self::INVOICE_PAID,
|
||||
self::INVOICE_OVERPAID,
|
||||
self::INVOICE_CANCELLED,
|
||||
];
|
||||
|
||||
public const REFUND_PENDING = 'pending';
|
||||
public const REFUND_APPROVED = 'approved';
|
||||
public const REFUND_REJECTED = 'rejected';
|
||||
@@ -55,6 +74,8 @@ final class FinancialStatus
|
||||
return match (self::normalize($status)) {
|
||||
'paid', 'full' => self::INVOICE_PAID,
|
||||
'partially paid', 'partially_paid', 'partial' => self::INVOICE_PARTIALLY_PAID,
|
||||
'overpaid' => self::INVOICE_OVERPAID,
|
||||
'cancelled', 'canceled', 'cancelled invoice', 'canceled invoice' => self::INVOICE_CANCELLED,
|
||||
default => self::INVOICE_UNPAID,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user