fenghuohuo / payment
支付sdk集合
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/fenghuohuo/payment
Requires
- php: >=7.0.0
Requires (Dev)
- phpunit/phpunit: @stable
This package is auto-updated.
Last update: 2025-12-25 18:11:16 UTC
README
Installation
composer require "fenghuohuo/payment" -vvv
Usage
channel 支付平台(支付宝/微信)
| 支付渠道 | 参数 |
|---|---|
| 支付宝APP支付 | alipay |
| 付宝web支付 | alipay_wap |
| 支付宝二维码支付 | alipay_qr |
| 支付宝手机网站支付 | alipay_pc_direct |
| 微信APP支付 | wx |
| 微信公众号支付 | wx_pub |
| 微信二维码支付 | wx_pub_qr |
| 微信H5支付 | wx_h5 |
配置文件
/src/Config.php
用例
public function testCreate()
{
try {
$channel = 'alipay';
$order = (object)[
'orderId' => '111',
'amount' => 100,
'subject' => '测试商品',
'body' => '商品详情',
'pid' => 1, // 商品id
'clientIp' => '111', // 客户端设备id
'extra' => '', // 额外参数 json {"openid":"111"}
];
$payment = new Payment($channel);
$payment->createOrder($order);
var_dump($order);
} catch (\Exception $exception) {
throw $exception;
}
}