@@ -5,7 +5,7 @@ import { Alert } from '@/ui/elements/Alert';
55import { Header } from '@/ui/elements/Header' ;
66import { LineItems } from '@/ui/elements/LineItems' ;
77import { ProfileCard } from '@/ui/elements/ProfileCard' ;
8- import { toNegativeAmount } from '@/ui/utils/billing' ;
8+ import { getDiscountDescription , toNegativeAmount } from '@/ui/utils/billing' ;
99import { getPlanSeatLimit , getSeatsPerUnitTotal , summarizeSeatCharges } from '@/ui/utils/billingPlanSeats' ;
1010import { formatDate } from '@/ui/utils/formatDate' ;
1111import { truncateWithEndVisible } from '@/ui/utils/truncateTextWithEndVisible' ;
@@ -201,13 +201,14 @@ export const PaymentAttemptPage = () => {
201201} ;
202202
203203function PaymentAttemptBody ( { paymentAttempt } : { paymentAttempt : BillingPaymentResource | undefined } ) {
204- const { $ } = useLocalizations ( ) ;
204+ const { $, t } = useLocalizations ( ) ;
205205
206206 if ( ! paymentAttempt ) {
207207 return null ;
208208 }
209209
210210 const { subscriptionItem } = paymentAttempt ;
211+ const catalogDiscount = paymentAttempt . totals ?. discounts ?. discount ;
211212
212213 const fee =
213214 subscriptionItem . planPeriod === 'month'
@@ -285,6 +286,21 @@ function PaymentAttemptBody({ paymentAttempt }: { paymentAttempt: BillingPayment
285286 < LineItems . Description text = { $ ( toNegativeAmount ( paymentAttempt . totals . discounts . proration . amount ) ) } />
286287 </ LineItems . Group >
287288 ) }
289+ { catalogDiscount && catalogDiscount . amount . amount > 0 && (
290+ < LineItems . Group variant = 'tertiary' >
291+ < LineItems . Title
292+ title = { catalogDiscount . name }
293+ description = { getDiscountDescription (
294+ catalogDiscount ,
295+ catalogDiscount . cyclesRemaining ,
296+ subscriptionItem . planPeriod ,
297+ { $, t } ,
298+ ) }
299+ badge = { catalogDiscount . promoCode ? < Badge > { catalogDiscount . promoCode } </ Badge > : null }
300+ />
301+ < LineItems . Description text = { $ ( toNegativeAmount ( catalogDiscount . amount ) ) } />
302+ </ LineItems . Group >
303+ ) }
288304 { subscriptionItem . credits &&
289305 subscriptionItem . credits . proration &&
290306 subscriptionItem . credits . proration . amount . amount > 0 && (
0 commit comments