eternal-software/payment
最新稳定版本:1.0.4
Composer 安装命令:
composer require eternal-software/payment
包简介
README 文档
README
Here is the extension package of payment, currently only supports WeChat and Alipay payment.
You can choose to use this extension in two different ways.
- [Import using composer](#Import using composer)
- [Copy the src code directly to your project](#Copy the src code directly to your project)
How to install?
Remember to ask and ask for payment configuration after installation is complete to perform unit tests.
Import using composer
composer require eternal-software/payment
Copy the src code directly to your project
Nothing to say, you can just copy the src code into your project. As for what directory, it's up to you.
How to use?
Be sure to read the payment provider's documentation, it's the basics.
Config
// TODO: An array is required for configuration, please obtain it by any means.
EternalSoftware\Payment\Config::set([
// config
]);
Case 1: Using Alipay Pay
Web payment
$out_trade_no = Str::random();
$amount = 0.01;
$subject = 'Demo';
return EternalSoftware\Payment\Factory::alipay()->web([
'out_trade_no' => $out_trade_no,
'total_amount' => $amount,
'subject' => $subject
]);
Case 2: Using WeChat Pay
Web scan payment
$out_trade_no = Str::random();
$amount = 0.01;
$description = 'Demo';
$result = Factory::wechat()->scan([
'out_trade_no' => $out_trade_no,
'amount' => [
'total' => $amount * 100
],
'description' => $description
]);
$qrcode = $result->get('code_url');
Payment callback
// TODO
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-25