fix: 解析阿里云查询结果对象
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,16 +88,18 @@ final class AliyunProvider implements ProviderInterface {
|
||||
if ($code !== '' && $code !== '200') {
|
||||
return ProviderResult::failed($code, sanitize_text_field((string) ($response['Message'] ?? '')));
|
||||
}
|
||||
$passed = $response['ResultObject']['Passed'] ?? $response['Passed'] ?? null;
|
||||
$success = $response['ResultObject']['Success'] ?? $response['Success'] ?? null;
|
||||
if ((string) ($response['Code'] ?? '') === '200' && ($success === true || $success === 'True') && $passed === 'T') {
|
||||
$object = $this->normalize_result_object($response['ResultObject'] ?? []);
|
||||
$passed = $object['Passed'] ?? $object['passed'] ?? $response['Passed'] ?? null;
|
||||
$success = $object['Success'] ?? $object['success'] ?? $response['Success'] ?? null;
|
||||
if ((string) ($response['Code'] ?? '') === '200' && ($success === true || $success === 'True' || $success === 'true') && $passed === 'T') {
|
||||
return ProviderResult::passed(['request_id' => (string) ($response['RequestId'] ?? ''), 'result_code' => 'passed']);
|
||||
}
|
||||
$status = strtoupper((string) ($response['ResultObject']['SubCode'] ?? $response['ResultObject']['Status'] ?? ''));
|
||||
$status = strtoupper((string) ($object['SubCode'] ?? $object['Status'] ?? $object['subCode'] ?? $object['status'] ?? ''));
|
||||
if ($status === '' || in_array($status, ['PROCESSING', 'INIT', 'PENDING'], true)) {
|
||||
return ProviderResult::pending(['result_code' => $status ?: 'processing', 'message' => __('阿里云仍在处理认证结果', 'aksrt')]);
|
||||
$message = $object['MaterialInfo'] ?? $object['Message'] ?? $object['message'] ?? __('阿里云仍在处理认证结果', 'aksrt');
|
||||
return ProviderResult::pending(['result_code' => $status ?: 'processing', 'message' => sanitize_text_field((string) $message)]);
|
||||
}
|
||||
return ProviderResult::failed($status, sanitize_text_field((string) ($response['ResultObject']['MaterialInfo'] ?? __('实人认证未通过', 'aksrt'))));
|
||||
return ProviderResult::failed($status, sanitize_text_field((string) ($object['MaterialInfo'] ?? $object['Message'] ?? $object['message'] ?? __('实人认证未通过', 'aksrt'))));
|
||||
}
|
||||
|
||||
private function is_public_https_url(string $url): bool {
|
||||
|
||||
Reference in New Issue
Block a user