1 Star 0 Fork 0

Yeardley / laravel-pay

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Pay

Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads Latest Unstable Version License

该文档为 v2.x 版本,如果您想找 v1.x 版本文档,请点击https://github.com/yansongda/laravel-pay/tree/v1.0.3

运行环境

  • php >= 7.0
  • composer
  • laravel || lumen >= 5.1

安装

$ composer require yansongda/laravel-pay

添加 service provider(optional. if laravel < 5.5 || lumen)

// laravel < 5.5
Yansongda\LaravelPay\PayServiceProvider::class,

// lumen
$app->register(Yansongda\LaravelPay\PayServiceProvider::class);

添加 alias(optional. if laravel < 5.5)

'Pay' => Yansongda\LaravelPay\Facades\Pay::class,

配置文件

$ php artisan vendor:publish --provider="Yansongda\LaravelPay\PayServiceProvider" --tag=laravel-pay

lumen 用户请手动复制

随后,请在 config 文件夹中完善配置信息。

.env 文件里面配置

// alipay 配置
ALI_APP_ID=
ALI_PUBLIC_KEY=
ALI_PRIVATE_KEY=

// wechat 配置
WECHAT_APP_ID=
WECHAT_MINIAPP_ID=
WECHAT_APPID=
WECHAT_MCH_ID=
WECHAT_KEY=

使用方法

支付宝

use Pay;

$order = [
    'out_trade_no' => time(),
    'total_amount' => '1',
    'subject' => 'test subject - 测试',
];

return Pay::alipay()->web($order);

// 下面这个方法也可以
// return Pay::web($order);

微信

use Pay;

$order = [
    'out_trade_no' => time(),
    'body' => 'subject-测试',
    'total_fee'      => '1',
    'openid' => 'onkVf1FjWS5SBIixxxxxxxxx',
];

$result = Pay::wechat()->mp($order);

具体使用说明请传送至 https://github.com/yansongda/pay

License

MIT

Comments ( 0 )

Sign in for post a comment

About

可能是我用过的最优雅的 Alipay 和 WeChat 的 laravel 支付扩展包了 expand collapse
MIT
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more
1
https://gitee.com/yeardley/laravel-pay.git
git@gitee.com:yeardley/laravel-pay.git
yeardley
laravel-pay
laravel-pay
master

Search

105716 1d94204e 1850385 105716 2d26be5c 1850385