diff --git a/src/XeroSiteConfigExtension.php b/src/XeroSiteConfigExtension.php
index d26e347..436baba 100644
--- a/src/XeroSiteConfigExtension.php
+++ b/src/XeroSiteConfigExtension.php
@@ -30,23 +30,23 @@ public function updateCMSFields(FieldList $fields)
$fields->addFieldsToTab('Root.Xero', [
ReadonlyField::create('XeroAccessToken', 'Access token')
->setDescription(sprintf(
- 'Link to a xero account',
+ 'Link to a new xero account',
XeroFactory::singleton()->getRedirectUri()
))
]);
if ($this->owner->XeroAccessToken) {
- $provider = XeroFactory::singleton()->getProvider();
$tenants = [];
+ $tenantRecords = XeroFactory::singleton()->getTenants($this->owner->XeroAccessToken);
- foreach ($provider->getTenants($this->owner->XeroAccessToken) as $tenant) {
- $tenants[$tenant->id] = $tenant->name;
+ foreach ($tenantRecords as $tenant) {
+ $tenants[$tenant->id] = $tenant->tenantName;
}
$fields->addFieldsToTab('Root.Xero', [
DropdownField::create(
'XeroTenantId',
- 'XeroTenantId',
+ 'Xero Tenant',
$tenants
)
]);