Package Data | |
---|---|
Maintainer Username: | modmanx |
Maintainer Contact: | mitja.robic@gmail.com (Mitja Robic) |
Package Create Date: | 2015-06-17 |
Package Last Update: | 2016-12-19 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-22 03:03:53 |
Package Statistics | |
---|---|
Total Downloads: | 32 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 5 |
Total Forks: | 0 |
Total Open Issues: | 2 |
add to providers in app.php ...
Datastat\MegaPOS\MegaPOSServiceProvider::class,
publish vendor ...
php artisan vendor:publish
register events in EventServiceProvider.php ...
'Datastat\MegaPOS\MegaPOSUpdateWasCalledEvent' => [
'App\Listeners\MegaPosUpdateWasCalledEventListener',
],
'Datastat\MegaPOS\MegaPOSStatusWasCalledEvent' => [
'App\Listeners\MegaPosStatusWasCalledEventListener',
],
'Datastat\MegaPOS\MegaPOSCancelTransactionWasCalledEvent' => [
'App\Listeners\MegaPOSCancelTransactionWasCalledEventCalledEventListener',
],
generate handlers ... [then delete the Events/Datastat folder, change namespace alias in handlers]
php artisan event:generate
routes visible for production
| GET|HEAD | megapos/update | megapos.update | Closure
| GET|HEAD | megapos/status | megapos.status | Closure
routes visible for testing [enable_test_routes = true in megapos.php config]
| GET|HEAD | megapos/test | megapos.test | Closure
| POST | megapos/init | megapos.init | Closure
| POST | megapos/cancel | megapos.cancel | Closure
| POST | megapos/process | megapos.process | Closure
| GET|HEAD | megapos/list-gateways | megapos.list | Closure
from IOC...
$megapos = App::make('megapos');
facade...
\MegaPOS
and now, the api...
$megapos->init($params);
$params rules:
'name' => array( 'required', 'alpha_dash', 'max:200' ),
'surname' => array( 'required', 'alpha_dash', 'max:200' ),
'email' => array( 'required', 'email', 'min:6', 'max:200' ),
'language' => array( 'required', 'in:si,en'),
'gateway' => array( 'required', 'in:ACTIVA_PGW,BANKART_PGW,DINERS,EFUNDS,MONETA,KLIK,ABANET'),
'tx_type' => array( 'sometimes|required', 'in:PURCHASE,ORDER'),
'amount' => array( 'required', 'numeric'),
$megapos->cancel($txId);
$megapos->listGateways();
exceptions to catch
Datastat\MegaPOS\MegaPOSException