feat(payment): rebuild order details and asset records
This commit is contained in:
1 parent
476e2f961d
commit
7b55cfb190
57 files changed
+2080
-1294
No files matched your search
@@ -16,7 +16,6 @@ final class OrderCenterQuery {
|
||||
public const STATUS_ALL = 'all';
|
||||
public const STATUS_PENDING = 'pending';
|
||||
public const STATUS_PAID = 'paid';
|
||||
public const STATUS_REFUNDING = 'refunding';
|
||||
public const STATUS_REFUNDED = 'refunded';
|
||||
public const STATUS_CLOSED = 'closed';
|
||||
|
||||
@@ -24,7 +23,6 @@ final class OrderCenterQuery {
|
||||
self::STATUS_ALL,
|
||||
self::STATUS_PENDING,
|
||||
self::STATUS_PAID,
|
||||
self::STATUS_REFUNDING,
|
||||
self::STATUS_REFUNDED,
|
||||
self::STATUS_CLOSED,
|
||||
];
|
||||
@@ -44,6 +42,9 @@ final class OrderCenterQuery {
|
||||
*/
|
||||
public static function from_array(array $raw, int $default_per_page = 20): self {
|
||||
$status = sanitize_key((string) ($raw['status'] ?? self::STATUS_ALL));
|
||||
if ($status === 'refunding') {
|
||||
$status = self::STATUS_PAID;
|
||||
}
|
||||
if (!in_array($status, self::STATUS_GROUPS, true)) {
|
||||
$status = self::STATUS_ALL;
|
||||
}
|
||||
@@ -92,7 +93,10 @@ final class OrderCenterQuery {
|
||||
/** @return string[] */
|
||||
public function database_statuses(): array {
|
||||
if ($this->status() === self::STATUS_ALL) {
|
||||
return array_keys(DomainModel::order_status_labels());
|
||||
return array_merge(array_keys(DomainModel::order_status_labels()), ['refunding']);
|
||||
}
|
||||
if ($this->status() === self::STATUS_PAID) {
|
||||
return [self::STATUS_PAID, 'refunding'];
|
||||
}
|
||||
return [$this->status()];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user