printfection/printfection-php

dev-master 2019-01-21 23:17 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:13:35 UTC


README

您可以在 http://printfection.com 注册 Printfection 账户。

要求

PHP 5.2 及以上。

Composer

您可以通过 Composer 安装绑定。将其添加到您的 composer.json

{
  "require": {
    "printfection/printfection-php": "1.*"
  }
}

然后安装

composer.phar install

要使用绑定,您可以使用 Composer 的 自动加载

require_once('vendor/autoload.php');

或手动

require_once('/path/to/vendor/printfection/printfection-php/lib/Printfection.php');

手动安装

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

git clone https://github.com/printfection/printfection-php

要使用绑定,将以下内容添加到您的 PHP 脚本中

require_once("/path/to/printfection-php/lib/Printfection.php");

入门指南

简单用法如下

Printfection::setApiKey('ACCESS_TOKEN');

$order = Printfection_Order::create(array(
    'campaign_id' => 1,
    'ship_to' => array(
            'name' => 'Herman Munster',
            'address' => '1313 Mockingbird Lane',
            'address2' => '#1200',
            'city' => 'Mockingbird Heights',
            'state' => 'California',
            'zip' => '90210',
            'country' => 'US',
            'email' => 'herman@printfection.com',
            'phone' => '3034597990'
        ),
    'lineitems' => array(
            array(
                    'item_id' => 1,
                    'size_id' => 1,
                    'quantity' => 13
                )
        )
));

echo $order;

文档

请参阅 http://printfection.github.io/API-Documentation/ 获取最新的文档。

致谢

此 API 客户端深受 (并基于) Stripe PHP 客户端库 的启发。特别感谢在该项目中工作的每一个人。