This commit is contained in:
liu 2024-06-06 09:45:43 +08:00
parent cc842a9757
commit a8e0ec48ed

View File

@ -8,6 +8,7 @@ use app\common\logic\store_order\StoreOrderLogic;
use app\common\service\pay\PayService; use app\common\service\pay\PayService;
use app\common\service\wechat\WechatTemplate; use app\common\service\wechat\WechatTemplate;
use Exception; use Exception;
use support\Cache;
use think\facade\Db; use think\facade\Db;
use Webman\Config; use Webman\Config;
use hg\apidoc\annotation as ApiDoc; use hg\apidoc\annotation as ApiDoc;
@ -22,6 +23,7 @@ class IndexController extends BaseApiController
public function index() public function index()
{ {
try {
$wechat = new PayService(1); $wechat = new PayService(1);
$order = [ $order = [
'out_trade_no' => 'PF1717558027664507', 'out_trade_no' => 'PF1717558027664507',
@ -41,7 +43,12 @@ class IndexController extends BaseApiController
]; ];
$res = $wechat->wechat->refund($order); $res = $wechat->wechat->refund($order);
d($res); Cache::set('kk',json_decode($res,true));
} catch (Exception $e) {
\support\Log::info($e->extra['message']?? $e->getMessage());
throw new \Exception($e->extra['message']?? $e->getMessage());
}
d(1);