A Laravel package to simplify using DPO Payment API in your application. https://dpogroup.com
MIT License
This is the package that will help you add DPO Payment API to your Laravel Application, We are open to contribution and support to make it better.
Basic Usage Example.
<?php
use Zepson\Dpo\Dpo;
$dpo = new Dpo();
$order = [
'paymentAmount' => "10000",
'paymentCurrency' => "TZS",
'customerFirstName' => "Novath",
'customerLastName' => "Thomas",
'customerAddress' => "Tanzania",
'customerCity' => "Dodoma",
'customerPhone' => "0752771650",
'customerEmail' => "[email protected]",
'companyRef' => "34TESTREFF"
];
// Now make payment
$dpo->directPayment($data);
// Its done! Simple right! 😂
Install the package Via Composer
composer require zepson/dpo-laravel
Now You can Publish the configuration File and Migration
php artisan vendor:publish --provider="Zepson\Dpo\DpoServiceProvider" --tag="dpo-laravel-migrations"
Migrate The Database table [OPTIONAL]
php artisan migrate
<?php
return [
"company_token" => env("DPO_COMPANY_TOKEN", "9F416C11-127B-4DE2-AC7F-D5710E4C5E0A"),
"account_type" => env("DPO_ACCOUNT_TYPE", "3854"),
'is_test_mode' => env("DPO_IS_TEST_MODE", true),
"back_url" => env("DPO_BACK_URL"),
"redirect_url" => env("DPO_REDIRECT_URL")
];
The above Details are for Test/Sandbox environment taken from DPO public documentation
DPO_COMPANY_TOKEN = "YOUR_DPO_COMPANY_TOKEN"
DPO_ACCOUNT_TYPE = "YOUR_DPO_ACCONT_TYPE"
DPO_IS_TEST_MODE = "true" # true|false
DPO_BACK_URL ="YOUR_APPLICATION_BACK_URL"
DPO_REDIRECT_URL = "APPLICATION_REDIRECT_URL_AFTER_RESPONSE_FROM_DPO"
$order = [
'paymentAmount' => "10000",
'paymentCurrency' => "TZS",
'customerFirstName' => "Novath",
'customerLastName' => "Thomas",
'customerAddress' => "Tanzania",
'customerCity' => "Dodoma",
'customerPhone' => "0752771650",
'customerEmail' => "[email protected]",
'companyRef' => "34TESTREFF"
];
$dpo = new Dpo;
return $dpo->directPayment($data); // this will redirect user to DPO Payment page
$token = $dpo->createToken($data); // return array of response with transaction code
// you can save or do what ever you want with the response
$dpo->getPaymentUrl($token);
return Redirect::to($payment_url);
As [Novath Thomas] always says
There is a huge difference between sysem security and complications, Complication hurts, API should'nt be complicated Thats one of the primary AIM of the introduction of APIs
This project is licensed under the MIT license.