dev-master
9999999-devYii framework alipay
BSD-3-Clause
The Requires
by Long Wang
yii2 alipay yii2 alipay
Yii framework alipay
担保交易扩展, (*1)
安装 composer require leyestd/yii2-alipay "dev-master", (*2)
配置 设置common/config/params.php, (*3)
return [ 'adminEmail' => 'xxxxx@qq.com',, (*4)
'supportEmail' => 'xxxxxxx@qq.com', 'user.passwordResetTokenExpire' => 3600, 'showUrl'=>'http://www.sasr.cn/index.php', 'notifyUrl' => 'http://www.sasr.cn/index.php/ali-return/notify', 'returnUrl' => 'http://www.sasr.cn/index.php/ali-return/returned', 'aliPartner' => 'xxxxxxxxxxxxx', 'aliSellerEmail' => 'xxxxxx@126.com', 'aliKey'=> 'xxxxxxxx'
];, (*5)
使用, (*6)
use leyestd\alipay\Alipay;, (*7)
use leyestd\alipay\lib\AlipaySubmit;, (*8)
//参数为支付宝所需,详细请看构造方法, (*9)
$alipay=new Alipay($order->orderNumber, ltrim($productSkus),$cost,$order->notes,$show_url,$recipient->name,$recipient->address,$recipient->postcode,$recipient->phone,$recipient->mobile);, (*10)
$html_text = (new AlipaySubmit($alipay->alipay_config))->buildRequestForm($alipay->parameter, "get", "确认");, (*11)
echo $html_text;, (*12)
支付宝支付后返回, (*13)
$alipayNotify = new AlipayNotify((new Aliconfig)->getAliconfig());, (*14)
$verify_result = $alipayNotify->verifyReturn();, (*15)
以下为支付宝支付后通知, (*16)
$alipayNotify = new AlipayNotify((new Aliconfig)->getAliconfig());, (*17)
$verify_result = $alipayNotify->verifyNotify();, (*18)
日志, (*19)
默认在frontend/runtime/logs/alilog.txt 需要写入权限, (*20)
也可自己修改AlipayCore下的logResult方法到指定位置, (*21)
Yii framework alipay
BSD-3-Clause
yii2 alipay yii2 alipay