Files
sam-kd/ecard/api/debug_raw.php
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

66 lines
2.0 KiB
PHP

<?php
/**
* 바로빌 API 응답 raw 데이터 확인용 (디버그)
*/
header('Content-Type: application/json; charset=utf-8');
require_once('barobill_card_config.php');
try {
$startDate = $_GET['startDate'] ?? date('Ymd', strtotime('-60 days'));
$endDate = $_GET['endDate'] ?? date('Ymd');
// SOAP 직접 호출
global $barobillCardSoapClient, $barobillCertKey, $barobillCorpNum;
$params = [
'CERTKEY' => $barobillCertKey,
'CorpNum' => $barobillCorpNum,
'ID' => '',
'CardNum' => '',
'StartDate' => $startDate,
'EndDate' => $endDate,
'CountPerPage' => 10,
'CurrentPage' => 1,
'OrderDirection' => 2
];
$result = $barobillCardSoapClient->GetPeriodCardApprovalLog($params);
$resultData = $result->GetPeriodCardApprovalLogResult;
// raw 데이터 출력
$output = [
'params' => $params,
'resultKeys' => is_object($resultData) ? array_keys(get_object_vars($resultData)) : 'not object',
'CurrentPage' => $resultData->CurrentPage ?? null,
'MaxIndex' => $resultData->MaxIndex ?? null
];
// CardLogList 확인
if (isset($resultData->CardLogList)) {
$output['CardLogListKeys'] = is_object($resultData->CardLogList) ? array_keys(get_object_vars($resultData->CardLogList)) : 'not object';
if (isset($resultData->CardLogList->CardApprovalLog)) {
$logs = $resultData->CardLogList->CardApprovalLog;
if (!is_array($logs)) {
$logs = [$logs];
}
if (!empty($logs)) {
$firstLog = $logs[0];
$output['firstLogKeys'] = is_object($firstLog) ? array_keys(get_object_vars($firstLog)) : 'not object';
$output['firstLogData'] = $firstLog;
}
}
}
echo json_encode($output, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
} catch (Exception $e) {
echo json_encode([
'error' => $e->getMessage()
], JSON_UNESCAPED_UNICODE);
}
?>