Code Monkey home page Code Monkey logo

dpo-php's Introduction

DPO Group ™️ Payment API PHP SDK

Build Status

DPO Group Payment gateway wrapper. using api payment option Easily use with API without web or redirects

Development Support

If you need support in development, or you need a development team kindly contact us.

Documentation

To get the depth details of the api check API docs here.

Install

You can install the PHP SDK via composer or by downloading the source

Via Composer

The recommended way to install the SDK is with Composer.

composer require razor-informatics/dpo-php

Fetch Account Balance

use RazorInformatics\DPOPhp;

$companyToken  = 'YOUR_COMPANY_TOKEN';

$dpo = new DPOPhp($companyToken);

$results = $dpo->account()->balance('USD')

print_r($results);

Verify Transaction using Transaction Token

How to verify token

use RazorInformatics\DPOPhp;

$companyToken  = 'YOUR_COMPANY_TOKEN';

$dpo = new DPOPhp($companyToken);

$transactionToken = 'TRANSACTION_TOKEN_GIVEN';

$results = $dpo->token()->verify($transactionToken)

print_r($results);

Card Payment

make a direct card payment.

use RazorInformatics\DPOPhp;

$companyToken  = 'YOUR_COMPANY_TOKEN';
$serviceType = 5525; //SERVICE TYPE
$paymentAmount = 500;
$reference ="INV-1000";
$cardNumber = 5436886269848367
$cardExpiry = 1224;// format My example 0123 i.e. January 2023
$cardCvv = 123;
$customerFirstName='John';
$customerLastName = 'Doe';
$customerPhone ='';
$customerEmail = '';
$currency = 'USD';
$description = 'Flight booking for 5th January 2032'

$dpo = new DPOPhp($companyToken);

$results = $dpo->payment()->card($reference,$serviceType,$paymentAmount,$cardNumber,$cardExpiry,$cardCvv, $customerFirstName,$customerLastName,$customerPhone,$customerEmail,$currency,$description)

print_r($results);

Mpesa Payment

Make a direct mpesa payment, Currency is in KES (Kenya Shillings). In the results there us the transaction token, use it to verfiy payment went through.

use RazorInformatics\DPOPhp;

$companyToken  = 'YOUR_COMPANY_TOKEN';
$serviceType = 5525; //SERVICE TYPE
$reference ="INV-1000";
$paymentAmount = 500;
$customerFirstName='John';
$customerLastName = 'Doe';
$customerPhone = 2547100100100;
$customerEmail = '';
$description = 'Flight booking for 5th January 2032'

$dpo = new DPOPhp($companyToken);

$results = $dpo->payment()->chargeMpesa($reference,$serviceType,$paymentAmount, $customerFirstName,$customerLastName,$customerPhone,$customerEmail,$description)

print_r($results);

Remember to verify the transaction code to confirm if payment was successfully.

License

This package is open-sourced software licensed under the MIT license.

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.