dividebv/phpdivideiq 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dividebv/phpdivideiq

Composer 安装命令:

composer require dividebv/phpdivideiq

包简介

PHP connector library for Divide IQ

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

A PHP library to connect to Divide.IQ.

Installation

Composer

composer require dividebv/phpdivideiq

Example Usage

use DivideBV\PHPDivideIQ\DivideIQ;

$username = 'user';          // You will receive this from the provider.
$password = 'password';      // You will receive this from the provider.
$environment = 'production'; // May also be `staging` or an arbitrary URL.

// A file storing the connection status.
$file = new SplFileObject('persist.iq.txt', 'c+');

if ($file->getSize()) {
    // The file already exists, instantiate DivideIQ using the file.
    $divideIq = DivideIQ::fromFile($file);
} else {
    // File doesn't exist. Instantiate DivideIQ using the constructor.
    $divideIq = new DivideIQ($username, $password, $environment);
    $divideIq->setFile($file);
}

// Access a resource provided by this Divide.IQ server.
$result = $divideIq->request('stockbase_stock');

Debugging

If you implemented this library like the example above, then the first step in debugging would be to remove the persist.iq.txt file. It's a JSON file with connection credentials. Removing it will force the library to start afresh by logging in with your username and password.

Note: this only helps when the connection previously worked.

OrderRequest

$this->result = $this->divideIq->request('stockbase_orderrequest', $this->payload, 'POST');

$this->payload = array(
                'OrderDelivery' => (object) $orderDelivery,
                'OrderHeader' => (object) $orderHeader,
                'OrderLines' => $orderLines,
            );

Example

$this->payload = {
       "OrderDelivery": {
         "Person": {
         "Gender": "Male",
         "Initials": "J",
         "FirstName": "John",
         "SurnamePrefix": "",
         "Surname": "Doe",
         "Company": "Stockbase",
         "EmailAddress": ""
       },
       "Address": {
         "Street": "Koraalrood",
         "StreetNumber": "33",
         "StreetNumberAddition": "A",
         "ZipCode": "2718SB",
         "City": "Zoetermeer",
         "CountryCode": "NLD"
       }
     },
     "OrderHeader": {
       "OrderNumber": "1574425588",
       "TimeStamp": "2019-11-15T15:56:36.1187035Z"
     },
     "OrderLines": 
     [{
      "Number": "1",
      "EAN": "8700000000001",
      "Amount": "1",
      "Price": "1.95"
     },
     {
      "Number": "2",
      "EAN": "8700000000002",
      "Amount": "1",
      "Price": "2.95"
    },
    {
     "Number": "3",
     "EAN": "8700000000003",
     "Amount": "1",
     "Price": "3.95"
    }]
  }

dividebv/phpdivideiq 适用场景与选型建议

dividebv/phpdivideiq 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.77k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 dividebv/phpdivideiq 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 dividebv/phpdivideiq 我们能提供哪些服务?
定制开发 / 二次开发

基于 dividebv/phpdivideiq 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 12
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-08-06