测试
This commit is contained in:
@@ -130,14 +130,25 @@ class WangpuPayService
|
|||||||
$body = array_filter($body, static fn ($value): bool => $value !== null && $value !== '');
|
$body = array_filter($body, static fn ($value): bool => $value !== null && $value !== '');
|
||||||
$body['sign'] = $this->sign($body);
|
$body['sign'] = $this->sign($body);
|
||||||
|
|
||||||
$response = Http::asForm()->timeout(15)->post($baseUrl . $path, $body);
|
$response = Http::asForm()->withOptions([
|
||||||
|
'verify' => false, // 禁用 SSL 证书验证
|
||||||
|
])->timeout(15)->post($baseUrl . $path, $body);
|
||||||
$result = $response->json();
|
$result = $response->json();
|
||||||
if (! is_array($result)) {
|
if (! is_array($result)) {
|
||||||
Log::error('旺铺网关应答异常', ['path' => $path, 'status' => $response->status(), 'body' => $response->body()]);
|
Log::driver('pay')->error('旺铺网关应答异常', [
|
||||||
|
'path' => $path,
|
||||||
|
'status' => $response->status(),
|
||||||
|
'body' => $response->body(),
|
||||||
|
'request' => $body,
|
||||||
|
]);
|
||||||
throw new RepositoryException('支付网关通讯异常,请稍后重试');
|
throw new RepositoryException('支付网关通讯异常,请稍后重试');
|
||||||
}
|
}
|
||||||
if (($result['code'] ?? '') !== self::CODE_SUCCESS) {
|
if (($result['code'] ?? '') !== self::CODE_SUCCESS) {
|
||||||
Log::warning('旺铺网关应答失败', ['path' => $path, 'response' => $result]);
|
Log::driver('pay')->warning('旺铺网关应答失败', [
|
||||||
|
'path' => $path,
|
||||||
|
'response' => $result,
|
||||||
|
'request' => $body,
|
||||||
|
]);
|
||||||
throw new RepositoryException('支付网关下单失败:' . ($result['msg'] ?? '未知错误'));
|
throw new RepositoryException('支付网关下单失败:' . ($result['msg'] ?? '未知错误'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ class WechatMiniService
|
|||||||
throw new RepositoryException('微信小程序未配置 AppID/Secret,请联系管理员');
|
throw new RepositoryException('微信小程序未配置 AppID/Secret,请联系管理员');
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = Http::timeout(10)->get('https://api.weixin.qq.com/sns/jscode2session', [
|
$result = Http::timeout(10)->withOptions([
|
||||||
|
'verify' => false, // 禁用 SSL 证书验证
|
||||||
|
])->get('https://api.weixin.qq.com/sns/jscode2session', [
|
||||||
'appid' => $appid,
|
'appid' => $appid,
|
||||||
'secret' => $secret,
|
'secret' => $secret,
|
||||||
'js_code' => $code,
|
'js_code' => $code,
|
||||||
|
|||||||
@@ -133,6 +133,12 @@ return [
|
|||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'pay' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/pay.log'),
|
||||||
|
'level' => 'debug',
|
||||||
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ class SysSiteConfigItemsController extends BaseController
|
|||||||
SysSiteConfigService::refreshSiteConfig();
|
SysSiteConfigService::refreshSiteConfig();
|
||||||
return $this->success();
|
return $this->success();
|
||||||
}
|
}
|
||||||
$message = '设置保存失败:' . $result['message'];
|
$message = '设置保存失败';
|
||||||
return $this->error($message);
|
return $this->error($result['errors'], $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新设置 */
|
/** 刷新设置 */
|
||||||
|
|||||||
Reference in New Issue
Block a user