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

Documentation? #23

Open
oeed opened this issue Aug 15, 2017 · 2 comments
Open

Documentation? #23

oeed opened this issue Aug 15, 2017 · 2 comments

Comments

@oeed
Copy link

oeed commented Aug 15, 2017

I'd really love to use this, but even just a tiny little bit of example code would be very helpful. I've no idea how I'm meant to even create a client instance after digging through the code (particularly regarding CredentialStorageInterface).

@bakura10
Copy link
Member

Hey @danizord , when you have a bit of time could you write a minimum documentation? :)

@45617
Copy link

45617 commented Mar 6, 2024

Better late than never? 😂

        $account_id = 1234;
        $refresh_token = '5678';
        $referenceId = 'zfr-lightspeed-retail';

        // Initialize storage with valid access token
        $storage = new InMemoryCredentialStorage([
            $referenceId => new Credential($referenceId, $account_id, 'valid', $refresh_token)
        ]);
        $config    = [
            'client_id'     => 'foo',
            'client_secret' => 'bar',
            'reference_id'   => $referenceId
        ];
        $client = LightspeedRetailClient::fromDefaults($storage, $config);

        $response = $client->GetCustomers();

I don't think this is canonical since it doesn't use the dependency injection, but at least it works.

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

3 participants