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

Overview

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

You might also like...
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

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

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

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

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

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

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

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

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.

Releases(V1.0.4)
Owner
Zepson Technologies
Supporting the developers community
Zepson Technologies
Laravel charts is a package to simplify the use of charts.

Laravel Charts Laravel charts is a package to simplify the use of charts. Features Autoregister your charts Customize routing, middleware and prefix t

Datalogix 2 Aug 5, 2022
Razorpay payment gateway integration in laravel with submit form and storing details in payment table.

Integrating razorpay payment gateway in laravel with submit form and storing payment details in payment table. How to settup the project in your local

Mohammed-Thamnees 3 Apr 15, 2021
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

Stripe Samples 337 Jan 2, 2023
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

cybercog 879 Dec 30, 2022
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

cybercog 39 Sep 29, 2022
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

Tinkerun 327 Dec 29, 2022
Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications

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

Rahmat Waisi 4 Jan 26, 2022
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

Mahdi Jedari 5 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.

null 686 Dec 28, 2022
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

F9 Web Ltd. 441 Jan 5, 2023