PHPackages                             jiaoyix/jiaoyix-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jiaoyix/jiaoyix-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jiaoyix/jiaoyix-php
===================

Jiaoyix PHP Library

22PHP

Since Jun 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jiaoyix/jiaoyix-php)[ Packagist](https://packagist.org/packages/jiaoyix/jiaoyix-php)[ RSS](/packages/jiaoyix-jiaoyix-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/5ee3f2b386ad2611044e8db231fef5560a860ea4cd09704986c0cfb05df51194/68747470733a2f2f706f7365722e707567782e6f72672f6a69616f7969782f6a69616f7969782d7068702f762f737461626c65)](https://packagist.org/packages/jiaoyix/jiaoyix-php)[![Total Downloads](https://camo.githubusercontent.com/3317b355a3546f88f08f9d9abfcc6cbfa82b719a1891d6f079d411e4b2c6a006/68747470733a2f2f706f7365722e707567782e6f72672f6a69616f7969782f6a69616f7969782d7068702f646f776e6c6f616473)](https://packagist.org/packages/jiaoyix/jiaoyix-php)[![Latest Unstable Version](https://camo.githubusercontent.com/24e8e079331675e988523e1bbd093267df220f8a2866ca1e255d4274269a5644/68747470733a2f2f706f7365722e707567782e6f72672f6a69616f7969782f6a69616f7969782d7068702f762f756e737461626c65)](https://packagist.org/packages/jiaoyix/jiaoyix-php)[![License](https://camo.githubusercontent.com/f80f75226c3129ab8149ee4f5df595f0ec82e081cf5cf013121f5fe433eeadf0/68747470733a2f2f706f7365722e707567782e6f72672f6a69616f7969782f6a69616f7969782d7068702f6c6963656e7365)](https://packagist.org/packages/jiaoyix/jiaoyix-php)

Jiaoyix PHP SDK
===============

[](#jiaoyix-php-sdk)

简介
--

[](#简介)

lib 文件夹下是 PHP SDK 文件，
example 文件夹里面是简单的接入示例，该示例仅供参考。

版本要求
----

[](#版本要求)

PHP 版本 5.3 及以上

安装
--

[](#安装)

### 使用 Composer

[](#使用-composer)

在你自己的 `composer.json` 中添加以下代码

```
{
  "require": {
    "jiaoyix/Jiaoyix-php": "dev-master"
  }
}

```

然后执行

```
composer install

```

使用 Composer 的 autoload 引入

```
require_once('vendor/autoload.php');
```

### 手动引入

[](#手动引入)

```
require_once('/path/to/Jiaoyix-php/init.php');
```

接入方法
----

[](#接入方法)

### 初始化

[](#初始化)

```
\Jiaoyix\Jiaoyix::setApiKey('YOUR-KEY');
\Jiaoyix\Jiaoyix::setApiSecret('YOUR-SECRET');
\Jiaoyix\Jiaoyix::setAppId('YOUR-APP-ID');
```

### 创建 用户

[](#创建-用户)

```
\Jiaoyix\User::create(array(
    'description' => '描述',
    'email' => 'xxx@163.com',
    'phone' => '1xxxxxxxxxx',
    'shipping' => array(
        'address' => '具体地址',
        'name' => '姓名',
        'phone' => '收货人手机号',
    )
));
```

### 创建 商品

[](#创建-商品)

```
\Jiaoyix\Product::create(array(
    'seller' => 'usr_I5rlKWu6xOixVRVBFB5ifLv46K5e',
    'name' => 'iPhone7',
    'price' => '100000',
    'inventory' => 10
));
```

\### 创建 订单

```
\Jiaoyix\Order::create(array(
    'customer' => 'usr_W0sQmbBNcqW2e1U2JEumJ7C12XEt2j2e',
    'items' => array(
        'type' => 'product',
        'parent' => 'pro_INyG9ahiiTG6crCfGY6bG9Igaune'
        'quantity' => 1,
        'amount' => 400,
        'description' => 'iPhone 6s'
    )
));
```

\### 支付 订单

```
$order = \Jiaoyix\Order::retrieve('ord_G9p1Roy7T0H4R0TR2T6E2Cf4TKSe');
$params = array(
    'channel' => 'wx_pub',
    'extra' => array()
);
$order->pay($params);
```

\### 查询 支付

```
\Jiaoyix\Charge::retrieve('cha_4tVQUAaQIofT3tv4ufF4T354sT1e');
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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://avatars.githubusercontent.com/u/17404536?v=4)[jiaoyix](/maintainers/jiaoyix)[@jiaoyix](https://github.com/jiaoyix)

### Embed Badge

![Health badge](/badges/jiaoyix-jiaoyix-php/health.svg)

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

###  Alternatives

[typhoon/reflection

Static PHP reflection with phpDoc support

3954.6k6](/packages/typhoon-reflection)

PHPackages © 2026

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