Download the PHP package femlabs/laravel-dpo without Composer

On this page you can find all versions of the php package femlabs/laravel-dpo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-dpo

DPO (Direct Pay Online) Laravel Package

Femlabs DPO package will help you add DPO Payment API to your Laravel Application in easy way and simple.

How the package work

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

Installation

composer require femlabs/laravel-dpo

Publish the required file

php artisan vendor:publish --provider="Femlabs\Dpo\DpoServiceProvider"

Run Migration

php artisan migrate

Environment variables

DPO_COMPANY_TOKEN ="9F416C11-127B-4DE2-AC7F-D5710E4C5E0A"
DPO_SERVICE_TYPE = "3854"
DPO_SERVICE_DESCRIPTION = "Test Product"
DPO_LIVE_MODE = true
DPO_DEFAULT_CURRENCY = "TZS"
DPO_DEFAULT_COUNTRY = "Tanzania"
DPO_BACK_URL ="/cancel"
DPO_REDIRECT_URL =  "/callback"

Usage

use the below dependancy in your controller

use Femlabs\Dpo\Dpo;

How the package work

=> Create array data of your order in the controller

$data['companyRef'] = 'ORD' . '' . time(); //$params['invoiceid']; (On this line you can put uniq id of your service)
$data['paymentAmount'] = 100;
$data['customerFirstName'] = 'Filbert';
$data['customerLastName'] = 'Msaki';
$data['customerAddress'] = 'Ubungo Kibangu';
$data['customerCity'] = 'Dar Es Salaam';
$data['customerPhone'] = '07********';
$data['customerEmail'] =  '[email protected]';
$data['customerCountry'] = 'TZ'; //ISO 2 letter code
$data['customerZip'] = '0000';
$data['serviceDescription'] =  'Test Order';

=> Call the DPO function

$dpo =new Dpo();

You can choose either to save the response in the database or to make direct payment in the DPO package

=> Go Direct to DPO payment page

return $dpo->directPaymentPage($data);

=> If you preffer to save details the follow the steps below.

1.Create payment token first and the redirect to payment page

$token = $dpo->createToken($data);
  1. Check token response and save to database

    if ($token['success'] === true) {
        $data['TransToken'] = $token['TransToken'];
    
        //Here you can save token details to database
    
        $verify = $dpo->verifyToken($data);
        if ($verify['success'] === true) {
            //Here you can save token details and verified data to database
    
            //Get payment url
            $payment_url = $dpo->getPaymentUrl($token);
            //redirect to payment page
            return redirect()->$payment_url;
        }
    }

    License

    This project is licensed under the MIT license.


All versions of laravel-dpo with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package femlabs/laravel-dpo contains the following files

Loading the files please wait ....