Skip to content

Commit

Permalink
Merge pull request #45598 from tienifr/fix/45309
Browse files Browse the repository at this point in the history
  • Loading branch information
blimpich authored Jul 22, 2024
2 parents 134422a + 792bad5 commit 6bd5dc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/pages/settings/Subscription/CardSection/CardSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import * as User from '@libs/actions/User';
import DateUtils from '@libs/DateUtils';
import Navigation from '@libs/Navigation/Navigation';
import {getPaymentMethodDescription} from '@libs/PaymentUtils';
import * as SubscriptionUtils from '@libs/SubscriptionUtils';
import * as Subscription from '@userActions/Subscription';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -113,7 +114,7 @@ function CardSection() {
medium
/>
<View style={styles.flex1}>
<Text style={styles.textStrong}>{translate('subscription.cardSection.cardEnding', {cardNumber: defaultCard?.accountData?.cardNumber})}</Text>
<Text style={styles.textStrong}>{getPaymentMethodDescription(defaultCard?.accountType, defaultCard?.accountData)}</Text>
<Text style={styles.mutedNormalTextLabel}>
{translate('subscription.cardSection.cardInfo', {
name: defaultCard?.accountData?.addressName,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Subscription/CardSection/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getBillingStatus(
translate: <TKey extends TranslationPaths>(phraseKey: TKey, ...phraseParameters: PhraseParameters<Phrase<TKey>>) => string,
accountData?: AccountData,
): BillingStatusResult | undefined {
const cardEnding = accountData?.cardNumber ?? '';
const cardEnding = (accountData?.cardNumber ?? '')?.slice(-4);

const amountOwed = SubscriptionUtils.getAmountOwed();

Expand Down

0 comments on commit 6bd5dc4

Please sign in to comment.