kosatyi/ipsp-php
Composer 安装命令:
composer require kosatyi/ipsp-php
包简介
Payment Service Provider SDK
README 文档
README
Flexible software development kit that covers e-commerce for businesses of all types and support popular CMS modules for fast integration in existing infrastructure.
Installation
System Requirements
PHP 5.2 and later.
Dependencies
SDK require the following extension in order to work properly:
Manual Installation
If you do not use Composer, you can download the latest release. Or clone from GitHub the latest developer version
git clone git@github.com:kosatyi/ipsp-php.git
Then include autoload file in your project.
<?php require_once('/path/to/ipsp-php/autoload.php');
Composer
If you’re using Composer, you can run the following command:
composer require kosatyi/ipsp-php
Or add dependency manually in composer.json
{
"require": {
"kosatyi/ipsp-php":"^1.1"
}
}
Quick Start
Import library to your project file.
<?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.
<?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:
MERCHANT_ID- Checkout Merchant ID from provider admin panel.MERCHANT_PASSWORD- Merchant passwordIPSP_GATEWAY- Choose provider gateway.
<?php $client = new Ipsp_Client( MERCHANT_ID , MERCHANT_PASSWORD, IPSP_GATEWAY );
Create Ipsp_Api instance by passing Ipsp_Client instance:
<?php $ipsp = new Ipsp_Api( $client );
Finally create bootstrap file init.php with content below:
<?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:
<?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
kosatyi/ipsp-php 适用场景与选型建议
kosatyi/ipsp-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.82k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2017 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kosatyi/ipsp-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kosatyi/ipsp-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 11
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-16