question

Felipe Rolvar avatar image
Felipe Rolvar asked parag commented

How to get owner details from clover?

I need to get the owner info like address, business name, registered phone number and email address. it is possible to get this data from clover sdk?
semi-integrationsMerchant
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

Lee Tickett avatar image
Lee Tickett answered parag commented
private Account account;
account = CloverAccount.getAccount(this);

private MerchantConnector merchantConnector;
merchantConnector = new MerchantConnector(this, account, null);

private Merchant merchant;
merchant = merchantConnector.getMerchant();

Then you can access details like;

merchant.getAccount().name
merchant.getPhoneNumber()
8 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.

Felipe Rolvar avatar image Felipe Rolvar commented ·

thanks for your reply, I'm doing that but now I'm getting error status code 403 App doesn't have required permission: package does not have permission MERCHANT_R

0 Likes 0 ·
Lee Tickett avatar image Lee Tickett Felipe Rolvar commented ·

How did you get the app onto your test device? (sideload?). You need to make sure you install from the app market and have the app configured from the developer dashboard to receive the merchant read permission.

0 Likes 0 ·
Felipe Rolvar avatar image Felipe Rolvar Lee Tickett commented ·

Yes, you are right, I side-loaded the app, that's correct thank you very much.

0 Likes 0 ·
marksalpeter avatar image marksalpeter commented ·

How do we access this information from a side-loaded apk. If that's impossible, how can we test this before pushing the feature live?

0 Likes 0 ·
Lee Tickett avatar image Lee Tickett marksalpeter commented ·

You have to upload an APK to the sandbox environment and install it through the app market.

0 Likes 0 ·
parag avatar image parag commented ·

Right now getting below info

Merchant{id=XYZ, name=Test 01, currency=USD, timeZone=Mountain Standard Time (America/Phoenix), 
account=Account {name=Test 01 | dev@clover.com (DEV), type=com.clover.account}, address=MerchantAddress{address1=Us Highway 46, address2=, address3=, city=Parsippany, state=NJ, zip=07054, country=US, deviceId=xxxxxx, phoneNumber=xxxxxx}


Can we get account's role type? I need role type for some specific operation

0 Likes 0 ·
bryanvargas avatar image bryanvargas ♦♦ parag commented ·

You have to use the employee class to read employee/roles

1 Like 1 ·
parag avatar image parag bryanvargas ♦♦ commented ·

Thanks its worked

EmployeeConnector employeeConnector = new EmployeeConnector(getApplicationContext(), account, null);
try {
List<Employee> employees = employeeConnector.getEmployees();
for (Employee employee : employees) {
String employeeId = employee.getId();
String employeeName = employee.getName();
AccountRole role = employee.getRole();
}
} catch (Exception e){
e.printStackTrace();
}
0 Likes 0 ·

Welcome to the
Clover Developer Community