fix(payment): validate creator order type

This commit is contained in:
2026-08-07 13:34:57 +08:00
parent 7cca472fe9
commit e8e39c1ef3
2 changed files with 5 additions and 1 deletions
+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",