Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in getPurchaseClient() example #37

Open
hanfry1996 opened this issue Sep 11, 2019 · 0 comments
Open

Error in getPurchaseClient() example #37

hanfry1996 opened this issue Sep 11, 2019 · 0 comments
Assignees

Comments

@hanfry1996
Copy link

Hello, first at all, thanks for all this code, it's so usefull.

But I tried to run an example like this:

include('vendor/autoload.php');

use GuzzleHttp\Client;
use LauLamanApps\IzettleApi\GuzzleIzettleClient;
use LauLamanApps\IzettleApi\IzettleClientFactory;

$izettleClient = new GuzzleIzettleClient(new Client(), 'myClientID', 'myClientSecret');
$accessToken = $izettleClient->getAccessTokenFromUserLogin('[email protected]', 'mypassword.');

$purchaseClient = IzettleClientFactory::getPurchaseClient($iZettleClient);
$library = $purchaseClient->getPurchaseHistory();

This is the error that it gives to me:

Fatal error: Uncaught TypeError: Argument 1 passed to LauLamanApps\IzettleApi\IzettleClientFactory::getPurchaseClient() must implement interface LauLamanApps\IzettleApi\IzettleClientInterface, null given, called in /homepages/35/d696135976/htdocs/print/izettle/pru.php on line 14 and defined in /homepages/35/d696135976/htdocs/print/izettle/src/IzettleClientFactory.php:48 Stack trace: #0 /homepages/35/d696135976/htdocs/print/izettle/pru.php(14): LauLamanApps\IzettleApi\IzettleClientFactory::getPurchaseClient(NULL) #1 {main} thrown in /homepages/35/d696135976/htdocs/print/izettle/src/IzettleClientFactory.php on line 48

@LauLaman LauLaman self-assigned this Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants