Files
wangchen147 0864a7a502 1.2.3
注意事项:本次升级后将不再支持调用官方的云编译服务,如需使用云编译功能需使用官方提供的第三方云编译程序自行启用云编译服务。

修复 本地开发时会验证授权信息的问题
优化 本版本更新后卸载插件会同时删除本地文件
修复 支付回调失败问题
优化 云编译失败后增加异常分析,可排除异常插件后重新编译
修复 云编译没有清除旧的编译文件
2026-05-08 14:30:00 +08:00

99 lines
2.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\api\controller\pay;
use app\service\api\pay\PayService;
use core\base\BaseApiController;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Response;
/**
* 微信服务端通信以及网页授权
*/
class Pay extends BaseApiController
{
/**
* 接收消息并推送
* @return void|null
*/
public function notify($site_id, $channel, $type, $action)
{
$this->request->siteId($site_id);
return (new PayService())->notify($channel, $type, $action);
}
/**
* 去支付
* @return Response
*/
public function pay()
{
$data = $this->request->params([
['type', ''],
['trade_type', ''],//业务类型
['trade_id', ''],//业务id
['quit_url', ''],
['buyer_id', ''],
['return_url', ''],
['voucher', ''],
['openid', '']
]);
return success('SUCCESS',(new PayService())->pay($data['type'], $data['trade_type'], (int)$data['trade_id'], $data['return_url'], $data['quit_url'], $data['buyer_id'], $data['voucher'], $data['openid']));
}
public function info($trade_type, $trade_id)
{
$data = $this->request->params([
['scene', '']
]);
return success((new PayService())->getInfoByTrade($trade_type, $trade_id, $data));
}
/**
* 获取找朋友帮忙付支付信息
* @return Response
*/
public function friendspayInfo($trade_type, $trade_id)
{
return success((new PayService())->getFriendspayInfoByTrade($trade_type, $trade_id));
}
/**
* 获取可用的支付方法
* @param $trade_type
* @return Response
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function getPayType($trade_type){
return success((new PayService())->getPayTypeByTrade($trade_type));
}
/**
* 关闭支付
* @return Response
*/
public function close(){
$data = $this->request->params([
['out_trade_no', ''],
['type', ''],
]);
return success('SUCCESS',(new PayService())->close($data['type'], $data['out_trade_no']));
}
}