yansongda/pay is a PHP payment SDK with plugin architecture covering Alipay, WeChat, Douyin, UnionPay, Jiangsu Bank, Tonglian, BestPay, and Apple Pay flows.
Overview
Pay is a PHP SDK that wraps major Chinese payment gateways with a redesigned v3 architecture emphasizing plugins, events, and PSR-compliant structure. It supports multi-tenant setups, Swoole, and unified configuration across providers.
Built-in plugins cover Alipay methods such as web, mobile, APP, scan, and transfer flows; WeChat public account, mini program, H5, scan, APP, and card payments; Douyin mini program trades; UnionPay channels; Jiangsu Bank aggregate pay; Tonglian unified pay; BestPay cashier; and Apple Pay token verification plus App Store server APIs.
Laravel, Hyperf, and Yii extension packages are documented separately. Automatic WeChat certificate retrieval and clear file layout aim to simplify adding new gateways through the plugin mechanism.
MIT-licensed code follows current Alipay and WeChat APIs and targets integrators who want consistent method names across providers.
Key features
- Plugin-based gateway architecture
- Alipay and WeChat coverage
- Douyin and UnionPay support
- Apple Pay token verification
- Swoole-compatible runtime
- Multi-tenant configuration
- Automatic WeChat certificate fetch
Use cases
- Adding Alipay checkout to PHP shops
- WeChat mini program payments
- Unified billing microservices
- Custom gateway plugins in PHP