rorteg/blingsdk

PHP Bling API2 SDK

维护者

详细信息

github.com/rorteg/blingApi2

源代码

安装次数: 32,704

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 15

类型:git

dev-master 2015-09-29 04:25 UTC

This package is auto-updated.

Last update: 2024-09-07 17:43:12 UTC


README

用于与Bling ERP API 2集成的PHP SDK

要求

PHP 5.5.3或更高版本和Curl 7.32

安装

  • 在您的项目中下载仓库 git clone git@github.com:davicrystal/blingApi2.git
  • 将BlingSD.php脚本包含/导入到您的PHP类中,以使用这些方法

使用方法

//Importe a SDK em seu projeto
require_once('blingApi2/BlingSDK.php');

//Instâncie a classe BlingSDK
$apiBling = new BlingSDK;

//Defina a  API KEY
$apiBling->apiKey = "SUA API KEY JUNTO AO BLING";

可用方法

所有要发送给Bling以登记或更新产品、订单和发票的参数都必须定义为数组,以便所使用的方法在向Bling API 2发送数据之前将该数组转换为XML。

Bling API 2集成手册:https://www.bling.com.br/manuais-api

  • postProduct($arrayPreData, $strProductCode): 用于添加或更新产品的方法。

    • $arrayPreData: 要发送给Bling的产品参数,以数组形式发送,遵循Bling的布局。

    • $strProductCode是产品代码,仅在实际更新时提供。

  • postOrder($arrayPreData, $boolGerarNfe): 用于添加订单的方法。

    • $arrayPreData: 要发送给Bling的订单参数,以数组形式发送,遵循Bling的布局。

    • $boolGerarNfe: 若要生成与订单一起的发票,请提供"true"(字符串格式)。

  • postNf($arrayPreData): 用于添加发票的方法。

    • $arrayPreData: 要发送给Bling的发票参数,以数组形式发送,遵循Bling的布局。
  • getProduct($strProductCode, $responseFormat): 用于查询产品的方法。

    • $strProductCode: 要查询的产品代码。

    • $responseFormat: 提供响应格式"xml"或"json"。

  • getOrder($strOrderCode, $responseFormat): 用于查询订单的方法。

    • $strOrderCode: 要查询的订单代码。

    • $responseFormat: 提供响应格式"xml"或"json"。

  • getNf($strNfNumber, $responseFormat): 用于查询发票的方法。

    • $strNfNumber: 要查询的发票代码。

    • $responseFormat: 提供响应格式"xml"或"json"。

  • deleteProduct($strProductCode, $responseFormat): 用于删除产品的方法。

    • $strProductCode: 要删除的产品代码。

    • $responseFormat: 提供响应格式"xml"或"json"

贡献者

Davi Crystal | Digital UP | davicrystal@gmail.com | http://twitter.com/davicrystal