Coder Social home page Coder Social logo

ipsp-php's Introduction

IPSP (PHP) SDK

Payment service provider

A payment service provider (PSP) offers shops online services for accepting electronic payments by a variety of payment methods including credit card, bank-based payments such as direct debit, bank transfer, and real-time bank transfer based on online banking. Typically, they use a software as a service model and form a single payment gateway for their clients (merchants) to multiple payment methods. read more

Installation

git clone git@github.com:cloudipsp/ipsp-php.git

Quick Start

<?php
require_once 'ipsp-php/autoload.php';
define('MERCHANT_ID' , 'your_merchant_id');
define('MERCHANT_PASSWORD' , 'test');
define('IPSP_GATEWAY' , 'your_ipsp_gateway');
$client = new Ipsp_Client( MERCHANT_ID , MERCHANT_PASSWORD, IPSP_GATEWAY );
$ipsp   = new Ipsp_Api( $client );

Generate Signature

<?php
function getSignature( $merchant_id , $password , $params = array() ){
 $params['merchant_id'] = $merchant_id;
 $params = array_filter($params,'strlen');
 ksort($params);
 $params = array_values($params);
 array_unshift( $params , $password );
 $params = join('|',$params);
 return(sha1($params));
}

Generate Checkout

<?php
$order_id = 'testproduct10002';
$data = $ipsp->call('checkout',array(
 'order_id'    => $order_id,
 'order_desc'  => 'Short Order Description',
 'currency'    => $ipsp::USD ,
 'amount'      => 2000, // 20 USD
 'response_url'=> sprintf('http://shop.example.com/checkout/%s',$order_id)
))->getResponse();
// redirect to checkoutpage
header(sprintf('Location: %s',$data->checkout_url));

API Methods

Accept purchase (hosted payment page)

$data = $ipsp->call('checkout',array());

Accept purchase (merchant payment page)

$data = $ipsp->call('pcidss',array());

Purchase using card token

$data = $ipsp->call('recurring',array());

Payment report

$data = $ipsp->call('reports',array());

Order Refund

$data = $ipsp->call('reverse',array());

Check payment status

$data = $ipsp->call('status',array());

Card verification

$data = $ipsp->call('verification',array());

Order capture

$data = $ipsp->call('capture',array());

P2P card credit

$data = $ipsp->call('p2pcredit',array());

Examples

Checkout ipsp examples https://github.com/kosatyi/ipsp-php-examples.git

ipsp-php's People

Contributors

has-well avatar kosatyi avatar masiandr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ipsp-php's Issues

Callback signature validation

Hi, how to validate signature of final response (on callback)? Could u make example of a code? Because it seem that it does not work as request signature creation.

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.