测试
This commit is contained in:
@@ -130,14 +130,25 @@ class WangpuPayService
|
||||
$body = array_filter($body, static fn ($value): bool => $value !== null && $value !== '');
|
||||
$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();
|
||||
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('支付网关通讯异常,请稍后重试');
|
||||
}
|
||||
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'] ?? '未知错误'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user