Download the PHP package meilunzhi/baiwang-sdk without Composer

On this page you can find all versions of the php package meilunzhi/baiwang-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package baiwang-sdk

Baiwang PHP SDK

PHP 7.4 compatible SDK for Baiwang OpenAPI invoice services. The PHP implementation is exposed as a Composer package from php/src; the existing TypeScript source is retained only as a protocol reference.

Requirements

Installation

Install from a published package:

For this repository, generate the local autoloader first:

Basic usage

The equivalent factory entry point is also available:

API methods

PHP method Baiwang method
getToken() baiwang.oauth.token
refreshToken() baiwang.oauth.token
authenticate() Reads cache or obtains a token
invoicing($params) baiwang.output.invoice.issue
queryInvoice($params) baiwang.output.invoice.query
queryLayout($params) baiwang.output.format.query
queryCloudHeadUp($params) baiwang.bizinfo.companySearch
preInvoice($params) baiwang.output.preinvoice.issue
voidInvoiced($params) baiwang.output.invoice.cancel
issueRedLetter($params) baiwang.output.redinvoice.issued
request($method, $params) Any supported OpenAPI method

All business methods take an associative PHP array. Use taxNo or taxId to populate orgId; a configured orgId takes precedence. Successful API envelopes return their data value directly. API errors throw Melon\Baiwang\Exception\ApiException, whose getResponse() method returns the unmodified API response.

Cache adapter

Pass an implementation of Melon\Baiwang\Contracts\CacheInterface as the constructor's third parameter or in cacheProvider. authenticate() stores access_token and refresh_token at baiwang_access_token_{appKey}, using the API's expires_in as the TTL.

HTTP adapter and testing

The default transport is cURL. To supply a framework HTTP client or mock requests, implement Melon\Baiwang\Contracts\HttpClientInterface and return an HttpResponse from post().


All versions of baiwang-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package meilunzhi/baiwang-sdk contains the following files

Loading the files please wait ...