|
|
|
|
@ -270,6 +270,12 @@ $assert(str_contains($schedulePoll, 'state.refreshPromise')
|
|
|
|
|
'A full detail refresh must pause sparse status polling and resume it afterwards.');
|
|
|
|
|
$balancePayment = $section($invoiceDetailRuntime, 'async function payInvoiceBalance(',
|
|
|
|
|
'async function createInvoicePayment(');
|
|
|
|
|
$balanceBusyGuard = strpos($balancePayment, 'if (state.mutationBusy) return;');
|
|
|
|
|
$balanceBusySet = strpos($balancePayment, 'state.mutationBusy = true;');
|
|
|
|
|
$balanceButtonsDisabled = strpos($balancePayment,
|
|
|
|
|
"container.querySelectorAll('button').forEach(button => { button.disabled = true; });");
|
|
|
|
|
$balanceRequest = strpos($balancePayment,
|
|
|
|
|
'api(`/api/v1/invoices/${encodeURIComponent(invoice.id)}/pay-balance`');
|
|
|
|
|
$assert(str_contains($balancePayment,
|
|
|
|
|
'state.appliedReadSequence = ++state.readSequence;')
|
|
|
|
|
&& strpos($balancePayment,
|
|
|
|
|
@ -287,14 +293,44 @@ $assert(str_contains($balancePayment,
|
|
|
|
|
'if ([403, 409].includes(Number(error.status || 0)))')
|
|
|
|
|
&& str_contains($balancePayment, 'await refreshInvoiceDetail(invoice.id);'),
|
|
|
|
|
'A deterministic balance-payment rejection must refresh server payable state.');
|
|
|
|
|
$assert(!str_contains($balancePayment, 'confirm(')
|
|
|
|
|
&& $balanceBusyGuard !== false
|
|
|
|
|
&& $balanceBusySet !== false
|
|
|
|
|
&& $balanceButtonsDisabled !== false
|
|
|
|
|
&& $balanceRequest !== false
|
|
|
|
|
&& $balanceBusyGuard < $balanceBusySet
|
|
|
|
|
&& $balanceBusySet < $balanceButtonsDisabled
|
|
|
|
|
&& $balanceButtonsDisabled < $balanceRequest
|
|
|
|
|
&& str_contains($balancePayment, 'state.mutationBusy = false;'),
|
|
|
|
|
'Balance payment must execute immediately while retaining duplicate-submit protection and recovery.');
|
|
|
|
|
$providerPayment = $section($invoiceDetailRuntime,
|
|
|
|
|
'async function createInvoicePayment(', 'function renderInvoicePaymentMethods(');
|
|
|
|
|
$providerBusyGuard = strpos($providerPayment, 'if (state.mutationBusy) return;');
|
|
|
|
|
$providerBusySet = strpos($providerPayment, 'state.mutationBusy = true;');
|
|
|
|
|
$providerButtonsDisabled = strpos($providerPayment,
|
|
|
|
|
"container.querySelectorAll('button').forEach(button => { button.disabled = true; });");
|
|
|
|
|
$providerIdempotency = strpos($providerPayment,
|
|
|
|
|
'pendingInvoicePaymentKey(invoice.id, method.id)');
|
|
|
|
|
$providerRequest = strpos($providerPayment,
|
|
|
|
|
'api(`/api/v1/invoices/${encodeURIComponent(invoice.id)}/payments`');
|
|
|
|
|
$assert(str_contains($providerPayment,
|
|
|
|
|
"const creationStillInProgress = String(error.message).includes('正在创建');")
|
|
|
|
|
&& str_contains($providerPayment,
|
|
|
|
|
'if ([403, 409].includes(status) && !creationStillInProgress)')
|
|
|
|
|
&& str_contains($providerPayment, 'await refreshInvoiceDetail(invoice.id);'),
|
|
|
|
|
'A deterministic provider-payment rejection must refresh server payable state.');
|
|
|
|
|
$assert(!str_contains($providerPayment, 'confirm(')
|
|
|
|
|
&& $providerBusyGuard !== false
|
|
|
|
|
&& $providerBusySet !== false
|
|
|
|
|
&& $providerButtonsDisabled !== false
|
|
|
|
|
&& $providerIdempotency !== false
|
|
|
|
|
&& $providerRequest !== false
|
|
|
|
|
&& $providerBusyGuard < $providerBusySet
|
|
|
|
|
&& $providerBusySet < $providerButtonsDisabled
|
|
|
|
|
&& $providerButtonsDisabled < $providerIdempotency
|
|
|
|
|
&& $providerIdempotency < $providerRequest
|
|
|
|
|
&& str_contains($providerPayment, 'state.mutationBusy = false;'),
|
|
|
|
|
'Provider payment must execute immediately while retaining idempotency and duplicate-submit protection.');
|
|
|
|
|
$paymentChoices = $section($invoiceDetailRuntime,
|
|
|
|
|
'function renderInvoicePaymentMethods(', 'function invoiceProgressText(');
|
|
|
|
|
$assert(str_contains($invoiceDetailRuntime, 'balancePaymentAllowed: false')
|
|
|
|
|
@ -329,11 +365,16 @@ $assert(!str_contains($cloudShell, '/theme/venix/js/qrcode.min.js')
|
|
|
|
|
'The QR library must be loaded only after an online payment order is created.');
|
|
|
|
|
$cleanup = $section($invoiceDetailRuntime, 'function bindInvoiceDetailCleanup(',
|
|
|
|
|
'export {');
|
|
|
|
|
$assert(str_contains($cleanup, 'clearTimeout(toastTimer);')
|
|
|
|
|
&& str_contains($cleanup, 'toastTimer = null;')
|
|
|
|
|
$assert(!str_contains($cleanup, 'toastTimer')
|
|
|
|
|
&& str_contains($cleanup, "const element = byId('toast');")
|
|
|
|
|
&& str_contains($cleanup, 'if (element) element.hidden = true;'),
|
|
|
|
|
'BFCache cleanup must not restore a visible toast after cancelling its timer.');
|
|
|
|
|
'BFCache cleanup must hide the shared toast region without retaining obsolete local timer state.');
|
|
|
|
|
$assert(str_contains($invoiceDetailTemplate,
|
|
|
|
|
'选择支付方式后,点击“立即支付”将直接发起支付,请勿重复点击。')
|
|
|
|
|
&& str_contains($invoiceDetailTemplate, '>立即支付</button>')
|
|
|
|
|
&& !str_contains($invoiceDetailTemplate, '再确认支付本账单')
|
|
|
|
|
&& !str_contains($invoiceDetailTemplate, '>确认支付</button>'),
|
|
|
|
|
'Invoice payment copy must describe immediate execution without stale confirmation text.');
|
|
|
|
|
$createPayment = $section($invoiceDetailRuntime, 'async function createInvoicePayment(',
|
|
|
|
|
'function renderInvoicePaymentMethods(');
|
|
|
|
|
$paymentRequest = strpos($createPayment,
|
|
|
|
|
@ -383,7 +424,8 @@ foreach (['created_at', 'amount', 'status', 'plan_name', 'cpu_cores', 'memory_mi
|
|
|
|
|
}
|
|
|
|
|
$assert(str_contains($jobService, "'updated_at' =>")
|
|
|
|
|
&& str_contains($jobService, "'attempts' =>")
|
|
|
|
|
&& str_contains($jobService, 'CloudInput::safeResult($result)'),
|
|
|
|
|
&& str_contains($jobService, '$safeResult = self::displayResult(')
|
|
|
|
|
&& str_contains($jobService, 'return CloudOperationErrorCatalog::result('),
|
|
|
|
|
'Provisioning progress lacks safe timestamps or attempt metadata.');
|
|
|
|
|
$assert(str_contains($invoiceEmail, '#{$invoice_id|escape:"html"}')
|
|
|
|
|
&& str_contains($invoiceEmail, '${$amount|escape:"html"}')
|
|
|
|
|
|