PHP code example of socialiteproviders / zettle

1. Go to this page and download the library: Download socialiteproviders/zettle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

socialiteproviders / zettle example snippets


'zettle' => [
  'client_id' => env('ZETTLE_CLIENT_ID'),
  'client_secret' => env('ZETTLE_CLIENT_SECRET'),
  'redirect' => env('ZETTLE_REDIRECT_URI')
],

Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('zettle', \SocialiteProviders\Zettle\Provider::class);
});

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Zettle\ZettleExtendSocialite::class.'@handle',
    ],
];

return Socialite::driver('zettle')->redirect();

$user = Socialite::driver('zettle')->user();
$user->id; // 6c2828b9-c939-4713-8aad-17e1ef68bc96
$user->user["organizationUuid"]; // 138a9091-a154-4cf5-a32a-55d8a76b8e32

Socialite::driver('zettle')->disconnect($accessToken);