PHP code example of dream-technologies / telebirr-laravel-plus
1. Go to this page and download the library: Download dream-technologies/telebirr-laravel-plus 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/ */
dream-technologies / telebirr-laravel-plus example snippets
use DreamTechnologies\TelebirrLaravelPlus\Contracts\TelebirrClient;
use DreamTechnologies\TelebirrLaravelPlus\DTO\CreateOrderData;
Route::post('/checkout/telebirr', function (TelebirrClient $telebirr) {
$order = $telebirr->createOrder(new CreateOrderData(
title: 'Example order',
amount: '12.00',
));
return response()->json($order->toArray());
});
DreamTechnologies\TelebirrLaravelPlus\Events\TelebirrNotificationReceived
use DreamTechnologies\TelebirrLaravelPlus\Events\TelebirrNotificationReceived;
use Illuminate\Support\Facades\Event;
Event::listen(TelebirrNotificationReceived::class, function ($event) {
// Store $event->payload, then confirm final status with queryOrder.
});
bash
php artisan vendor:publish --tag=telebirr-config
text
POST /api/telebirr/create-order
POST /api/telebirr/query-order
POST /api/telebirr/notify
bash
php artisan serve --host=0.0.0.0 --port=8001