question

pranit avatar image
pranit asked Jeffrey Blattman answered

How to get Merchant latitude and longitude using MerchantAddress in clover device

I want merchant geolocation coordinates like latitude and longitude. I am using MerchantAddress class for that but app is getting crashed here is my code
MerchantAddress address = new MerchantAddress();
address = merchant.getAddress();
double latit = address.getLatitude();
double longi = address.getLongitude();
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.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered
Although the fields are there, we do not populate that information. I suspect we had plans at some point to provide that but I do not know the history.

Your app is probably crashing since those methods return null and you are trying to autobox them to a primitive type.

There are external services you can use to get a lat, long from an address. You may need to pay for the service.
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