Closed emotec closed 2 years ago
the very simple Xero::get('contacts'); also falls over with the same error.
Xero::getTenantName(); works correctly!
Thanks for raising this, I'll look into this and come back to you.
getAccessToken() function 'invalid_grant' is returned from Xero ?
is the grant type wrong? 'grant_type' => 'refresh_token',
also this line if ($token->expires <= $now) {
I cant find $token->expires anywhere in the code?
If I take this 'if' statement out of the code then the API call works correctly. So perhaps there is a problem with the token expiry check?
Also I have a very similar website using the same Xero API. This works perfectly. The laravel-xero code is a little earlier though. Before the multitenancy additions.
I've identified the issue I'll push up a fix.
I've released v1.1.0 can you check if this works for you now?
Hi David
I'm now getting this msg
Also there are now 2 tokens in the database the first one is missing some data
if ($tenantData != null) { $data = array_merge($data, $tenantData); }
Seems to be a repeated if statement here? Is that right?
thx Mark
that's a duplicate line, I'll remove it.
Can you clear out the 2 rows and re-connect
Hi David... that didnt make any difference unfortunately. I deleted the token data from the database and commented out the repeated lines.
Same result... same error and 2 tokens
thx Mark
okay, I'll do further testing after work.
thx David!
Hi David I removed the extra token in the database and chnaged the id of the remaining token from 3 to 1!... Now its working again.
Hi,
I am having the same issue, using multi tenant, and after a short time a new record is added to the database with ID of 1, again with missing tenant ID/Name etc.. only the tokens populated.
Assuming it must be being created in storeToken but not sure why it's doing it, if you have any idea's would be appreciated! On first connect to Xero it works perfectly then about 20mins later it creates a second record.
Thanks Robin
When trying to create a new contact I am getting this error. My site connects to Xero correctly and stores the token data in the database.