iugu PHP 库

1.0.6 2015-11-25 10:36 UTC

This package is auto-updated.

Last update: 2024-09-29 05:35:50 UTC


README

Build status

通知

由于代码结构的修改,测试目前无法运行,且在 'examples' 文件夹中可用的示例已过时(这个问题将在未来的版本中修复)。

要求

  • PHP 5.4+

安装

下载库

git clone https://github.com/eng-assys/iugu-php

使用 Composer

$ composer require eng_assys/iugu:dev-master

Composer 的自动加载将处理剩余部分。

使用示例

1. 查找客户

require 'vendor/autoload.php';

\Iugu\Iugu::setApiKey('c73d49f9-6490-46ee-ba36-dcf69f6334fd'); // Ache sua chave API no Painel

\Iugu\Customer::fetch('8DCD9BE5DC8D4FFD9CE8FA6C0FCAC631');

2. 创建收费

use Iugu\Iugu;

use Iugu\Charge;

Iugu::setApiKey("c73d49f9-6490-46ee-ba36-dcf69f6334fd"); // Ache sua chave API no Painel

Charge::create([
    "token"=> "TOKEN QUE VEIO DO IUGU.JS OU CRIADO VIA BIBLIOTECA",
    "email"=>"your@email.test",
    "items" => [
      [
        "description"=>"Item Teste",
        "quantity"=>"1",
        "price_cents"=>"1000"
      ]
    ]
]);

文档

访问 iugu.com/documentacao 以获取参考

测试

  • 测试目前尚未更新。