2017 © Pedro Peláez
 

library izettle-api

Izettle API PHP Client

image

laulamanapps/izettle-api

Izettle API PHP Client

  • Sunday, April 29, 2018
  • by LauLaman
  • Repository
  • 2 Watchers
  • 3 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 9 Versions
  • 11 % Grown

The README.md

Zettle by PayPal API

The Zettle by PayPal API provides a simple integration of the Zettle by PayPal API for your PHP project., (*1)

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License, (*2)

Installation

With composer, add:, (*3)

$ composer require laulamanapps/izettle-api

Run Tests

To make sure everyting works you can run tests:, (*4)

$ composer test

Usage

Get yourself an access token. you'll need an clientId and clientSecret for this (to get one apply here) for performance benefits, it might be wise to store the access token in a cache like Redis., (*5)

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

$izettleClient = new GuzzleIzettleClient(new Client(), 'clientId', 'clientSecret');
$accessToken = $izettleClient->getAccessTokenFromUserLogin('john.doe@example.com', 'password');

//-- store $accessToken in cache

$productClient = IzettleClientFactory::getProductClient($iZettleClient);
$library = $productClient->getLibrary();

Make call with existing AccessToken

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

$accessToken = ...; //-- Get from cache

$izettleClient = new GuzzleIzettleClient(new Client(), 'clientId', 'clientSecret');
$izettleClient->setAccessToken($accessToken);

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

Upgrading

From v0.9 to v1.0

Version 1.0 requires PHP 8.1 and uses first-class Enums. This is a breaking change., (*6)

If you're using the enums, make sure you replace calls to get with an instance reference:, (*7)

-if ($payout->getPeriodicity() === Periodicity::get(Periodicity::DAILY)) {
+if ($payout->getPeriodicity() === Periodicity::DAILY) {

Credits

iZettle Api has been developed by LauLaman., (*8)

The Versions

29/04 2018

dev-moneyphp-1.3-compatible

dev-moneyphp-1.3-compatible

Izettle API PHP Client

  Sources   Download

MIT

The Requires

 

The Development Requires

13/12 2017
13/12 2017
29/10 2017

dev-ClientFactory

dev-ClientFactory

Izettle API PHP Client

  Sources   Download

MIT

The Requires

 

The Development Requires

26/10 2017

dev-ImageClient

dev-ImageClient

Izettle API PHP Client

  Sources   Download

MIT

The Requires

 

The Development Requires

26/10 2017