This commit is contained in:
szdot 2024-06-05 21:08:51 +08:00
commit 403f9c32af

View File

@ -14,19 +14,6 @@ class PayController extends PublicController
*/
public function _initialize()
{
}
/**
* @description: Yansongda pay类的参数
*/
protected $config;
/**
* @description: 发起小程序支付
*/
public function pay()
{
//父级构造函数
parent::_initialize();
//初始化 pay类的参数
$this->config = [
'wechat' => [
@ -54,6 +41,18 @@ class PayController extends PublicController
'connect_timeout' => 5.0,
],
];
}
/**
* @description: Yansongda pay类的参数
*/
protected $config;
/**
* @description: 发起小程序支付
*/
public function pay()
{
//父级构造函数
parent::_initialize();
//获取订单信息
$where['order_sn'] = $_REQUEST['order_sn'];
@ -86,9 +85,8 @@ class PayController extends PublicController
{
$this->publish('demo1', 'start');
// 实例化 Yansongda Pay
$pay = Pay::wechat($this->config);
$callBackData = $pay->callback();
$this->publish('demo', json_encode($callBackData));
$result = Pay::wechat($this->config)->callback();
$this->publish('demo', json_encode($result));
// try {
// // 获取并验证回调数据
// $callBackData = $pay->callback();
@ -106,6 +104,6 @@ class PayController extends PublicController
// }
// 返回成功响应给腾讯服务器,告知通知已处理
return $pay->success();
return Pay::wechat()->success();
}
}