@@ -47,25 +47,33 @@ export const ConfirmationPage: StagerComponent<FormSchema> = ({
4747
4848 // Only show Direct Debit payment details if there's actually an amount to pay
4949 if ( data . paymentMethod === "directDebit" && data . membership ) {
50- const frequency = getPaymentFrequency ( data . membership )
51- directDebitDetailsMessage = (
52- < section className = "form-section mb-3" >
53- < p >
54- You are paying for your membership of { organisationName } by Direct Debit.
55- </ p >
56- < p >
57- This will be charged { frequency ? frequency + ' ' : '' } from your
58- bank account.
59- </ p >
60- < p >
61- On your bank statement the charge will appear as "{ organisationBankName } ".
62- </ p >
63- < p >
64- You can contact the membership team of { organisationName } at{ " " }
65- < a href = { organisationMailToLink } > { organisationEmailAddress } </ a > .
66- </ p >
67- </ section >
68- ) ;
50+ const plan = getPaymentPlan ( data . membership ) ;
51+ const isAmountZero = plan && Number ( plan . amount ) === 0 ;
52+ const isCustomAmountAboveZero = ( plan && plan . allowCustomAmount ) ? Number ( data . customMembershipAmount ) > 0 : false ;
53+ const hasDonation = data . donationAmount && Number ( data . donationAmount ) > 0 ;
54+
55+ // Only show payment details if there's something to pay (membership, custom amount, or donation)
56+ if ( ! isAmountZero || isCustomAmountAboveZero || hasDonation ) {
57+ const frequency = getPaymentFrequency ( data . membership )
58+ directDebitDetailsMessage = (
59+ < section className = "form-section mb-3" >
60+ < p >
61+ You are paying for your membership of { organisationName } by Direct Debit.
62+ </ p >
63+ < p >
64+ This will be charged { frequency ? frequency + ' ' : '' } from your
65+ bank account.
66+ </ p >
67+ < p >
68+ On your bank statement the charge will appear as "{ organisationBankName } ".
69+ </ p >
70+ < p >
71+ You can contact the membership team of { organisationName } at{ " " }
72+ < a href = { organisationMailToLink } > { organisationEmailAddress } </ a > .
73+ </ p >
74+ </ section >
75+ ) ;
76+ }
6977 }
7078
7179 const onSubmit = async ( ) => {
0 commit comments