diff --git a/api.planx.uk/modules/pay/middleware.ts b/api.planx.uk/modules/pay/middleware.ts index fb62d7271d..b21a939221 100644 --- a/api.planx.uk/modules/pay/middleware.ts +++ b/api.planx.uk/modules/pay/middleware.ts @@ -147,7 +147,7 @@ export async function buildPaymentPayload( inviteToPay: true, }; - const metadata = govPayMetadata.length + const metadata = Object.keys(govPayMetadata).length ? govPayMetadata : defaultGovPayMetadata; diff --git a/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx b/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx index 001c7a7fc2..851c5370b4 100644 --- a/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx +++ b/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx @@ -74,7 +74,7 @@ function Component(props: Props) { { key: "flow", value: flowSlug }, { key: "isInviteToPay", value: false }, ]; - const metadata = props.govPayMetadata.length + const metadata = props.govPayMetadata?.length ? props.govPayMetadata : defaultMetadata;