PHPackages                             roybinhsu/ds-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. roybinhsu/ds-sdk

ActiveLibrary

roybinhsu/ds-sdk
================

dian san sdk

066PHP

Since Apr 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/RoybinHsu/ds)[ Packagist](https://packagist.org/packages/roybinhsu/ds-sdk)[ RSS](/packages/roybinhsu-ds-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

环境
--

[](#环境)

```
PHP 7.4.7 (cli) (built: Jun 11 2020 18:46:58) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.7, Copyright (c), by Zend Technologies
    with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans
Composer version 2.3.5 2022-04-13 16:43:00

```

扩展引入
----

[](#扩展引入)

### 1. 直接引入

[](#1-直接引入)

```
$ composer require roybinhsu/ds-sdk

```

### 2. 自定义

[](#2-自定义)

```
$ git clone git@github.com:RoybinHsu/ds.git
$ cd ds
$ composer install
$ composer dump-autoload

# 在项目中使用
require_once 'vendor/autoload.php';

```

### 3-1 基础使用

[](#3-1-基础使用)

```
use ds\DsClient;
use ds\requests\OrderQueryRequest;
use ds\models\OrderQueryModel;

$appKey    = '18768798988098103478928374';
$appSecret = 'asdfasdfasdfas9876918739asdf';
$client    = new DsClient($appKey, $appSecret);
// 方法一
$requestModel = new OrderQueryModel();
$requestModel->refOid = '123456678090980980,98798678676157468';
// 方法二
// $data = [
//     'refOid' => '123456678090980980,98798678676157468'
// ];
// $requestModel = new OrderQueryModel($data);
// 方法三
// $requestModel = new OrderQueryModel();
// $requestModel->setRefOid('123456678090980980,98798678676157468');
$request  = new OrderQueryRequest($requestModel);
$response  = $client->send($request);

```

### 3-2 监听事件使用

[](#3-2-监听事件使用)

```
$data = [
    'refOid' => '123456678090980980,98798678676157468'
];
$requestModel = new OrderQueryModel($data);
$request  = new OrderQueryRequest($requestModel);
$client->event->on(\ds\Event::BEFORE_SEND, function($options) {
    // TODO 发送请求前业务逻辑
});
$client->event->on(\ds\Event::AFTER_SEND, function($args) {
    // TODO 发送请求后业务逻辑
});
// $client->event->off(Event::BEFORE_SEND);
$response = $client->send($request);

###

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f121f75a686b2ccb311208993c2aee7a04976725ef0d2799828c757b25657754?d=identicon)[xushunbin](/maintainers/xushunbin)

### Embed Badge

![Health badge](/badges/roybinhsu-ds-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/roybinhsu-ds-sdk/health.svg)](https://phpackages.com/packages/roybinhsu-ds-sdk)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
