fix(payment): harden payment and refund chains

This commit is contained in:
2026-07-26 02:29:46 +08:00
parent c70fbe9835
commit 53ff99f343
24 changed files with 993 additions and 251 deletions
+5 -1
View File
@@ -111,7 +111,7 @@ add_filter('query_vars', function ($vars) {
// 主题切换离开时:清理本主题注册的 cron 任务
add_action('switch_theme', function () {
$hooks = ['aksrt_dl_token_cleanup', 'aksrt_email_verification_backfill_batch', 'aksrt_notification_cleanup'];
$hooks = ['aksrt_dl_token_cleanup', 'aksrt_email_verification_backfill_batch', 'aksrt_notification_cleanup', 'aksrt_reconcile_refunds', 'aksrt_after_sale_auto_cancel'];
foreach ($hooks as $hook) {
$next = wp_next_scheduled($hook);
while ($next) {
@@ -321,6 +321,10 @@ if (class_exists('\AKSRT\Payment\Order')) {
\AKSRT\Payment\Order::get_instance()->init();
}
if (class_exists('\AKSRT\Payment\AfterSale')) {
\AKSRT\Payment\AfterSale::get_instance()->init();
}
// Register built-in payment gateways
if (class_exists('\AKSRT\Payment\Gateway')) {
$gw = \AKSRT\Payment\Gateway::get_instance();