PHP code example of zgabievi / osmp

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

    

zgabievi / osmp example snippets


Gabievi\OSMP\OSMPServiceProvider::class

'OSMP' => Gabievi\OSMP\OSMPFacade::class

Route::get('billing', function () {
	// LISTENERS

	return OSMP::init();
})->middleware('osmp.auth');

Event::listen('osmp.*', function (...$args) {
	if ($args[0] == 'check') {
		// flash session data for check operation
		session()->flash('osmp', [
			'result' => 0,
			'data' => [
				'fullname' => 'Zura Gabievi',
				'account' => '000000'
			]
		]);
	} else {
		// flash session data for pay operation
		session()->flash('osmp', [
			'result' => 0,
			'data' => [
				'fullname' => 'John Doe',
				'account' => '000001'
			]
		]);
	}
});

return OSMP::Response(5);

php artisan vendor:publish