PHPackages                             sparkproxy/spark-sdk-php - 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. [API Development](/categories/api)
4. /
5. sparkproxy/spark-sdk-php

ActiveLibrary[API Development](/categories/api)

sparkproxy/spark-sdk-php
========================

SparkProxy Open API SDK for PHP

0.14.3(1mo ago)067MITPHPPHP &gt;=5.3.3

Since May 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/yungoo/spark-sdk-php)[ Packagist](https://packagist.org/packages/sparkproxy/spark-sdk-php)[ Docs](http://developer.sparkproxy.com/)[ RSS](/packages/sparkproxy-spark-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (41)Used By (0)

Sparkproxy OpenApi SDK for PHP
==============================

[](#sparkproxy-openapi-sdk-for-php)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![GitHub release](https://camo.githubusercontent.com/b96112e79a02f9a5583222c1e8775f3e4fee6e66425391ad64be8b71b2dfe489/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f737061726b706f78792f737061726b2d73646b2d7068702e7376673f6c6162656c3d72656c65617365)](https://github.com/yungoo/spark-sdk-php/releases)[![Latest Stable Version](https://camo.githubusercontent.com/862fd843df20a5fdbcb6d3f0d118fb8bcea95f09e5c43d23f268a8a9ab9b18e2/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f737061726b70726f78792e737667)](https://packagist.org/packages/sparkproxy/spark-sdk-php)[![Total Downloads](https://camo.githubusercontent.com/95a2868ec1f83370c1d03ac45e1b0046945670ed6b60754f6f1acfeb74f90fc3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737061726b70726f78792f737061726b2d73646b2d7068702e737667)](https://packagist.org/packages/sparkproxy/spark-sdk-php)

安装
--

[](#安装)

推荐使用 `composer` 进行安装。可以使用 composer.json 声明依赖，或者运行下面的命令。SDK 包已经放到这里 [`sparkproxy/spark-php-sdk`](https://packagist.org/packages/sparkproxy/spark-sdk-php) 。

```
$ composer require sparkproxy/spark-sdk-php
```

运行环境
----

[](#运行环境)

sparkproxy SDK版本PHP 版本0.xcURL extension, 5.3 - 5.6, 7.0 - 7.4, 8.0-8.1使用方法
----

[](#使用方法)

### 创建代理

[](#创建代理)

```
use SparkProxy\Auth;
use SparkProxy\Config;
use SparkProxy\Open\SparkProxyClient;

$supplierNo = 'test0001';
$secretKey = 'qwertyuiop123456op123456';

$auth = new Auth($supplierNo, $secretKey);
$client = new SparkProxyClient($auth, Config::QA_API_HOST);

list($ret, $err) = $client->getProductStock(103);
if ($err == null) {
    if (count($ret['data']) > 1) {
        $product = $ret['data'][1];
        list($ret, $err) = $client->createProxy("test_240518_03", $product["productId"], 2,
            $product["duration"] * 2, $product["unit"], $product["countryCode"], $product["areaCode"], $product["cityCode"]);
        if ($err !== null) {
            var_dump($err);
            exit;
        }

        list($ret, $err) = $client->getOrder($ret['data']["reqOrderNo"]);
        var_dump($ret);
        var_dump($err);
    }
}
```

测试
--

[](#测试)

```
$ ./vendor/bin/phpunit tests/SparkProxy/Tests/
```

常见问题
----

[](#常见问题)

- `$error` 保留了请求响应的信息，失败情况下 `ret` 为 `none`, 将 `$error` 可以打印出来，提交给我们。
- API 的使用 demo 可以参考 [examples](https://github.com/yungoo/spark-sdk-php/tree/master/examples)。

代码贡献
----

[](#代码贡献)

详情参考[代码提交指南](https://github.com/yungoo/spark-sdk-php/blob/master/CONTRIBUTING.md)。

贡献记录
----

[](#贡献记录)

- [所有贡献者](https://github.com/yungoo/spark-sdk-php/contributors)

联系我们
----

[](#联系我们)

- 如果需要帮助，请提交工单（在portal右侧点击咨询和建议提交工单，或者直接向  发送邮件）
- 如果发现了bug， 欢迎提交 [issue](https://github.com/yungoo/spark-sdk-php/issues)
- 如果有功能需求，欢迎提交 [issue](https://github.com/yungoo/spark-sdk-php/issues)
- 如果要提交代码，欢迎提交 pull request

代码许可
----

[](#代码许可)

The MIT License (MIT).详情见 [License文件](https://github.com/yungoo/spark-sdk-php/blob/master/LICENSE).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance89

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~7 days

Total

40

Last Release

58d ago

### Community

Maintainers

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

---

Top Contributors

[![yungoo](https://avatars.githubusercontent.com/u/2208687?v=4)](https://github.com/yungoo "yungoo (57 commits)")

---

Tags

sdksparkproxystatic house proxy

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sparkproxy-spark-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/sparkproxy-spark-sdk-php/health.svg)](https://phpackages.com/packages/sparkproxy-spark-sdk-php)
```

###  Alternatives

[paddlehq/paddle-php-sdk

Paddle's PHP SDK for Paddle Billing.

53301.7k](/packages/paddlehq-paddle-php-sdk)[appwilio/cdek-sdk

CDEK API SDK (cdek.ru)

406.5k](/packages/appwilio-cdek-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

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