Code Monkey home page Code Monkey logo

laravel-exact-online's People

Contributors

joshuadegier avatar justijndepover avatar kirkita avatar ovvessem avatar ricklambrechts avatar robert-abram avatar websmurf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-exact-online's Issues

Trying to reconnect the app with Exact Online

When trying to reconnect app with Exact online, I am always getting:
"Could not connect to Exact: Error 400: {"error":"invalid_request","error_description":"The refresh token expired at 11/3/2021 2:50:46 PM and it is now 7/31/2022 7:45:12 PM."}"
Any ideas how I can overcome this? I already tried to remove authorities in Exact Online itself, which had no result. The code stops at rule: websmurf/laravel-exact-online/src/Providers/LaravelExactOnlineServiceProvider.php, rule 80.

Only instantiate ExactOnline if it's required, not always

At this point if a connection error occurs (resulting in the infamous 401 Could not acquire or refresh tokens error) all other code will fail to execute as well (since it just stops at this).

Since we only need to check the connection if we actually use the ExactOnline object, we only need to instantiate the class at that point as well.

Issue with implementing the sdk on laravel 8.82.0

I am using laravel 8.82.0 on locahost and trying to implement laravel-exact-online sdk there. Also i am using wp database.

First of all using this command (composer require websmurf/laravel-exact-online) its not fully installed the sdk as its missed route and controller files . So i have tried create the route and controller manually and have implemented it within the project. After that when i am running http://127.0.0.1:8000/exact/connect it always giving following error: Route [login] not defined.

Here is the route code i made for latest laravel version which i put on routes/web.php :
Route::group(['middleware' => ['web','auth'] ], function(){
Route::get('/exact/connect', [ LaravelExactOnlineController::class ,'appConnect'])->name('exact.connect');
Route::post('/exact/authorize', [ LaravelExactOnlineController::class ,'appAuthorize'])->name('exact.authorize');
Route::get('/exact/oauth', [ LaravelExactOnlineController::class ,'appCallback'])->name('exact.callback');
});

when i am removing the 'auth' from the middleware then route is working but then its giving another error which is from view file : View [layouts.app] not found. (View: C:\xampp\htdocs\dashboard.automatezo\resources\views\vendor\laravelexactonline\connect.blade.php)

The sdk route code is of older version that may be the cause. Please help me with this.

Use with cron / task

I have a question regarding the use of task schedules in Laravel.

I created a job that uses your library to connect to Exact, with multi_user enabled. When I am logged in to my app I can start the job manually which fetches the latest data from Exact. That's working. Now, I want to schedule a task which executes the job every night. But I am strugling a bit. Somehow, I need to use an "User" in the sync job (to update the refresh tokens etc.).

What's the best approach for this?

Update:
For the sake of trial and error: I changed

return Auth::user();
to
return \App\Models\User::find(1) but that's not working. (I was planning to override this method, so I thought this was worth trying before creating the override class.)

refresh token expired

Hi, earlier our laravel application used another exact online API with a different client ID and secret. I am willing to reconnect the application with a new API with a different client ID and secret.
Willing to reconnect the application gives: Could not connect to Exact: Error 400: {"error":"invalid_request","error_description":"The refresh token expired at 10/11/2022 9:18:20 PM and it is now 10/28/2022 4:15:50 PM."}.
I have the impression the wrapper is willing to use an old token (of the previous API). The exact.api.json file is empty. Can I manually influence this somehow? Thanks

setDivision()

Hi there,

How can I utilize the $connection->setDivision($x) method from Picqer?

For the purpose of learning and understanding, I added this method to the LaravelExactOnline class, but it doesn't work:

public static function setDivision(Connection $connection, $division): void
{
    $connection->setDivision($division);
}

Invalid grant error after 5 minutes

Hi there!

I keep getting the following error. Even though it is only five minutes since a token was issued. Do you have any idea what this could be?

{ "error":"invalid_grant","error_description":"Token is not allowed, because of invalid or empty chainId" }

Thanks

Could not refresh tokens - Error 401

Hi,

When we try to use the library in just Laravel it works fine, but when we implement it in Queue's (async) after a couple of requests the library loses the refresh token.

Do you have any idea to fix this? The queue is configured to only run one task at a time to prevent tokens from being lost.

Acquiring new token fails if a token is not older than 30 days

Exact has a fairly new policy that if a token is not used for 30 days you should use a new authorization request in stead of a refresh token request:

https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Content-oauth-eol-oauth-devstep4
image

Could this be incorporated in this package? Right now, if you have a refresh token that is older than 30 days in your JSON config (stored on disk), the connection crashes on an error 400 because the refresh token is too old.

How to call Exact sync query instead of ordinary query?

Hi, we are having a sync of contacts and lots of products, we're calling a few endpoints after another and bumping into our rate limit. Exact has sync endpoints, how do we call them using this client? Thanks in advance

Could not acquire or refresh tokens [http 400]

Hi there,

Yesterday I succesfully deployed your Laravel wrapper to my Laravel-app (localhost). I was able to make queries to the Exact api. Today, I wanted to connect to the API again, but got the error "Could not acquire or refresh tokens [http 400]" after pressing the button "connect to Exact".

I am basically familair with the OAuth of Exact. Is there anything I can do manually to reconnect? I installed the package yesterday, so I believe i am running the latest version. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.