feat(pay): VIP package purchase service and user-center open flow

Add AKSRT_Vip_Service (GET/POST /pay/vip), activate aksrt_vip_level/expires on
order paid, package UI in credits panel, and deep-link VIP CTA to credits tab.
This commit is contained in:
2026-07-14 18:16:15 +08:00
parent 8e9e05c859
commit d0b8f7805f
10 changed files with 957 additions and 24 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ if ($captcha_active && function_exists('aksrt_is_captcha_enabled_for') && !aksrt
}
$balance = (int) ($gate_data['balance'] ?? (is_user_logged_in() && class_exists('AKSRT_Credits') ? AKSRT_Credits::balance(get_current_user_id()) : 0));
$login_url = (string) ($gate_data['login_url'] ?? wp_login_url(get_permalink($post_id)));
$vip_url = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/');
$vip_url = function_exists('aksrt_get_user_center_tab_url')
? aksrt_get_user_center_tab_url('credits')
: (function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'));
$is_need_login = $gate_blocked && $gate_code === 'aksrt_need_login';
$is_need_vip = $gate_blocked && $gate_code === 'aksrt_need_vip';