每当我想使用 Xero SDK 功能进行 PHP 集成时,我都想跳过零的身份验证过程。目前,每当我的令牌过期时,我都必须通过 Xero 登录重新进行身份验证。我想跳过这个过程。
我已经从这个 git 链接复制了 authntication.php、callback.php 和 storage.php 。我正在将此代码用于 SDK 调用
$storage = new StorageClass();
$xeroTenantId = (string)$storage->getSession()['tenant_id'];
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken((string)$storage->getSession()['token']);
$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
new GuzzleHttp\Client(),
$config
);
$result = $apiInstance->getContacts($xeroTenantId);