Skip to content

Commit

Permalink
fix(analytic-util): convert the brands and billingAddressRequiredFiel…
Browse files Browse the repository at this point in the history
…ds to string when exists
  • Loading branch information
longyulongyu committed Aug 19, 2024
1 parent aaf031e commit 532ffa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lib/src/core/Analytics/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const getCardConfigData = (cardProps: CardElementProps): CardConfigData =
}

// Probably just for development - in real life we wouldn't expect the number of supported brands to push the endpoint limit on 128 chars
let brandsStr = brands.toString();
let brandsStr = brands?.toString();
if (brandsStr.length > 128) {
brandsStr = brandsStr.substring(0, 124);
}
Expand All @@ -144,7 +144,7 @@ export const getCardConfigData = (cardProps: CardElementProps): CardConfigData =
...(billingAddressAllowedCountries?.length > 0 && { billingAddressAllowedCountries: billingAddressAllowedCountries.toString() }),
billingAddressMode: billingAddressModeValue,
billingAddressRequired,
billingAddressRequiredFields: billingAddressRequiredFields.toString(),
billingAddressRequiredFields: billingAddressRequiredFields?.toString(),
brands: brandsStr,
challengeWindowSize,
disableIOSArrowKeys,
Expand Down

0 comments on commit 532ffa3

Please sign in to comment.