Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-set display currency for level 1 users based on phone number prefix #4271

Closed

Conversation

Prakhar-Agarwal-byte
Copy link

@Prakhar-Agarwal-byte Prakhar-Agarwal-byte commented Apr 7, 2024

Fixes #4252

Matches the countryCode in phoneMetadata received from Twilio with currency using country-to-currency package and then updates the default display currency for the new user

@Prakhar-Agarwal-byte Prakhar-Agarwal-byte changed the title [WIP] Auto-set display currency for level 1 users based on phone number prefix Auto-set display currency for level 1 users based on phone number prefix Apr 8, 2024
// Set display currency to match phone numbers country code
const countryCode = (phoneMetadata?.countryCode || "US") as Countries
const currency = countryToCurrency[countryCode]
account.displayCurrency = currency as DisplayCurrency
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to validate against our list of currencies (we dont support all the currencies)

Signed-off-by: Prakhar Agarwal <prakharagarwal3031@gmail.com>
@vindard
Copy link
Contributor

vindard commented Apr 17, 2024

@Prakhar-Agarwal-byte thanks for the contribution! I just updated the branch to remove some merge conflicts. Will you be continuing with this PR? There's some feedback from @dolcalmi to address

@vindard
Copy link
Contributor

vindard commented Apr 19, 2024

Closing in favour of a different approach we took to tackle this in #4309 and GaloyMoney/price#67

@vindard vindard closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-set display currency for level 1 user based on phone number prefix
3 participants