easybib/

stripe-php

此包已被弃用且不再维护。作者建议使用 stripe/stripe-php 包。

Stripe PHP 库 [非官方:PHP 5.3+ 克隆版]

dev-master 2013-10-30 12:42 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:20:38 UTC


README

此分支旨在与 PHP 5.3 兼容,并由 Stripe 维护。

测试

Build Status

安装

使用以下命令获取 Stripe PHP 绑定的最新版本

git clone https://github.com/easybib/stripe-php

或者使用 packagist.org 并将以下内容放入你的项目中的 composer.json

"require": {
  "easybib/stripe-php": "*"
}

要开始使用,将以下内容添加到你的 PHP 脚本中

require_once("/path/to/stripe-php/lib/Stripe/Autoload.php");
\Stripe\Autoload::register();

简单用法如下

require_once 'Stripe/Autoload.php';
\Stripe\Autoload::register();

Stripe\Base::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$myCard = array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2015);
$charge = Stripe\Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'usd'));
echo $charge;

文档

请参阅 https://stripe.com/api 获取最新文档。