定制 jmadsm/gateway-client 二次开发

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

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

jmadsm/gateway-client

最新稳定版本:v2.19.2

Composer 安装命令:

composer require jmadsm/gateway-client

包简介

PHP Client for JMA's Data API's.

README 文档

README

Install package

composer require jmadsm/gateway-client

Usage

<?php
use JmaDsm\GatewayClient\Client;
use JmaDsm\GatewayClient\ApiObjects\Product;
use JmaDsm\GatewayClient\ApiObjects\Category;

// Create singleton instance of the client
Client::getInstance( // get the config from JMA
     $config['base_url'],
     $config['access_token'],
     $config['tenant_token']
 );

$product    = Product::get('product_id');
$categories = Category::all();

while ($category = $categories->next()) { // The categories object will recursively fetch all categories in chuncks.
    echo $category->name;
}

Examples

See the examples directory on how to use the different object types.

How to test your changes before deploying?

Go to examples folder and create config.php file from example file. After you have added the nessecary data to config.php file, you can test the methods by running eg. "php examples/products.php" in the terminal. This will require that your machine has PHP version 8+ set up and configured.

New PHPUnit Feature for Testing

php vendor/bin/phpunit Tests/ClientTest.php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-20