定制 teamzac/zactax-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

teamzac/zactax-php

Composer 安装命令:

composer require teamzac/zactax-php

包简介

The official PHP client for the ZacTax API

README 文档

README

This is the official PHP client for the ZacTax API. Although it's in 1.0 release, there are likely to be some major (possibly breaking) changes to the library. See the roadmap below for more information.

Installation

The recommended method is to install via Composer:

composer require teamzac/zactax-php

Usage

The main entry point is the TeamZac\ZacTax\ZacTax object. The constructor accepts an array of options, some of which can be set fluently if you need to set them after instantiation:

$zactax = new TeamZac\ZacTax\ZacTax([
    'apiToken' => 'YOUR-API-TOKEN-HERE',
    'jurisdictionId' => 'JURISDICTION-ID*',
    'debug' => false, // set to true to debug HTTP calls
]);

Notes: * The Jurisdiction ID is recommended, but not strictly necessary when the API Token being used only has access to a single jurisdiction. Some users, however, will have access to multiple jurisdictions, in which case it is highly recommended that you set this option to ensure that you're receiving the correct data.

Fluently setting options

You can also fluently set some of the options if you need to do so after instantiation:

$zactax->setApiToken('1234')
    ->setJurisdictionId('jurisdiction-id')
    ->debug();

Accessing resources

You can as properties on the TeamZac\ZacTax\ZacTax instance:

$zactax->industries;
$zactax->jurisdictions;
$zactax->regions;
$zactax->taxpayers;
$zactax->users;

These resources provide a similar interface, although not necessarily identical as they do not all have the same information or level of detail. Common endpoints to these resources are:

$resource->all(); // fetch all records
$resource->find($id); // fetch a specific record

What follows is a quick list of endpoints for each resource.

Industries

$zactax->industries->payments($industryId, $options);
$zactax->industries->topTaxpayers($industryId);

Regions

$zactax->regions->payments($regionId, $options);
$zactax->regions->outlets($regionId);

Taxpayers

$zactax->taxpayers->payments($taxpayerId, $options);
$zactax->taxpayers->search($query, $options);

Users

$zactax->industries->me();
$zactax->industries->myJurisdictions();

We'll continue to flesh out the entire API over time, as this covers only a subset of the available data provided by ZacTax.

Roadmap

  • Continue filling out the rest of the available endpoints to provide 100% coverage
  • Return resources and collections from API calls that are more than the simple objects and arrays currently returned. For example, a taxpayers->find() call should return a Taxpayer instance, which can have things like ->getPayments() and ->updateName() methods on it.
  • Improve test coverage

Issues

If you notice any issues or problems, please report them. For security problems, please email support[at]zactax.com.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固