fix(payment): validate creator order type
This commit is contained in:
1 parent
7cca472fe9
commit
e8e39c1ef3
2 files changed
+5
-1
No files matched your search
@@ -18,7 +18,7 @@ if ($creation_url === '' && $revenue_url === '') {
|
|||||||
<?php if ($creation_url !== '') : ?>
|
<?php if ($creation_url !== '') : ?>
|
||||||
<a class="uc-center-card uc-center-card--creation" href="<?php echo esc_url($creation_url); ?>">
|
<a class="uc-center-card uc-center-card--creation" href="<?php echo esc_url($creation_url); ?>">
|
||||||
<span class="uc-center-card__icon"><i class="fas fa-feather-alt" aria-hidden="true"></i></span>
|
<span class="uc-center-card__icon"><i class="fas fa-feather-alt" aria-hidden="true"></i></span>
|
||||||
<span><strong><?php esc_html_e('创作中心', 'aksrt'); ?></strong><small><?php esc_html_e('发布与管理内容', 'aksrt'); ?></small></span>
|
<span><strong><?php esc_html_e('创作中心', 'aksrt'); ?></strong><small><?php esc_html_e('查看作者现金与积分收益', 'aksrt'); ?></small></span>
|
||||||
<i class="fas fa-angle-right" aria-hidden="true"></i>
|
<i class="fas fa-angle-right" aria-hidden="true"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ class Revenue {
|
|||||||
if ($order_number === '' || (string) ($order['status'] ?? '') !== 'completed') {
|
if ($order_number === '' || (string) ($order['status'] ?? '') !== 'completed') {
|
||||||
return 0;
|
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(
|
$existing = $wpdb->get_var($wpdb->prepare(
|
||||||
"SELECT id FROM {$this->table()} WHERE order_number = %s ORDER BY id ASC LIMIT 1",
|
"SELECT id FROM {$this->table()} WHERE order_number = %s ORDER BY id ASC LIMIT 1",
|
||||||
|
|||||||
Reference in new issue
Block a user