Giter Club home page Giter Club logo

lipisha-php-sdk-updated's Introduction

Lipisha Payments PHP SDK

This package provides bindings for the Lipisha Payments API (http://developer.lipisha.com/)

Features

  • Send money
  • Acknowledge transactions
  • Send SMS
  • Get Float
  • Get Balance
  • Charge card transactions
  • Search transactions
  • Search customers
  • Add users
  • Add payment accounts and withdrawal accounts

Installation

This package can be installed using composer

composer require lipisha/sdk

Or added to your composer dependencies:

{
    "require": {
        "lipisha/sdk": "^1.0"
    },
}

For existing composer projects, you can immediately start using lipisha:

$lipisa = new \Lipisha\Lipisha("<API-KEY>", "<API-SIGNATURE>", "<ENVIRONMENT>")

For all other usecases, you can include the generated composer class autoloader.

require_once "vendor/autoload.php"

Examples

IPN callback examples are in the examples directory:

https://github.com/lipisha/lipisha-php-sdk/tree/master/examples

Quick start

$lipisha = new \Lipisha\Lipisha("<YOUR API KEY>", "<YOUR API SIGNATURE>", "LIVE");
// To connect to the sandbox, pass the environment asm ``TEST`` instead.

// Get balance
$response = $lipisha.getBalance();
print_r($response)
$balance = $response->content["balance"];

// Send money
$payout_account = "033111";
$response = $lipisha->send_money($payout_account, "0722123456", 500);
$status = $response->status; //SUCCCESS or FAIL

// Acknowledge a transaction
$response = $lipisha->confirm_transaction("TX98089890");
$status = $response->status; //SUCCESS or FAIL
$content = $response->content; //Transaction details

Running Tests

Running tests requires php unit and setting up environment variables for authentication:

First, run composer to install dependencies:

composer install

Then set up environmental variables for authentication:

export LIPISHA_API_KEY="<YOUR LIPISHA API KEY>"
export LIPISHA_API_SIGNATURE="<YOUR LIPISHA API SIGNATURE>"

Run the tests:

phpunit tests/LipishaTest.php

Majority of tests require setting up parameters in the test suite.

See class documentation for detailed API. Refer to Lipisha API for parameters required for each method.

lipisha-php-sdk-updated's People

Contributors

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