PHPackages                             daidai118/pay - 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. daidai118/pay

ActiveLibrary[Payment Processing](/categories/payments)

daidai118/pay
=============

Pay solution for Yii2, support Wxpay and Alipay

0.0.2(8y ago)03MITPHPPHP &gt;=5.5.0

Since Jan 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/daidai118/pay)[ Packagist](https://packagist.org/packages/daidai118/pay)[ RSS](/packages/daidai118-pay/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

yii2-pay
========

[](#yii2-pay)

Yii2 pay component, support [Alipay](https://alipay.com) and [Wxpay](https://pay.weixin.qq.com).

Install
-------

[](#install)

Composer:

```
composer require 'tlanyan/yii2-pay:*'

```

or add the following line to the `require` section of your composer.json:

```
"tlanyan/yii2-pay": "*"

```

Channels
--------

[](#channels)

### Alipay

[](#alipay)

The official SDK files is included in the repo, so you don't need to download the files from the Alipay website.

#### Usage

[](#usage)

Append the following codes to the `components` array in the config file:

```
'components' => [
    // other components,
    'alipay' => [
        'class' => 'tlanyan\Alipay',
            'appid' => 'your appid',
            'merchantRsaPrivateKeyFile' => 'file path to your private key',
            'alipayRsaPublicKey' => 'the alipay public rsa key',
            'notifyUrl' => 'alipay call back url',
            'logCategory' => 'log category',
    ],
],

```

#### Options

[](#options)

Alipay component accept these parameters:

- appid: **required**, the assigned appid by Alipay.
- alipayRsaPublicKey: **required**, the rsa public key from Alipay.
- merchantRsaPrivateKeyFile: **prefferd**, the merchant rsa private key file path.
- merchantRsaPrivateKey: the merchant rsa private key. If `merchantRsaPrivateKeyFile` is provided, the content is read from the file. **If you want to set private key manually, remember to remove the header,footer and break line symbols.**
- format: optional, Alipay response format. Valid values are: 'json'.
- notifyUrl: optional, Alipay call back URL.
- signType: optional, valid values are: 'RSA', 'RSA2'. Default value is 'RSA2'.
- logCategory: optional, log category. Default value is 'alipay'.

---

### Wxpay

[](#wxpay)

#### Usage

[](#usage-1)

Append the following codes to the `components` array in the config file:

```
'components' => [
    // other components,
    'wxpay' => [
        'class' => 'tlanyan\Wxpay',
            'appid' => 'your appid',
            'appkey' => 'app secret',
            'mchid' => 'merchant id',
            'notifyUrl' => 'Wxpay call back url',
            'logCategory' => 'log category',
    ],
],

```

#### Options

[](#options-1)

Wxpay component accept these parameters:

- appid: **required**, the assigned appid by Wxpay.
- appsecret: **required**, the app secret set in the merchant center.
- mchid: **required**, the merchant id.
- notifyUrl: **required**, Wxpay call back URL.
- signType: optional, valid values are: 'MD5', 'HMAC-SHA256'. Default value is 'HMAC-SHA256'.
- logCategory: optional, log category. Default value is 'wxpay'.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3046d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/748d439dca009370a83db41d6a505ca82eb1b49daadd66965c616d65f94d7f90?d=identicon)[daidai118](/maintainers/daidai118)

### Embed Badge

![Health badge](/badges/daidai118-pay/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)

PHPackages © 2026

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