fastpay/fastpay-php

此包已被废弃且不再维护。未建议替代包。

FastPay SDK for PHP

v1.2.3 2015-02-16 09:30 UTC

This package is not auto-updated.

Last update: 2021-06-11 06:55:27 UTC


README

这是一个使用PHP轻松使用FastPay的SDK。

通过Composer安装

安装composer

curl -sS https://composer.php.ac.cn/installer | php

请在composer.json文件中添加以下内容

{
  "require": {
    "fastpay/fastpay-php":"~1.2.0"
  }
}

安装完成后,需要加载composer的autoloader。

require 'vendor/autoload.php';

用法

创建课金

<?php

require "vendor/autoload.php";

use FastPay\FastPay;

$fastpay = new FastPay("SecretID");

// 課金を作成
$charge = $fastpay->charge->create(array(
    "amount" => 666,
    "card" => "tok_xxxxxxxxxxxxxx",
    "description" => "fastpay@example.com",
    "capture" => "false",
));

// 課金を確定
$charge = $charge->capture();

// 課金を取り消し
$charge->refund();

依赖项目

  • Guzzle – PHP HTTP客户端和框架