Giter VIP home page Giter VIP logo

pesapal-php's Introduction

PesaPal PHP SDK

PHP SDK for implementing the PesaPal API.

Usage

Installation

include the pesapal.php file in your application
require_once('pesapal.php');

Configuration

At the top of your code, configure the Pesapal object
PesaPal::config( $env, $consumer_key, $consumer_secret, $callback_url );

Parameter Name Parameter Description Parameter Type Possible/Default Value
$env System Environment string sandbox/live
$consumer_key Pesapal Consumer Key string behdklejdkjdw
$consumer_secret Pesapal Consumer Secret string ncjdbckdcdhcjdcvjldhckadlxhska
$callback_url Site Callback Endpoint/Link string https://yoursiteurl.tld/process_ipn

Payment Form

Create a form with the following fields:

Field Name Field Type Possible/Default Value
amount number/text 100
type text MERCHANT
description text Order Description
reference number/text 001
first_name text John
last_name text Doe
email email [email protected]
phone tel 254700000000

Process Payment

Call the iframe() method where you would like to render the Pesapal iframe
PesaPal::iframe();

Process IPN Response

Update Database

Create a function to update your database with payment details - this function must return a boolean (true on success, false on failure). The function takes the response data an an argument.

Process IPN

Call the mehod on your callback url, passing the name of the callback function above as an argument
PesaPal::process_ipn( $callback );

Licencing

MIT(LICENSE)

pesapal-php's People

Contributors

maukoese avatar

Stargazers

 avatar

Watchers

 avatar  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.