mintance / ipsp-php
Payment Service Provider PHP SDK
1.0.4
2017-07-08 08:57 UTC
Requires
- php: >=5.0
Requires (Dev)
- phpdocumentor/phpdocumentor: 2.*
- phpunit/phpunit: 4.7.*
This package is not auto-updated.
Last update: 2025-06-22 05:14:33 UTC
README
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 with Composer
composer require mintance/ipsp-php
Quick Start
<?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
Some other ipsp examples: https://github.com/kosatyi/ipsp-php-examples.git