Code Monkey home page Code Monkey logo

omnipay-pesapal's Introduction

Omnipay: Pesapal

Pesapal driver for the Omnipay PHP payment processing library

Maintainability Test Coverage Style CI Scrutinizer Code Quality

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Pesapal support for Omnipay. https://www.pesapal.com/ refer to the API docs here: http://developer.pesapal.com/

Install

Via Composer

$ composer require oneafricamedia/omnipay-pesapal

Basic Usage

Get the pesapal iframe/redirect URL

use Omnipay\Omnipay;


$url = Omnipay::create('Pesapal')
    ->setCredentials(
        'your_key', 
        'your_secret'
    )
    ->setCallbackUrl('https://example.com/callback')
    ->getUrl(
        '[email protected]',
        'my_reference',
        'description',
        100
    );

Check transaction status (from the pesapal ipn)

  1. configure & setup an endpoint to receive the ipn message from pesapal
  2. listen for the message and use getTransactionStatus (please handle the http GET vars accordingly)
use Omnipay\Omnipay;


$status = Omnipay::create('Pesapal')
    ->setCredentials(
        'your_key', 
        'your_secret'
    )
    ->getTransactionStatus(
        $_GET['pesapal_notification_type'],
        $_GET['pesapal_transaction_tracking_id'],
        $_GET['pesapal_merchant_reference']
    );
    
  1. $status will be either PENDING, COMPLETED, FAILED or INVALID. Handle these statuses in your application workflow accordingly.

TODO

  1. Test coverage
  2. add QueryPaymentStatusByMerchantRef support
  3. add QueryPaymentDetails support

omnipay-pesapal's People

Contributors

lucidlogic avatar matthewnessworthy avatar vusile avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lucidlogic vusile

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.