fix(orders): enforce configured expiry

Apply the configured order lifetime to all checkout flows and close unpaid orders once their expiry is reached.
This commit is contained in:
2026-08-12 17:49:54 +08:00
parent 5752f80e62
commit 69dd3b66ab
8 changed files with 92 additions and 12 deletions
+1 -1
View File
@@ -326,7 +326,7 @@ trait BalanceServiceCharge {
'status' => \AKSRT\Payment\Order::STATUS_PENDING,
'payment_method' => $payment_method,
'note' => is_string($note) ? $note : '',
'expires_at' => gmdate('Y-m-d H:i:s', time() + 30 * MINUTE_IN_SECONDS),
'expires_at' => \AKSRT\Settings\PaymentRuntime::get_order_expiry_at(),
]);
if ($order_number === '') {
return new \WP_Error('aksrt_order_create_failed', __('创建订单失败', 'aksrt'), ['status' => 500]);