paywant/php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

paywant/php-sdk

最新稳定版本:1.0.2

Composer 安装命令:

composer require paywant/php-sdk

包简介

paywant api php client

README 文档

README

Latest Stable Version Build Status

To use this library, you must have an approved Paywant merchant account and store. You can access Paywant at https://www.paywant.com.

The document for this service is at https://developer.paywant.com

Requirement

PHP 5.6 and above. Curl

Install

Composer

Execute this command to use via Composer :

composer require paywant/php-sdk

Call composer autoload file for define:

require_once('vendor/autoload.php');

Composer Olmadan

If you don't want to use Composer, you can download the latest version of sdk from latest release.

To use, it will be sufficient to include the Bootstrap.php file in the folder you downloaded to your project.

require_once('/path/to/php-sdk/Bootstrap.php');

Example

Usage for Create Store Url

use Paywant\Config;
use Paywant\Model\Buyer;
use Paywant\Store\Create;

$config = new Config();
$config->setAPIKey('TEST'); // API KEY
$config->setSecretKey('TEST'); // API SECRET
$config->setServiceBaseUrl('https://secure.paywant.com');

// create request object with config
$request = new Create($config);

// buyer info.
$buyer = new Buyer();

$buyer->setUserAccountName('username');
$buyer->setUserEmail('customer@email.com');
$buyer->setUserID('1');

// set objects to Request
$request->setBuyer($buyer);

if ($request->execute())
{ // execute request
    try
    {
        echo $request->getResponse(); // json 
    }
    catch (Exception $ex)
    {
        echo $ex->getMessage();
    }
}
else
{
    echo $request->getError(); // got a error
}

To create a direct payment screen, you can check the example here.

For IPN you can check the example here.

统计信息

  • 总下载量: 4.65k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-01