|
|
|
|
@ -401,6 +401,8 @@ $providerButtonsDisabled = strpos($providerPayment,
|
|
|
|
|
"container.querySelectorAll('button').forEach(button => { button.disabled = true; });");
|
|
|
|
|
$providerIdempotency = strpos($providerPayment,
|
|
|
|
|
'pendingInvoicePaymentKey(invoice.id, method.id)');
|
|
|
|
|
$providerFreshAttempt = strpos($providerPayment,
|
|
|
|
|
'clearInvoicePaymentKey(invoice.id, method.id);');
|
|
|
|
|
$providerRequest = strpos($providerPayment,
|
|
|
|
|
'api(`/api/v1/invoices/${encodeURIComponent(invoice.id)}/payments`');
|
|
|
|
|
$assert(str_contains($providerPayment,
|
|
|
|
|
@ -413,16 +415,21 @@ $assert(!str_contains($providerPayment, 'confirm(')
|
|
|
|
|
&& $providerBusyGuard !== false
|
|
|
|
|
&& $providerBusySet !== false
|
|
|
|
|
&& $providerButtonsDisabled !== false
|
|
|
|
|
&& $providerFreshAttempt !== false
|
|
|
|
|
&& $providerIdempotency !== false
|
|
|
|
|
&& $providerRequest !== false
|
|
|
|
|
&& $providerBusyGuard < $providerBusySet
|
|
|
|
|
&& $providerBusySet < $providerButtonsDisabled
|
|
|
|
|
&& $providerButtonsDisabled < $providerFreshAttempt
|
|
|
|
|
&& $providerFreshAttempt < $providerIdempotency
|
|
|
|
|
&& $providerButtonsDisabled < $providerIdempotency
|
|
|
|
|
&& $providerIdempotency < $providerRequest
|
|
|
|
|
&& str_contains($providerPayment, 'const observer = observeTask(result, {')
|
|
|
|
|
&& str_contains($providerPayment, 'await observer.done;')
|
|
|
|
|
&& str_contains($providerPayment,
|
|
|
|
|
'state.appliedReadSequence = ++state.readSequence;')
|
|
|
|
|
&& substr_count($providerPayment,
|
|
|
|
|
'clearInvoicePaymentKey(invoice.id, method.id);') >= 3
|
|
|
|
|
&& str_contains($providerPayment, "status: 'pending'")
|
|
|
|
|
&& str_contains($providerPayment, 'state.mutationBusy = false;'),
|
|
|
|
|
'Provider payment must keep controls fenced until durable creation is terminal and reject stale reads.');
|
|
|
|
|
@ -455,12 +462,12 @@ $savePaymentAttempt = $section($invoicePaymentService,
|
|
|
|
|
'private static function saveAttempt(',
|
|
|
|
|
'public static function markProviderOrdersTerminal(');
|
|
|
|
|
$assert(str_contains($enqueuePayment,
|
|
|
|
|
"->where('request_idempotency_key', \$key)")
|
|
|
|
|
&& !str_contains($enqueuePayment,
|
|
|
|
|
"->where('request_fingerprint', \$fingerprint)")
|
|
|
|
|
&& str_contains($enqueuePayment, "->where('provider', \$method)")
|
|
|
|
|
&& str_contains($savePaymentAttempt, "->where('provider', \$provider)")
|
|
|
|
|
&& !str_contains($savePaymentAttempt,
|
|
|
|
|
'该账单已有支付订单或结果不明的尝试'),
|
|
|
|
|
'An unfinished order must not block switching to a different provider.');
|
|
|
|
|
&& !str_contains($enqueuePayment, "->where('provider', \$method)")
|
|
|
|
|
&& !str_contains($savePaymentAttempt, "->where('provider', \$provider)"),
|
|
|
|
|
'Only an exact idempotency retry may reuse a payment attempt.');
|
|
|
|
|
$assert(!str_contains($legacyRuntime, 'function loadInvoiceDetail(')
|
|
|
|
|
&& !str_contains($legacyRuntime, 'function renderInvoiceDetail(')
|
|
|
|
|
&& !str_contains($legacyRuntime, 'INVOICE_PAYMENT_STORAGE_PREFIX'),
|
|
|
|
|
|