fix(payment): validate creator order type

This commit is contained in:
kate522 committed 2026-08-07 13:34:57 +08:00
1 parent 7cca472fe9
commit e8e39c1ef3
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -38,6 +38,10 @@ class Revenue {
if ($order_number === '' || (string) ($order['status'] ?? '') !== 'completed') {
return 0;
}
$product_type = sanitize_key((string) ($order['product_type'] ?? ''));
if ($product_type !== \AKSRT\Core\DomainModel::ORDER_PRODUCT_RESOURCE) {
return 0;
}
$existing = $wpdb->get_var($wpdb->prepare(
"SELECT id FROM {$this->table()} WHERE order_number = %s ORDER BY id ASC LIMIT 1",