feat(pay): enable points card-pass redeem in user center
Wire zibll-style points_pass_exchange settings, open credits redeem options, and add 卡密兑换积分 UI on the credits panel.
This commit is contained in:
1 parent
6bad39a7ba
commit
dc28fafcc3
4 files changed
+64
-12
No files matched your search
@@ -138,22 +138,34 @@ class AKSRT_Charge_Card {
|
||||
}
|
||||
}
|
||||
|
||||
// Points card-pass: zibll points_pass_exchange_* (stored in aksrt_settings).
|
||||
$credits = ['enabled' => false, 'desc' => '', 'only_password' => true];
|
||||
$all = class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'get_all')
|
||||
? AKSRT_Settings::get_all()
|
||||
: (array) get_option('aksrt_settings', []);
|
||||
if (!empty($all['points_pass_exchange_s'])) {
|
||||
// Require credits system on when available.
|
||||
$credits_on = !class_exists('AKSRT_Settings') || !method_exists('AKSRT_Settings', 'credits_enabled') || AKSRT_Settings::credits_enabled();
|
||||
$credits = [
|
||||
'enabled' => $credits_on,
|
||||
'desc' => sanitize_textarea_field((string) ($all['points_pass_exchange_desc'] ?? '')),
|
||||
'only_password' => !isset($all['points_pass_exchange_only_password']) || !empty($all['points_pass_exchange_only_password']),
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'balance' => $balance,
|
||||
'vip' => $vip,
|
||||
'credits' => [
|
||||
'enabled' => false,
|
||||
'desc' => '',
|
||||
'only_password' => true,
|
||||
],
|
||||
'credits' => $credits,
|
||||
'labels' => [
|
||||
'title' => __('卡密兑换', 'aksrt'),
|
||||
'password' => __('卡密', 'aksrt'),
|
||||
'card' => __('卡号', 'aksrt'),
|
||||
'submit_balance' => __('兑换余额', 'aksrt'),
|
||||
'submit_vip' => __('兑换会员', 'aksrt'),
|
||||
'placeholder_pw' => __('请输入卡密', 'aksrt'),
|
||||
'placeholder_card'=> __('请输入卡号', 'aksrt'),
|
||||
'title' => __('卡密兑换', 'aksrt'),
|
||||
'password' => __('卡密', 'aksrt'),
|
||||
'card' => __('卡号', 'aksrt'),
|
||||
'submit_balance' => __('兑换余额', 'aksrt'),
|
||||
'submit_vip' => __('兑换会员', 'aksrt'),
|
||||
'submit_credits' => __('兑换积分', 'aksrt'),
|
||||
'placeholder_pw' => __('请输入卡密', 'aksrt'),
|
||||
'placeholder_card' => __('请输入卡号', 'aksrt'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user