question

kelvin avatar image
kelvin asked kelvin commented

How to determine the region on Clover device?

Is there anyway to determine the region (EU, US or Canada) on device using Android SDK?

Clover Android SDK
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Richelle Herrli avatar image
Richelle Herrli answered

In the Java SDK, you can use the `MerchantAddress` object to call `getCountry()`, which will determine which region they're in. As far as I know, there isn't an explicit call to check the region (North America, EUrope, or Latin America), but each merchant UUID is tied to one specific address, which will be in one of our regions.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image
Jeffrey Blattman answered kelvin commented

It would help if you could explain why you want to know.


You seem to be mixing the concept of a region, which for Clover would be EU, LA (Latin America), or US... and countries (Canada, US). If you just want to know the country what Richelle said is correct.


EDIT: If you want to know the REGION, there's no a well-defined way accomplish that. One idea you won't like I'm sure is to build different flavors per region and include some bit in the app that identifies the region to which you published that app.

Another idea would be to use CloverAuth, and obtain AuthResult#baseUrl. This should be either api.clover.com, la.api.clover.com, or eu.api.clover.com (in addition to needing to account for sandbox, and any other env which you run).

Another idea would be to organize your subscriptions to identify the region... e.g. "free-eu" or something. Then obtain the subscriptions at runtime using AppsConnector#getApp().

Just ideas, I haven't tested these.

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kelvin avatar image kelvin commented ·

One of apps launched in both US/Canada and EU region, we try to find a way to determine the region (both device and merchant) in that app at runtime, so that different feature could turn on/off.


0 Likes 0 ·
Richelle Herrli avatar image Richelle Herrli ♦♦ kelvin commented ·

When Jeff talks about regions, he's talking about how Clover infrastructure currently divides our markets into North America (US and Canada), Europe, and Latin America (which may be better described as South America). But even within these regions, the roll out of new projects may be staggered. You will probably want to focus on country more than region, then, as products will roll out to different countries on different timelines due to all manner of constraints (e.x. tax, certifications, etc.).

0 Likes 0 ·
kelvin avatar image kelvin Richelle Herrli ♦♦ commented ·

Thanks for the email. we in fact are interested in the region market rather than country of that merchant belongs to.

0 Likes 0 ·
kelvin avatar image kelvin commented ·

Thanks for these ideas. they are very useful. i think both could work.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community