【类 型】:fix
【主 题】:腾讯回调 绕开构造函数的 身份检查 【描 述】: [原因]:构造函数会拦截腾讯 调用回调 [过程]: [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
b3a4d58cf8
commit
b37304ea72
@ -9,7 +9,7 @@ class PayController extends PublicController
|
||||
/**
|
||||
* @description: 初始化 pay类的参数
|
||||
*/
|
||||
private function init()
|
||||
public function _initialize()
|
||||
{
|
||||
// 初始化 pay类的参数
|
||||
$this->config = [
|
||||
@ -50,10 +50,11 @@ class PayController extends PublicController
|
||||
*/
|
||||
public function refund()
|
||||
{
|
||||
//父级构造函数
|
||||
parent::_initialize();
|
||||
|
||||
// 总管理员 可接收任何shop_id 非总管理员 只可以调用自身shop_id 否则会中断
|
||||
$this->isPower();
|
||||
// 初始化 pay类的参数
|
||||
$this->init();
|
||||
|
||||
// 获取订单信息
|
||||
$where['shop_id'] = $_REQUEST['shop_id'];
|
||||
@ -78,7 +79,6 @@ class PayController extends PublicController
|
||||
'total' => $order['total_price'] * 100, // 订单金额,单位:分
|
||||
'currency' => 'CNY',
|
||||
],
|
||||
'notify_url' => C('host') . 'flycube.php/MpApi/Pay/notifyCallback', // 退款回调地址
|
||||
];
|
||||
|
||||
try {
|
||||
@ -96,7 +96,6 @@ class PayController extends PublicController
|
||||
public function notifyCallback()
|
||||
{
|
||||
$this->publish("demo", "hello");
|
||||
$this->init(); // 初始化 pay类的参数
|
||||
|
||||
try {
|
||||
// 实例化 Yansongda Pay 并处理回调
|
||||
|
@ -13,11 +13,11 @@ use PhpMqtt\Client\ConnectionSettings;
|
||||
|
||||
class PublicController extends Controller
|
||||
{
|
||||
protected $tokenShop_id;
|
||||
//****************
|
||||
//构造函数
|
||||
//****************
|
||||
protected $tokenShop_id;
|
||||
public function __construct()
|
||||
public function _initialize()
|
||||
{
|
||||
header("Access-Control-Allow-Origin: *"); // 允许所有来源
|
||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); // 允许的请求方法
|
||||
|
Loading…
Reference in New Issue
Block a user