bavix / laravel-wallet

It's easy to work with a virtual wallet
https://bavix.github.io/laravel-wallet/
MIT License
1.14k stars 230 forks source link

How can I change balance for language? #171

Closed krutyosila closed 4 years ago

krutyosila commented 4 years ago

Hello there,

I want to show the user balance differently by language.

Users have only one wallet. If the user changes language, I want the balance to appear as defined for that language. en/page $user->balance = 1 USD

de/page $user->balance = 0.92 EUR

tr/page $user->balance = 6.90 TRY

xx/page $user->balance = (1 X xxrate)

If is it possible ?

rez1dent3 commented 4 years ago

Hey. You can implement on your side. To work with the exchange rate, there is an addition: https://bavix.github.io/laravel-wallet/#/laravel-wallet-swap

krutyosila commented 4 years ago

Thanks, but I don't want to make exchange and create another wallet for users. if user's change language, user show language's currency on user->balance method.

rez1dent3 commented 4 years ago

There is no magic. You still have to develop a service that will accept a wallet and give balance. The wallet has data on the currency, and you already convert the funds into the desired currency. In your case, the wallet balance will not be stable. It will change when the exchange rate changes.

krutyosila commented 4 years ago

You are right. Thank you for your interest.