A Laravel package to simplify using DPO Payment API in your application.

Last update: Oct 23, 2021

DPO (Direct Pay Online) Laravel Package

The best DPO Laravel package, simple Ever

Build Status

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.

Features

  • Create Payment Token (Initiate order at DPO servers)
  • Verify Payment Token (Check Transaction status)
  • Make Direct payment(Redirects order direct to DPO payment page)
  • Fetch Payment Token
  • Database migrations to save transaction details
  • Much easy to use
  • Constantly updated

How It works

  1. Create payment token
  2. Verify token
  3. Redirect to DPO payment page
  4. Fetch response
  5. Done

The package does all this for you behind the scenes 😂

Basic Usage Example.

"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!😂 ">
 
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!😂

Installation

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

Configuration File'

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") ]; ">


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

Update .env File with Correct Informations

DPO_COMPANY_TOKEN = "YOUR_DPO_COMPANY_TOKEN"
DPO_ACCOUNT_TYPE = "YOUR_DPO_ACCONT_TYPE"
DPO_IS_TEST_MODE = "true/false"
DPO_BACK_URL ="YOUR APPLICATION_BACK_URL"
DPO_REDIRECT_URL =  "YAPPLICATION_REDIRECT_URL_AFTER_RESPONSE_FROM_DPO"

USAGE

  • create array of your order which match parrameters in the following exaple
"TZS", 'customerFirstName'=> "Novath", 'customerLastName'=> "Thomas", 'customerAddress'=> "Tanzania", 'customerCity'=>"Dodoma", 'customerPhone'=> "0752771650", 'customerEmail'=> "[email protected]", 'companyRef'=> "34TESTREFF" ]; ">
$order = [
            'paymentAmount'=>"10000",
            'paymentCurrency'=> "TZS",
            'customerFirstName'=> "Novath",
            'customerLastName'=> "Thomas",
            'customerAddress'=> "Tanzania",
             'customerCity'=>"Dodoma",
            'customerPhone'=> "0752771650",
            'customerEmail'=> "[email protected]",
            'companyRef'=> "34TESTREFF"
        ];
  • Now you can choose to make direct payment or createToken First and then make payment
  • Starting with Direct Payment
   $dpo = new Dpo;
   return $dpo->directPayment($data); //this will redirect user to DPO Payment page
  • If you preffer to save details then this is the ideal step to follow [Generate Token, Make payment]
  • Get Token
      $token = $dpo->createToken($data); //return array of response with transaction code
      //you can save or do what ever you want with the response
  • Get payment Url
    $dpo->getPaymentUrl($token);
  • Redirect User to payment page
   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

We would like more contributions to make the package more secure and readable.

License

MIT

GitHub

https://github.com/Zepson-Technologies/dpo-laravel
You might also like...

SSLCommerz Payment gateway library for Laravel framework

SSLCommerz SSLCommerz Payment gateway library for Laravel framework. Official documentation is here. install composer require sam-asif/sslcommerz Pro

Oct 28, 2021

Integrasi Payment Gateway Midtrans dengan Framework Laravel 8

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Aug 12, 2022

Integerating Laravel with Payment Gateways Paypal, Stripe, Paymob, Paytabs and MyFatoorah

This Repo is for integerating Laravel with some Payment gateways Integeration with For these integerations you need to provide env variables from your

Jul 12, 2022

A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Aug 13, 2022

Laravel package to find performance bottlenecks in your laravel application.

Laravel package to find performance bottlenecks in your laravel application.

Laravel Meter Laravel Meter monitors application performance for different things such as requests, commands, queries, events, etc and presents result

Aug 5, 2022

Laravel comments - This package enables to easily associate comments to any Eloquent model in your Laravel application

Laravel comments - This package enables to easily associate comments to any Eloquent model in your Laravel application

May 12, 2022

A simple API documentation package for Laravel using OpenAPI and Stoplight Elements

Laravel Stoplight Elements Easily publish your API documentation using your OpenAPI document in your Laravel Application. Installation You can install

Jul 22, 2022

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

Aug 11, 2022

Laravel package that converts your application into a static HTML website

Laravel package that converts your application into a static HTML website

phpReel Static Laravel Package phpReel Static is a simple Laravel Package created and used by phpReel that converts your Laravel application to a stat

Jul 7, 2022
Backend application using Laravel 9.x REST APIs for games topup from digiflazz.com and payment gateway using xendit.co

TOPUP - Laravel 9.x REST API Documentation is still on progress. For now, you can fork this postman collection Installation Clone this project git clo

Jul 31, 2022
Learn how to accept a payment from customers around the world with a variety of payment methods.

Accept a payment Learn how to securely accept payments online. This repository includes examples of 2 types of integration types. Prebuilt Checkout pa

Aug 11, 2022
Laravel Ban simplify blocking and banning Eloquent models.
Laravel Ban simplify blocking and banning Eloquent models.

Laravel Ban Introduction Laravel Ban simplify management of Eloquent model's ban. Make any model bannable in a minutes! Use case is not limited to Use

Aug 9, 2022
Laravel Nova Ban simplify blocking and banning Eloquent models.
Laravel Nova Ban simplify blocking and banning Eloquent models.

Laravel Nova Ban Introduction Behind the scenes cybercog/laravel-ban is used. Contents Installation Usage Prepare bannable model Prepare bannable mode

Aug 12, 2022
A new way of Running Tinker. Simplify the Web Artisan's workflow.
A new way of Running Tinker. Simplify the Web Artisan's workflow.

Tinkerun A new way of Running Tinker. Simplify the Web Artisan's workflow. inspired by Tinkerwell Download links Github Releases ?? If you are using V

Aug 8, 2022
Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications
Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications

پکیج اتصال به درگاه پرداخت زرین پال zarinpal.com برای اتصال به درگاه پرداخت اینترنتی زرین پال و استفاده از api های آن می توانید از این پکیج استفاده کن

Jan 26, 2022
Dedicated laravel package for Behpadakht Mellat bank payment service.
Dedicated laravel package for Behpadakht Mellat bank payment service.

Iranian Mellat bank full online payment service Dedicated laravel package for Behpadakht Mellat bank payment service. Features Event calls Log on chan

Apr 19, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

Aug 7, 2022
A simple package allowing for consistent API responses throughout your Laravel application
A simple package allowing for consistent API responses throughout your Laravel application

Laravel API Response Helpers A simple package allowing for consistent API responses throughout your Laravel application. Requirements PHP ^7.4 | ^8.0

Aug 15, 2022
A laravel wrapper for BnpParibas Mercanet payment gateway
A laravel wrapper for BnpParibas Mercanet payment gateway

Laravel Mercanet A laravel wrapper for BnpParibas Mercanet which provide a lightweight public api to process your online payments from your laravel ap

Jul 3, 2022