Skip to content

Error in getPurchaseClient() example #37

Description

@hanfry1996

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions