feat(forum): multi-gateway cashier for pay-visibility topics

Replace balance-only AJAX topic purchase with AKSRT_Topic_Pay REST
cashier (resource orders + Payment_Gateway), reuse cms-download modal,
and unlock on aksrt_order_paid.
This commit is contained in:
2026-07-15 12:27:59 +08:00
parent 3f06675b8c
commit cea22daae7
13 changed files with 768 additions and 262 deletions
+6 -28
View File
@@ -1056,35 +1056,13 @@ class AKSRT_Content_Pay {
];
}
$methods = [];
$ids = $logged_in
? ['balance', 'alipay', 'wechatpay', 'paypal', 'stripe']
: ['alipay', 'wechatpay', 'paypal', 'stripe'];
if (!class_exists('AKSRT_Payment_Gateway')) {
return $logged_in
? [['id' => 'balance', 'name' => __('站内余额', 'aksrt')]]
: [['id' => 'alipay', 'name' => __('支付宝', 'aksrt')]];
if (function_exists('aksrt_list_cash_payment_methods')) {
return aksrt_list_cash_payment_methods($logged_in);
}
$gw = AKSRT_Payment_Gateway::get_instance();
foreach ($ids as $id) {
$g = $gw->get_gateway($id);
if (!$g) {
continue;
}
if (method_exists($g, 'is_configured') && !$g->is_configured()) {
continue;
}
$methods[] = [
'id' => $id,
'name' => method_exists($g, 'get_name') ? (string) $g->get_name() : $id,
];
}
if ($methods === []) {
$methods[] = $logged_in
? ['id' => 'balance', 'name' => __('站内余额', 'aksrt')]
: ['id' => 'alipay', 'name' => __('支付宝', 'aksrt')];
}
return $methods;
return $logged_in
? [['id' => 'balance', 'name' => __('站内余额', 'aksrt')]]
: [['id' => 'alipay', 'name' => __('支付宝', 'aksrt')]];
}