【类 型】:

【主	题】:
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-05 21:08:17 +08:00
parent df4ecc9c68
commit 70b4d2aa9e

View File

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