Skip to content

Commit c4409b3

Browse files
committed
Prevents access to summary if no payment yet
1 parent 3f9ec59 commit c4409b3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/server/plugins/engine/models/FormModel.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,15 @@ export class FormModel {
470470
}
471471
}
472472
}
473+
474+
// Check Payment component - only one allowed per form
475+
const paymentComponent = page.collection.fields.find(
476+
(field) => field.type === ComponentType.PaymentField
477+
)
478+
if (paymentComponent) {
479+
const fieldVal = paymentComponent.getFormValueFromState(context.state)
480+
return fieldVal === undefined
481+
}
473482
}
474483

475484
private fieldStateIsInvalid(

0 commit comments

Comments
 (0)