2017 © Pedro Peláez
 

library ipsp-php

Payment Service Provider SDK

image

kosatyi/ipsp-php

Payment Service Provider SDK

  • Thursday, February 15, 2018
  • by kosatyi
  • Repository
  • 2 Watchers
  • 8 Stars
  • 569 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 16 % Grown

The README.md

IPSP PHP SDK

Flexible software development kit that covers e-commerce for businesses of all types and support popular CMS modules for fast integration in existing infrastructure., (*1)

, (*2)

Installation

System Requirements

PHP 5.2 and later., (*3)

Dependencies

SDK require the following extension in order to work properly:, (*4)

Manual Installation

If you do not use Composer, you can download the latest release. Or clone from GitHub the latest developer version, (*5)

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

Then include autoload file in your project., (*6)

<?php
require_once('/path/to/ipsp-php/autoload.php');

Composer

If you’re using Composer, you can run the following command:, (*7)

composer require kosatyi/ipsp-php

Or add dependency manually in composer.json, (*8)

{
  "require": {
    "kosatyi/ipsp-php":"^1.1"
  }
}

Quick Start

Import library to your project file., (*9)

<?php
// Manually installed project
require_once 'ipsp-php/autoload.php';
// If you are install SDK with composer
require_once 'vendor/autoload.php';

Define constants in project file or import from custom location., (*10)

<?php
define('MERCHANT_ID' , 'your_merchant_id');
define('MERCHANT_PASSWORD' , 'password');
define('IPSP_GATEWAY' , 'your_ipsp_gateway');

Create Ipsp_Client instance by passing configuration properties:, (*11)

  • MERCHANT_ID - Checkout Merchant ID from provider admin panel.
  • MERCHANT_PASSWORD - Merchant password
  • IPSP_GATEWAY - Choose provider gateway.
<?php
$client = new Ipsp_Client( MERCHANT_ID , MERCHANT_PASSWORD, IPSP_GATEWAY );

Create Ipsp_Api instance by passing Ipsp_Client instance:, (*12)

<?php
$ipsp   = new Ipsp_Api( $client );

Finally create bootstrap file init.php with content below:, (*13)

<?php
require_once 'vendor/autoload.php';
define('MERCHANT_ID' , 'YOUR_MERCHANT_ID');
define('MERCHANT_PASSWORD' , 'PAYMENT_KEY' );
define('IPSP_GATEWAY' , 'api.fondy.eu');
$client = new Ipsp_Client( MERCHANT_ID , MERCHANT_PASSWORD, IPSP_GATEWAY );
$ipsp   = new Ipsp_Api( $client );

Basic Usage Example

<?php
require_once('path/to/init.php');
$data = $ipsp->call('checkout',array(
  'order_id'    => 'orderid-111222333',
  'order_desc'  => 'Simple checkout page',
  'currency'    => $ipsp::USD ,
  'amount'      => 2000, // 20 USD
  'response_url'=> sprintf('http://shop.example.com/result.php')
))->getResponse();
// redirect to checkout page
$data->redirectToCheckout();

Handling response

Create page result.php with code below:, (*14)

<?php
require_once('path/to/init.php');
$result = $api->call('result');
if( $result->validResponse() ){
    exit(sprintf('<pre>%s</pre>',$result->getResponse()));
}

Follow project on:

Author

Stepan Kosatyi, stepan@kosatyi.com, (*15)

Stepan Kosatyi, (*16)

The Versions

15/02 2018

dev-master

9999999-dev https://ipsp-php.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • ext-curl *
  • php >=5.2.0

 

The Development Requires

by Stepan Kosatyi

21/07 2017

2.0.0.x-dev

2.0.0.9999999-dev https://ipsp-php.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0
  • ext-curl *

 

The Development Requires

by Stepan Kosatyi

21/07 2017

1.1.7

1.1.7.0 https://ipsp-php.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0
  • ext-curl *

 

The Development Requires

by Stepan Kosatyi

13/07 2017

1.1.6

1.1.6.0 http://www.kosatyi.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0
  • ext-curl *

 

The Development Requires

by Stepan Kosatyi

07/06 2017

1.1.5

1.1.5.0 http://www.kosatyi.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • php >=5.6.0
  • ext-curl *

 

The Development Requires

by Stepan Kosatyi

07/06 2017

1.1.3

1.1.3.0 http://www.kosatyi.com/

Payment Service Provider SDK

  Sources   Download

MIT

The Requires

  • php >=5.6.0
  • ext-curl *

 

The Development Requires

by Stepan Kosatyi