feat(pay): content cashier coupon and rebate discount chain

Wire zibll-style cash content discounts: VIP list price → buyer 推广折扣 → coupon, then commission on final pay. Reuse AKSRT_Coupon, add Invite::get_referrer, cashier UI, and paid-time coupon burn + rebate_log.
This commit is contained in:
kate522 committed 2026-07-14 19:38:05 +08:00
1 parent 9eaddce457
commit 5d7b138c2c
11 files changed
+724 -22

No files matched your search

@@ -136,6 +136,15 @@ trait AKSRT_Settings_Credits_Payment_Groups {
return AKSRT_Settings_Payment_Runtime::get_paid_content_settings();
}
/**
* Content coupon global switches.
*
* @return array{enabled:bool,desc:string}
*/
public static function get_content_coupon_settings(): array {
return AKSRT_Settings_Payment_Runtime::get_content_coupon_settings();
}
/**
* @return array{enabled:bool,mode:string,packages_raw:string,package_count:int,help_text:string}
*/
@@ -383,6 +383,10 @@ class AKSRT_Settings_Home_Cms {
return AKSRT_Settings_Payment_Runtime::get_paid_content_settings();
}
public static function get_content_coupon_settings(): array {
return AKSRT_Settings_Payment_Runtime::get_content_coupon_settings();
}
public static function get_payment_recharge_settings(): array {
return AKSRT_Settings_Payment_Runtime::get_payment_recharge_settings();
}
@@ -72,6 +72,22 @@ class AKSRT_Settings_Payment_Runtime {
'remote_ext' => sanitize_text_field((string) ($settings['payment_download_remote_ext'] ?? 'zip,rar,7z')),
'alone_page' => !empty($settings['payment_down_alone_page']),
],
// Content cashier coupon (zibll coupon_post_s / coupon_desc).
'coupon_post_s' => !empty($settings['coupon_post_s']),
'coupon_desc' => sanitize_textarea_field((string) ($settings['coupon_desc'] ?? '')),
];
}
/**
* Content coupon global switches (zibll coupon_post_s).
*
* @return array{enabled:bool,desc:string}
*/
public static function get_content_coupon_settings(): array {
$settings = self::get_paid_content_settings();
return [
'enabled' => !empty($settings['coupon_post_s']),
'desc' => (string) ($settings['coupon_desc'] ?? ''),
];
}