fix(payment): validate creator order type
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user