Skip to content

xiejianxuan5/yii2-payment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2 payment extension

yii2的支付扩展,支持支付宝,微信支付等,目前正在开发支付宝扩展,目前版本正在开发中,功能尚不完善,请不要在生产环境使用,谢谢.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist lubaogui/yii2-payment "*"

or add

"lubaogui/yii2-payment": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

use lubaogui\payment\Payment;

$payment = new Payment('alipay');

//订单相关信息,详细参数参见支付宝文档
$params = [
    'title' => '',
    'xxx' => 'xxx',
];

echo $payment->generateRequest($params);
exit;

对于支付宝支付,需要开始对配置文件进行配置,配置文件位于Provider\alipay\lib\alipay.config.php ,配置完成后可以使用,扩展主要功能:

  1. 产生请求html内容,
  2. 验证服务端返回是否合法

对于业务逻辑相关功能,用户可以在自己的产品流程中添加

About

yii2的在线支付扩展

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%