onfact/onfact-api-php

PHP 类,用于连接 onFact API

1.0.2 2017-04-06 17:55 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:52:53 UTC


README

Build

onFact-API-PHP

可用于连接 onFact API 的 PHP 类

支持的端点

  • 联系人(客户)
  • 联系人人员
  • 发票
  • 提案
  • 产品组
  • 产品
  • 文档事件
  • 附件

简单设置

使用 composer 安装

composer require onfact/onfact-php-api

包含 composer 自动加载(根据需要修改路径)

<?PHP
require_once('vendor/autoload.php');
?>

连接并使用 API

<?PHP
define('ONFACT_API_KEY', '...');
$onFact = new onFact\Api(ONFACT_API_KEY);
$id = $onFact->Customers->add(array(
    'Contact' => array(
        'name' => 'John Dhoe',
    )
));
$customer = $onFact->Customer->view($id);
echo $customer['Contact']['name']; // John Dhoe
?>

© onFact 会计软件