tjmugova / laravel-dpo
Provides DPO Payment integration for Laravel
Requires
- php: >=7.4|^8.0
- illuminate/events: ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/notifications: ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/queue: ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/support: ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-04-14 09:51:28 UTC
README
A laravel package for integrating DPO Payment Gateway API to your application.
Installation 🚥
Add the package to your composer.json
"require": {
...
"tjmugova/laravel-dpo": "{version}"
},
Or just run composer require
$ composer require tjmugova/laravel-dpo
Configuration
Add your DPO Token, Payment Url, API Url, and Currency .env
:
DPO_API_URL=https://secure.3gdirectpay.com/API/v6/ # always required DPO_PAYMENT_URL=https://secure.3gdirectpay.com/payv2.php # always required DPO_TOKEN=57466282-EBD7-4ED5-B699-8659330A6996 # always required DPO_SERVICE_ID=1234
Advanced configuration
Run php artisan vendor:publish --provider="Tjmugova\Dpo\DpoProvider"
/config/dpo.php
Usage ✅
For full documentation, please refer to DPO Public API Docs
Create Token
use Tjmugova\Dpo\Facades\Dpo;
...
$token=Dpo::token();
$token->addService([
'serviceType' => 1111,
'serviceDescription' => 'Invoice',
'serviceDate' => \Carbon\Carbon::now()->format("Y/m/d h:i"),
]);
$response = $token->createToken([
'paymentAmount' => 200,
'customerFirstName' => 'Test',
'companyRef' => '15',
'paymentCurrency' => 'USD',
'redirectURL' => 'https://example.com',
'backURL' => 'https://example.com',
]);
Redirect After Successfuly Token Request
return redirect($response['RedirectURL']);
Verify Token
You can verify a token received above. The method takes various parameters as specified in the DPO API docs.
$token->verifyToken([ 'transToken' => $response['transToken'], ]);
NOTE:
If you find any bugs or you have some ideas in mind that would make this better. Please don't hesitate to create a pull request.
If you find this package helpful, a simple star is very much appreciated.
MIT LICENSE