Lock payment process steps to gateway-only updates.
Reject admin PATCH of awaiting-payment / payment-successful so order payment status cannot be set manually. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
88ef4e82a1
commit
0a330b8749
@@ -370,7 +370,17 @@ export function listPublicPaymentGateways(settings: EPaymentSettings) {
|
||||
};
|
||||
}
|
||||
|
||||
const PAYMENT_PROCESS_STEP_IDS = ['awaiting-payment', 'payment-successful'] as const;
|
||||
/** System-managed payment steps — set by gateway callbacks, not admin UI. */
|
||||
export const PAYMENT_PROCESS_STEP_IDS = [
|
||||
'awaiting-payment',
|
||||
'payment-successful',
|
||||
] as const;
|
||||
|
||||
export type PaymentProcessStepId = (typeof PAYMENT_PROCESS_STEP_IDS)[number];
|
||||
|
||||
export function isSystemPaymentProcessStep(stepId: string): boolean {
|
||||
return (PAYMENT_PROCESS_STEP_IDS as readonly string[]).includes(stepId);
|
||||
}
|
||||
|
||||
/** Prepend default payment steps when an older store settings JSON omits them. */
|
||||
function ensurePaymentProcessSteps(steps: OrderProcessStep[]): OrderProcessStep[] {
|
||||
|
||||
Reference in New Issue
Block a user