PHPackages                             yocome/alipay - 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. [Payment Processing](/categories/payments)
4. /
5. yocome/alipay

ActiveLibrary[Payment Processing](/categories/payments)

yocome/alipay
=============

支付宝支付SDK

261PHP

Since Nov 18Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

支付宝SDK
======

[](#支付宝sdk)

[官方文档](http://doc.open.alipay.com/doc2/alipayDocIndex.htm)
----------------------------------------------------------

[](#官方文档)

1. [手机网站支付](http://doc.open.alipay.com/doc2/detail?treeId=60&articleId=103564&docType=1)

Requirements
------------

[](#requirements)

1. PHP 5.4 或以上
2. 系统安装 CURL, OpenSSL `yum install curl curl-devel openssl openssl-devel`

Installtion
-----------

[](#installtion)

`composer require yocome/alipay`

Description
-----------

[](#description)

代码是下载官方的SDK，做了简单整理。目前只用到手机网站支付，其它以后慢慢整进来：）

Usage
-----

[](#usage)

```
$config = [
    'partner' => '2088208820882088',                        //合作身份者id，以2088开头的16位纯数字
    'seller_id' => '2088208820882088',                      //收款支付宝账号，一般情况下收款账号就是签约账号
    'private_key_path' => 'key/rsa_private_key.pem',        //商户的私钥（后缀是.pen）文件相对路径
    'ali_public_key_path' => 'key/alipay_public_key.pem',   //支付宝公钥（后缀是.pen）文件相对路径
    'cacert' => 'key/cacert.pem',                           //ca证书路径地址，用于curl中ssl校验
    ];

$parameter = [
    "notify_url"	=> 'http://商户网关地址/notify_url.php',  //服务器异步通知页面路径
    "return_url"	=> 'http://商户网关地址/return_url.php',  //页面跳转同步通知页面路径
    "out_trade_no"	=> 20151118012346,                      //商户订单号
    "subject"	=> 'iPhone 6s 64G',                         //订单名称
    "total_fee"	=> '0.01',                                  //付款金额
    "show_url"	=> 'http://www.商户网址.com/myorder.html',    //商品展示地址
    ];

$pay = new \Yocome\Alipay\AlipayApi($config);

//设置订单参数
$pay->setParameter($parameter);

//创建支付请求
echo $pay->createRequest();

```

License
-------

[](#license)

MIT License

Contact
-------

[](#contact)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

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/4340650?v=4)[Yong](/maintainers/yocome)[@yocome](https://github.com/yocome)

### Embed Badge

![Health badge](/badges/yocome-alipay/health.svg)

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[oxid-esales/amazon-pay-module

AmazonPay module for OXID

1824.3k](/packages/oxid-esales-amazon-pay-module)

PHPackages © 2026

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