Git Product home page Git Product logo

laravel-dpo's Introduction

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

laravel-dpo's People

Contributors

abdallamohammed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.