chore(pay): close residual zibll edge contracts for content pay
Expand coupon scope to content categories, document points_deduction as runtime-off like zibll, reject card_pass on content cashier, and pass shop/content context into coupon validate.
This commit is contained in:
1 parent
dc28fafcc3
commit
2ead893923
6 files changed
+90
-24
No files matched your search
@@ -559,6 +559,38 @@ if (!function_exists('aksrt_get_post_rebate_discount')) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether cash checkout may use points deduction (zibll points_deduction).
|
||||
*
|
||||
* zibll: zibpay_is_allow_points_deduction() always returns false ("暂未启用").
|
||||
* Keep the same contract: schema/UI may exist, runtime is hard-off unless filter overrides.
|
||||
*/
|
||||
if (!function_exists('aksrt_is_allow_points_deduction')) {
|
||||
function aksrt_is_allow_points_deduction(string $context = 'content'): bool {
|
||||
// Mirror zibll hard-off first.
|
||||
$allowed = false;
|
||||
if (class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'get_all')) {
|
||||
$all = AKSRT_Settings::get_all();
|
||||
// Even if switch on, default remains false like zibll until product enables it.
|
||||
if (!empty($all['points_deduction_s']) && class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'credits_enabled') && AKSRT_Settings::credits_enabled()) {
|
||||
$allowed = false; // still disabled at runtime
|
||||
}
|
||||
}
|
||||
return (bool) apply_filters('aksrt_is_allow_points_deduction', $allowed, $context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Content cashier does not accept card_pass payment_method.
|
||||
* Card-pass for balance/VIP/points is user-center redeem (zibll order types 4/8/9),
|
||||
* not content pay types (reading/download/gallery/video).
|
||||
*/
|
||||
if (!function_exists('aksrt_is_content_card_pass_pay_allowed')) {
|
||||
function aksrt_is_content_card_pass_pay_allowed($post = null): bool {
|
||||
return (bool) apply_filters('aksrt_is_content_card_pass_pay_allowed', false, $post);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// 状态判断
|
||||
// ============================================================
|
||||
|
||||
Reference in new issue
Block a user