question

Loyal Loops avatar image
Loyal Loops asked Loyal Loops commented

How to detect country on EU installations

Hi all,

We're developing for the EU market, and we need to differentiate by country of installation (for differing legal regulation, translation, different currency symbols, etc).

As far as I can tell the Clover SDK doesn't offer a clear way to determine the country of installation. What is the recommended method to distinguish between countries (Eg, UK vs IRL) in our apps?

10 |2000

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

Miguel avatar image
Miguel Deactivated answered Loyal Loops commented

You should be able to get merchant address, which includes country, from the merchant info.

3 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.

Loyal Loops avatar image Loyal Loops commented ·

If this is the recommended approach, do you know of any restrictions on the values that might be present in the country field? For example "Great Britain" vs "UK" vs "United Kingdom" ?

0 Likes 0 ·
Bejoy Nair avatar image Bejoy Nair commented ·

You should read the locale from merchant information. It is present within the properties node of merchant. Also, there is a difference while reading it from API and from SDK. (Country, API) = (IRELAND,en-IE) (UNITED KINGDOM,en-GB) (GERMANY,de-DE) (UNITED STATES,en-US). For SDK just replace the '-' with underscore i.e '_'.

0 Likes 0 ·
Loyal Loops avatar image Loyal Loops commented ·

Thanks! That's a great answer!

We ended up solving the problem by identifying the merchant's current SubscriptionID via the REST API, since subscriptions have to made anew for each country. (I'm not sure if the SDK makes the SubscriptionID available as well.)

0 Likes 0 ·
Bejoy Nair avatar image
Bejoy Nair answered

You will get following information from Merchant details:-

  1. Country
  2. Currency
  3. Locale
  4. Timezone.

This information is enough for knowing the country details of that Merchant.

10 |2000

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