开发者

Detect currency based on user's location?

开发者 https://www.devze.com 2022-12-19 12:33 出处:网络
I am creating an international web application which users can subscribe to. I want subscription 开发者_C百科rates to vary based on the user\'s currency. If my user is in the US, they pay $19/month; i

I am creating an international web application which users can subscribe to. I want subscription 开发者_C百科rates to vary based on the user's currency. If my user is in the US, they pay $19/month; if in China, they pay some other rate. So, I am thinking I could detect the user's location, and from their location, I can detect their currency (via a location to currency map table in my database). If I can't detect their currency, then I'll force them to enter it before displaying subscription rates.

Does this seem like an acceptable solution? Will this be pretty reliable? If not, can anyone think of a better solution?


Seems good. Geolocation is pretty reliable, and the mapping from countries to currencies should be easy. I don't know whether such a mapping is already available somewhere, though.

Just make sure that you allow users to change the currency, in case your detection fails. Or they're trying to subscribe while they happen to be abroad, or something.


how to get the location of a user might be helpful

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号