Skip to content

Commit

Permalink
Merge pull request #45943 from Expensify/blimpich-45942
Browse files Browse the repository at this point in the history
[No QA] update onyx field to use correct attribute
  • Loading branch information
luacmartins authored Jul 22, 2024
2 parents a680c8d + dd4cd56 commit 10194a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/SubscriptionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function hasInsufficientFundsError() {
* @returns The card to be used for subscription billing.
*/
function getCardForSubscriptionBilling(): Fund | undefined {
return Object.values(fundList ?? {}).find((card) => card?.isDefault);
return Object.values(fundList ?? {}).find((card) => card?.accountData?.additionalData?.isBillingCard);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/SubscriptionUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const FUND_LIST: FundList = {
accountData: {
cardYear: new Date().getFullYear(),
cardMonth: new Date().getMonth() + 1,
additionalData: {
isBillingCard: true,
},
},
},
};
Expand Down

0 comments on commit 10194a5

Please sign in to comment.