PHP code example of lasserafn / laravel-intempus

1. Go to this page and download the library: Download lasserafn/laravel-intempus 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/ */

    

lasserafn / laravel-intempus example snippets

config/app.php
` php
\LasseRafn\LaravelIntempus\LaravelIntempusServiceProvider::class,
 php
$intempus = new Intempus();

$auth = $intempus->getAuth(); // returns url, hash and nonce in an array

return Redirect::to($auth['url']);
 php
Route::get('intempus/start', function(\Illuminate\Http\Request $request) {
    $intempus = new Intempus();
    
    $auth = $intempus->getAuth(); // returns url, hash and nonce in an array
    
    $request->session()->set('intempus_nonce', $auth['nonce']);
    
    return Redirect::to($auth['url']);
});
 php
Route::get('intempus/connect', function(\Illuminate\Http\Request $request) {
    $nonce = $request->session()->get('intempus_nonce');
    $token = $request->get('token');
    $pk = $request->get('pk');

   	$intempus = new Intempus($nonce, $token, $pk);
   	
   	dd( $intempus->products()->find(1) );
});