Skip to content

Commit 78cc949

Browse files
authored
chore(clerk-js,types): Use subscriptionItems on commerce payments responses (#6272)
1 parent b96114e commit 78cc949

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.changeset/short-stars-start.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/clerk-js/src/ui/components/Statements/StatementPage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export const StatementPage = () => {
6767
{group.items.map(item => (
6868
<Statement.SectionContentItem key={item.id}>
6969
<Statement.SectionContentDetailsHeader
70-
title={item.subscription.plan.name}
71-
description={`${item.subscription.amount?.currencySymbol}${item.subscription.amount?.amountFormatted} / ${item.subscription.planPeriod === 'month' ? t(localizationKeys('commerce.month')) : t(localizationKeys('commerce.year'))}`}
70+
title={item.subscriptionItem.plan.name}
71+
description={`${item.subscriptionItem.amount?.currencySymbol}${item.subscriptionItem.amount?.amountFormatted} / ${item.subscriptionItem.planPeriod === 'month' ? t(localizationKeys('commerce.month')) : t(localizationKeys('commerce.year'))}`}
7272
secondaryTitle={`${item.amount.currencySymbol}${item.amount.amountFormatted}`}
7373
/>
7474
<Statement.SectionContentDetailsList>
@@ -78,15 +78,15 @@ export const StatementPage = () => {
7878
? localizationKeys(
7979
`${localizationRoot}.billingPage.statementsSection.itemCaption__paidForPlan`,
8080
{
81-
plan: item.subscription.plan.name,
82-
period: item.subscription.planPeriod,
81+
plan: item.subscriptionItem.plan.name,
82+
period: item.subscriptionItem.planPeriod,
8383
},
8484
)
8585
: localizationKeys(
8686
`${localizationRoot}.billingPage.statementsSection.itemCaption__subscribedAndPaidForPlan`,
8787
{
88-
plan: item.subscription.plan.name,
89-
period: item.subscription.planPeriod,
88+
plan: item.subscriptionItem.plan.name,
89+
period: item.subscriptionItem.planPeriod,
9090
},
9191
)
9292
}
@@ -95,12 +95,12 @@ export const StatementPage = () => {
9595
valueTruncated
9696
valueCopyable
9797
/>
98-
{item.subscription.credit && item.subscription.credit.amount.amount > 0 ? (
98+
{item.subscriptionItem.credit && item.subscriptionItem.credit.amount.amount > 0 ? (
9999
<Statement.SectionContentDetailsListItem
100100
label={localizationKeys(
101101
`${localizationRoot}.billingPage.statementsSection.itemCaption__proratedCredit`,
102102
)}
103-
value={`(${item.subscription.credit.amount.currencySymbol}${item.subscription.credit.amount.amountFormatted})`}
103+
value={`(${item.subscriptionItem.credit.amount.currencySymbol}${item.subscriptionItem.credit.amount.amountFormatted})`}
104104
/>
105105
) : null}
106106
</Statement.SectionContentDetailsList>

0 commit comments

Comments
 (0)