feat(api-docs): 요청/응답 예시 블록 + 8종 결함 근본 수정 + audit error 승격
API 레퍼런스에 요청 예시(raw HTTP)·응답 예시(envelope 전문)를 표준 포맷에 편입하고, 전 대상(코어+전 모듈+전 플러그인)에 방출했다. 예시 결함 8종 (multipart·Host 마스킹·write 실측·path 치환·현실적 바디·query 반영·중복 제거·민감값 마스킹)을 스캐폴더/프로브 공용 수정으로 근본 해소했다. 추가로 검증에서 드러난 결함을 마감했다: - 응답 예시 body 의 절대 URL(페이지네이터·콜백) 호스트를 placeholder 로 마스킹(maskResponseHost) — 요청 Host 헤더만 마스킹되던 누락 보완, 확장 39건 정정 - api:docgen 커맨드 통합 테스트 신설(라우트 수집·확장 라우팅·rules 추출· 멱등 재생성·check drift) - module-routing.md URL 스킴 오류 정정(/api/admin → /api/modules) - README·cheatsheet·api-documentation 에 API 문서 커맨드/레퍼런스 진입점 반영 전 대상 3칸 완료로 api-doc-coverage 룰을 warn→error 승격.
This commit is contained in:
1 parent
70452745c4
commit
56a78e1d55
114 files changed
+60782
-197
No files matched your search
@@ -29,6 +29,14 @@
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| hash | path | string | 예 | — | 업로드 시 발급된 12자리 소문자 16진수 이미지 해시(라우트 제약 `[a-f0-9]{12}`). 저장된 `<img src>` 의 마지막 경로 세그먼트로, 이 값으로 서빙할 이미지를 조회한다. |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-ckeditor5/images/a1b2c3d4e5f6 HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: unresolved-path-param — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
@@ -29,6 +29,23 @@
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| upload | body | file | 예 | max 2048 | 에디터에 드롭/붙여넣은 이미지 파일 1개(multipart). 허용 MIME 은 `jpeg,jpg,png,gif,webp`, 최대 크기는 플러그인 설정 `imageMaxSizeMb`(기본 2MB) 로 결정된다. |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-ckeditor5/upload HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
Content-Type: multipart/form-data; boundary=----G7ExampleBoundary
|
||||
|
||||
------G7ExampleBoundary
|
||||
Content-Disposition: form-data; name="upload"; filename="example.pdf"
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
(바이너리 파일 내용)
|
||||
------G7ExampleBoundary--
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\Ckeditor5\Support\ApiDoc;
|
||||
|
||||
use App\Contracts\ApiDoc\ApiDocSampleSeeder;
|
||||
use App\Models\User;
|
||||
use Plugins\Sirsoft\Ckeditor5\Models\Ckeditor5ImageUpload;
|
||||
|
||||
/**
|
||||
* sirsoft-ckeditor5 API 문서 실측용 완전 샘플 시더
|
||||
*
|
||||
* 이미지 서빙 GET(`images/{hash}`)은 route 제약 `[a-f0-9]{12}` 의 12자리 소문자 16진수
|
||||
* `hash` 로 이미지 레코드를 조회한다. 실측/요청 예시 시 `{hash}` 를 실제 해시로 치환하지
|
||||
* 못하면 상세 GET 의 요청 예시에 `{hash}` placeholder 가 그대로 남으므로(결함 4), 이 시더는
|
||||
* 고정 해시의 이미지 업로드 레코드 1건을 멱등 생성하고 `images` 도메인의 `path_params` 맵으로
|
||||
* `{hash}` 를 실제 값으로 정확 일치 치환한다.
|
||||
*
|
||||
* 성공 응답은 이미지 바이너리 스트림(envelope 아님)이며, 실제 스토리지 파일이 없으면
|
||||
* `serve()` 가 null 을 반환해 404 JSON 이 되므로 응답 예시는 실측 제외로 남는다(정상 —
|
||||
* 바이너리 서빙 계약). 이 시더의 목적은 요청 예시의 path 치환이다.
|
||||
*
|
||||
* `api:docgen --scope=plugin:sirsoft-ckeditor5 --seed` 실행 시 커맨드가 규약 위치
|
||||
* (`Plugins\Sirsoft\Ckeditor5\Support\ApiDoc\ApiDocSampleService`)로 자동 발견한다.
|
||||
*/
|
||||
class ApiDocSampleService implements ApiDocSampleSeeder
|
||||
{
|
||||
/**
|
||||
* @var string 샘플 이미지 해시 (12자리 소문자 16진수 — 라우트 제약 `[a-f0-9]{12}` 충족)
|
||||
*/
|
||||
private const SAMPLE_HASH = 'a1b2c3d4e5f6';
|
||||
|
||||
/**
|
||||
* 이미지 업로드 완전 샘플을 멱등 생성하고 `images` 도메인의 path_params 맵을 반환합니다.
|
||||
*
|
||||
* @return array<string, array{model: class-string, key: string, value: string, path_params?: array<string, string>}> 도메인 => 대표 레코드 정보
|
||||
*/
|
||||
public function seed(): array
|
||||
{
|
||||
if (! class_exists(Ckeditor5ImageUpload::class)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$image = $this->seedImage();
|
||||
|
||||
$entry = [
|
||||
'model' => Ckeditor5ImageUpload::class,
|
||||
'key' => 'hash',
|
||||
'value' => (string) $image->hash,
|
||||
'path_params' => [
|
||||
'hash' => (string) $image->hash,
|
||||
],
|
||||
];
|
||||
|
||||
return [
|
||||
'images' => $entry,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 고정 해시의 이미지 업로드 레코드 1건을 멱등 생성합니다.
|
||||
*
|
||||
* @return Ckeditor5ImageUpload 샘플 이미지 업로드
|
||||
*/
|
||||
private function seedImage(): Ckeditor5ImageUpload
|
||||
{
|
||||
$actor = User::query()->orderBy('id')->first();
|
||||
|
||||
return Ckeditor5ImageUpload::query()->firstOrCreate(
|
||||
['hash' => self::SAMPLE_HASH],
|
||||
[
|
||||
'original_name' => 'apidoc-sample.png',
|
||||
'file_path' => 'ckeditor5/apidoc-sample.png',
|
||||
'storage_disk' => 'public',
|
||||
'file_size' => 1024,
|
||||
'mime_type' => 'image/png',
|
||||
'uploaded_by' => $actor?->getKey(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plugins\Sirsoft\Ckeditor5\Tests\Unit\Support;
|
||||
|
||||
use App\Contracts\ApiDoc\ApiDocSampleSeeder;
|
||||
use App\Models\User;
|
||||
use Plugins\Sirsoft\Ckeditor5\Models\Ckeditor5ImageUpload;
|
||||
use Plugins\Sirsoft\Ckeditor5\Support\ApiDoc\ApiDocSampleService;
|
||||
use Plugins\Sirsoft\Ckeditor5\Tests\PluginTestCase;
|
||||
|
||||
/**
|
||||
* sirsoft-ckeditor5 API 문서 실측용 완전 샘플 시더 테스트.
|
||||
*
|
||||
* 이미지 서빙 GET(`images/{hash}`)의 요청 예시 path 치환을 위한 고정 해시 이미지
|
||||
* 대표 샘플이 생성되고, `images` 도메인의 path_params 맵이 반환되며, 재실행 시
|
||||
* 멱등한지 검증한다.
|
||||
*/
|
||||
class ApiDocSampleServiceTest extends PluginTestCase
|
||||
{
|
||||
/**
|
||||
* @var string 샘플 이미지 해시
|
||||
*/
|
||||
private const SAMPLE_HASH = 'a1b2c3d4e5f6';
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
User::factory()->create([
|
||||
'email' => 'apidoc-sample-user@example.com',
|
||||
'name' => 'API 문서 샘플 사용자',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 계약을 구현한다.
|
||||
*/
|
||||
public function test_seeder_implements_contract(): void
|
||||
{
|
||||
$this->assertInstanceOf(ApiDocSampleSeeder::class, new ApiDocSampleService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 고정 해시(라우트 제약 `[a-f0-9]{12}` 충족)의 이미지 대표 샘플을 생성한다.
|
||||
*/
|
||||
public function test_seed_creates_image_with_valid_hash(): void
|
||||
{
|
||||
(new ApiDocSampleService)->seed();
|
||||
|
||||
$image = Ckeditor5ImageUpload::query()->where('hash', self::SAMPLE_HASH)->first();
|
||||
|
||||
$this->assertNotNull($image);
|
||||
$this->assertMatchesRegularExpression('/^[a-f0-9]{12}$/', $image->hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 images 도메인의 path_params 맵을 반환한다.
|
||||
*/
|
||||
public function test_seed_returns_images_path_params_map(): void
|
||||
{
|
||||
$map = (new ApiDocSampleService)->seed();
|
||||
|
||||
$this->assertArrayHasKey('images', $map);
|
||||
$entry = $map['images'];
|
||||
$this->assertSame(Ckeditor5ImageUpload::class, $entry['model']);
|
||||
$this->assertSame('hash', $entry['key']);
|
||||
$this->assertArrayHasKey('hash', $entry['path_params']);
|
||||
$this->assertSame(self::SAMPLE_HASH, $entry['path_params']['hash']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 재실행 시 이미지가 중복 생성되지 않는다 (멱등).
|
||||
*/
|
||||
public function test_seed_is_idempotent(): void
|
||||
{
|
||||
(new ApiDocSampleService)->seed();
|
||||
(new ApiDocSampleService)->seed();
|
||||
|
||||
$this->assertSame(1, Ckeditor5ImageUpload::query()->where('hash', self::SAMPLE_HASH)->count());
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/admin/consent-log HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
@@ -47,6 +56,30 @@ _목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
| created_at | string | `2026-07-03 00:24:27` | 생성 일시 |
|
||||
| user | object | `{"id":130,"uuid":"a21d03b4-df0b-4aa6-ab7a-f51143f6375a","…` | 동의 주체 회원 정보(id/uuid/name/email). 관계가 로드된 경우에만 포함되며 게스트 이력이거나 삭제로 익명화된 경우 null입니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"data": [],
|
||||
"pagination": {
|
||||
"current_page": 1,
|
||||
"last_page": 1,
|
||||
"per_page": 25,
|
||||
"total": 0,
|
||||
"from": null,
|
||||
"to": null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
|
||||
@@ -27,10 +27,23 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-gdpr/consent/cookie HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN} (optional.sanctum: 비회원은 헤더 생략 가능)
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
_대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있으면 보강 -->_
|
||||
@@ -50,6 +63,15 @@ _대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/consent/cookie/status HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN} (optional.sanctum: 비회원은 헤더 생략 가능)
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -62,6 +84,26 @@ _단건 응답: `data` 객체의 필드._
|
||||
| current_policy_version | string | `10` | 현재 발행된 최신 정책 버전 문자열(정책 버전 서비스 기준). 방문자 동의 버전과 비교해 배너 재노출 여부를 판단합니다 |
|
||||
| is_member | boolean | `true` | member 여부 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"has_consented": false,
|
||||
"consents": [],
|
||||
"needs_renewal": false,
|
||||
"current_policy_version": "1",
|
||||
"is_member": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
_대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있으면 보강 -->_
|
||||
@@ -81,10 +123,23 @@ _대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-gdpr/consent/grant HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -106,6 +161,15 @@ _요청 파라미터 없음._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/consent/history HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -114,6 +178,22 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- |
|
||||
| histories | array | `[]` | 회원 본인의 동의 변경 이력 배열. 각 항목은 `consent_key`, `action`(granted/revoked), `source`, `policy_version`, `categories`, `created_at`로 구성되며 부여/철회 기록을 시간순으로 제공합니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"histories": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -135,6 +215,15 @@ _단건 응답: `data` 객체의 필드._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/consent/me HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -146,6 +235,94 @@ _단건 응답: `data` 객체의 필드._
|
||||
| current_policy_version | string | `10` | 현재 발행된 최신 정책 버전 문자열. 각 동의 항목의 `policy_version`과 비교해 항목별 갱신 필요 여부를 계산하는 기준입니다 |
|
||||
| consents | array | `[{"id":null,"consent_key":"cookie_necessary","consent_lab…` | 카탈로그의 모든 쿠키 카테고리와 회원 status를 합친 동의 매트릭스. 항목마다 다국어 라벨(`consent_label`), 필수 여부(`is_required`), 현재 동의 상태(`is_consented`), 철회/재동의 가능 여부(`can_revoke`/`can_grant`), 항목별 갱신 필요(`needs_renewal_this_item`)를 담아 한 화면에서 철회·재동의·신규 동의를 처리하게 합니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"user_id": 6,
|
||||
"needs_renewal": false,
|
||||
"current_policy_version": "1",
|
||||
"consents": [
|
||||
{
|
||||
"id": null,
|
||||
"consent_key": "cookie_necessary",
|
||||
"consent_label": "필수 쿠키",
|
||||
"consent_description": "세션·CSRF·로그인 토큰, 장바구니 식별자, 사용자가 가입 시 선택한 언어 설정, 쿠키 동의 기록 등 사이트 운영에 반드시 필요한 항목입니다. 비활성화할 수 없습니다.",
|
||||
"consent_category": "necessary",
|
||||
"is_required": true,
|
||||
"is_consented": false,
|
||||
"can_revoke": false,
|
||||
"can_grant": false,
|
||||
"needs_renewal_this_item": false,
|
||||
"consented_at": null,
|
||||
"revoked_at": null,
|
||||
"consent_count": 0,
|
||||
"policy_version": null,
|
||||
"last_source": null
|
||||
},
|
||||
{
|
||||
"id": null,
|
||||
"consent_key": "cookie_functional",
|
||||
"consent_label": "기능 쿠키",
|
||||
"consent_description": "사용자 선호도(다크모드, 표시 통화 등)를 기억하는 쿠키입니다. 거부 시 매 방문마다 기본값으로 표시됩니다.",
|
||||
"consent_category": "functional",
|
||||
"is_required": false,
|
||||
"is_consented": false,
|
||||
"can_revoke": false,
|
||||
"can_grant": true,
|
||||
"needs_renewal_this_item": false,
|
||||
"consented_at": null,
|
||||
"revoked_at": null,
|
||||
"consent_count": 0,
|
||||
"policy_version": null,
|
||||
"last_source": null
|
||||
},
|
||||
{
|
||||
"id": null,
|
||||
"consent_key": "cookie_analytics",
|
||||
"consent_label": "분석 쿠키",
|
||||
"consent_description": "방문자가 사이트를 어떻게 이용하는지 익명으로 측정해 더 나은 서비스를 만드는 데 사용됩니다. (예: Google Analytics, Hotjar)",
|
||||
"consent_category": "analytics",
|
||||
"is_required": false,
|
||||
"is_consented": false,
|
||||
"can_revoke": false,
|
||||
"can_grant": true,
|
||||
"needs_renewal_this_item": false,
|
||||
"consented_at": null,
|
||||
"revoked_at": null,
|
||||
"consent_count": 0,
|
||||
"policy_version": null,
|
||||
"last_source": null
|
||||
},
|
||||
{
|
||||
"id": null,
|
||||
"consent_key": "cookie_marketing",
|
||||
"consent_label": "마케팅 쿠키",
|
||||
"consent_description": "관심사에 맞는 광고를 보여주거나, 광고가 얼마나 효과적이었는지 측정하는 데 사용됩니다. SNS 영상 임베드 등도 포함됩니다. (예: Facebook 픽셀, Google 광고, YouTube 영상)",
|
||||
"consent_category": "marketing",
|
||||
"is_required": false,
|
||||
"is_consented": false,
|
||||
"can_revoke": false,
|
||||
"can_grant": true,
|
||||
"needs_renewal_this_item": false,
|
||||
"consented_at": null,
|
||||
"revoked_at": null,
|
||||
"consent_count": 0,
|
||||
"policy_version": null,
|
||||
"last_source": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -167,9 +344,38 @@ _단건 응답: `data` 객체의 필드._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-gdpr/consent/renew-all HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| renewed | integer | `0` | 이번 호출로 현재 정책 버전으로 재동의 처리된 활성 선택형 동의 항목 수. 필수 쿠키와 이미 철회한 항목·이미 현재 버전인 항목은 제외되며, 프론트 toast 메시지의 `{renewed}` 보간값으로 사용됩니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "활성 항목 {renewed} 개를 새 정책 버전으로 갱신했습니다.",
|
||||
"data": {
|
||||
"renewed": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
@@ -192,10 +398,23 @@ _요청 파라미터 없음._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-gdpr/consent/revoke HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/admin/policy-versions HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
@@ -40,6 +49,39 @@ _목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
| created_at | string | `2026-06-18 09:27:39` | 생성 일시 |
|
||||
| publisher | object | `{"uuid":"a1e0a91a-fba6-491c-a53e-7285a5686857","name":"관리…` | 이 버전을 발행한 운영자 정보(uuid/name/email). raw FK(created_by)는 노출하지 않고 관계가 로드된 경우에만 포함되며, 발행자가 없으면 null입니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"version": 1,
|
||||
"change_type": "initial",
|
||||
"memo": null,
|
||||
"created_at": "2026-07-07 16:38:26",
|
||||
"publisher": null
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"current_page": 1,
|
||||
"last_page": 1,
|
||||
"per_page": 25,
|
||||
"total": 1,
|
||||
"from": 1,
|
||||
"to": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -64,9 +106,49 @@ _목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| memo | body | string | 예 | min 1, max 500 | 발행 사유 메모(1~500자, 필수). 자동 감지 밖의 변경을 인지하고 명시적으로 새 버전을 발행할 때 감사 추적용으로 남기는 설명입니다 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-gdpr/admin/policy-versions HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"memo": "예시값"
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
_목록 응답: `data.data[]` 배열 항목의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| uuid | string | `a234c2b1-cde8-437f-b28b-23323be2b98d` | 외부 노출용 UUID (URL/API 식별자, 내부 id 비노출) |
|
||||
| name | string | `API 문서 샘플 사용자` | 대상의 이름/명칭 (다국어 필드는 로케일별 값 객체) |
|
||||
| email | string | `apidoc-sample-user@example.com` | 이 버전을 발행한 운영자의 이메일. publisher 관계에서 노출되며 감사 화면에서 발행자를 식별하는 용도입니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "새 정책 버전이 발행되었습니다. 모든 회원이 다음 방문 시 재동의를 진행합니다.",
|
||||
"data": {
|
||||
"data": {
|
||||
"id": 6,
|
||||
"version": 2,
|
||||
"0": "... (총 6건 중 2건 표시)"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
@@ -91,6 +173,15 @@ _목록 응답: `data.data[]` 배열 항목의 필드 + `data.pagination`._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/admin/policy-versions/current HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_목록 응답: `data.data[]` 배열 항목의 필드._
|
||||
@@ -101,6 +192,26 @@ _목록 응답: `data.data[]` 배열 항목의 필드._
|
||||
| name | string | `관리자` | 대상의 이름/명칭 (다국어 필드는 로케일별 값 객체) |
|
||||
| email | string | `heuristing@gmail.com` | 이 버전을 발행한 운영자의 이메일. publisher 관계에서 노출되며 감사 화면에서 발행자를 식별하는 용도입니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"data": {
|
||||
"id": 1,
|
||||
"version": 1,
|
||||
"0": "... (총 6건 중 2건 표시)"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -125,9 +236,48 @@ _목록 응답: `data.data[]` 배열 항목의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| version | path | string | 예 | — | 대상 버전 (버전 문자열) |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/admin/policy-versions/1 HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: unresolved-path-param — 응답 필드는 사람이 작성하세요. -->
|
||||
_목록 응답: `data.data[]` 배열 항목의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| banner_enabled | boolean | `true` | 발행 시점 스냅샷의 쿠키 배너·자동 차단 통합 활성 여부. `true`일 때만 게스트에게 배너가 노출되고 도메인 차단 엔진이 동작합니다 |
|
||||
| banner_position | string | `bottom_bar` | 발행 시점의 쿠키 배너 노출 위치(bottom_bar / bottom_left_popup / bottom_right_popup / centered_modal) |
|
||||
| blocked_domains | object | `{"analytics":["google-analytics.com","*.google-analytics.…` | 발행 시점에 설정된 카테고리별 차단 도메인 패턴(키→도메인 배열). 동의 전 로드를 차단하는 대상이며, 분쟁 시 당시 어떤 도메인이 차단 대상이었는지 확인하는 근거입니다 |
|
||||
| cookie_categories | array | `[{"key":"necessary","label":{"en":"Strictly Necessary","k…` | 발행 시점의 쿠키 카테고리 카탈로그 배열. 각 항목은 `key`, 필수 여부, 다국어 `label`/`description`을 담으며, 회원 분쟁 시 당시 동의 대상 카테고리 본문을 확인하는 근거가 됩니다 |
|
||||
| legal_entity_name | string | `` | 발행 시점에 표기된 개인정보 처리 법인/사업자명. 미설정 시 빈 문자열입니다 |
|
||||
| privacy_policy_slug | string | `privacy` | 발행 시점의 개인정보 처리방침 페이지 slug. 배너/마이페이지의 방침 링크 대상이며, 미설정 시 빈 값입니다 |
|
||||
| data_storage_location | string | `` | 발행 시점에 표기된 데이터 저장 위치 문자열(국가 단위 안내). 미설정 시 빈 문자열입니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"data": {
|
||||
"id": 1,
|
||||
"version": 1,
|
||||
"0": "... (총 8건 중 2건 표시)"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/admin/settings HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -35,6 +44,90 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- |
|
||||
| settings | object | `{"privacy_policy_slug":"privacy","legal_entity_name":"","…` | GDPR 플러그인의 관리자 설정 전체 객체. 정책 메타데이터(slug/법인명/저장 위치), 배너 설정, 쿠키 카테고리 카탈로그, 차단 도메인을 담으며 `cookie_categories` 등 JSON 필드는 디코드되어 객체/배열로 노출됩니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"settings": {
|
||||
"privacy_policy_slug": "privacy",
|
||||
"legal_entity_name": "",
|
||||
"data_storage_location": "",
|
||||
"banner_enabled": true,
|
||||
"banner_position": "bottom_bar",
|
||||
"blocked_domains": {
|
||||
"functional": [
|
||||
"*.crisp.chat",
|
||||
"widget.intercom.io"
|
||||
],
|
||||
"analytics": [
|
||||
"google-analytics.com"
|
||||
],
|
||||
"marketing": [
|
||||
"facebook.com"
|
||||
]
|
||||
},
|
||||
"cookie_categories": [
|
||||
{
|
||||
"key": "necessary",
|
||||
"required": true,
|
||||
"label": {
|
||||
"ko": "필수 쿠키",
|
||||
"en": "Strictly Necessary"
|
||||
},
|
||||
"description": {
|
||||
"ko": "세션·CSRF·로그인 토큰, 장바구니 식별자, 사용자가 가입 시 선택한 언어 설정, 쿠키 동의 기록 등 사이트 운영에 반드시 필요한 항목입니다. 비활성화할 수 없습니다.",
|
||||
"en": "Strictly necessary for site operation: session/CSRF/auth tokens, shopping basket identifier, user-selected language preference at registration, cookie consent record. Cannot be disabled."
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "functional",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "기능 쿠키",
|
||||
"en": "Functional"
|
||||
},
|
||||
"description": {
|
||||
"ko": "사용자 선호도(다크모드, 표시 통화 등)를 기억하는 쿠키입니다. 거부 시 매 방문마다 기본값으로 표시됩니다.",
|
||||
"en": "Cookies that remember user preferences such as dark mode and display currency. If declined, defaults are used on every visit."
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "analytics",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "분석 쿠키",
|
||||
"en": "Analytics"
|
||||
},
|
||||
"description": {
|
||||
"ko": "방문자가 사이트를 어떻게 이용하는지 익명으로 측정해 더 나은 서비스를 만드는 데 사용됩니다. (예: Google Analytics, Hotjar)",
|
||||
"en": "Used to anonymously measure how visitors use the site so we can improve it. (e.g. Google Analytics, Hotjar)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "marketing",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "마케팅 쿠키",
|
||||
"en": "Marketing"
|
||||
},
|
||||
"description": {
|
||||
"ko": "관심사에 맞는 광고를 보여주거나, 광고가 얼마나 효과적이었는지 측정하는 데 사용됩니다. SNS 영상 임베드 등도 포함됩니다. (예: Facebook 픽셀, Google 광고, YouTube 영상)",
|
||||
"en": "Used to show ads relevant to your interests, measure ad performance, and embed social media content. (e.g. Facebook Pixel, Google Ads, YouTube embeds)"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -65,10 +158,36 @@ _단건 응답: `data` 객체의 필드._
|
||||
| cookie_categories | body | string | 아니오 | — | 쿠키 카테고리 카탈로그(JSON 문자열 또는 배열). 각 항목의 `key`는 necessary/functional/analytics/marketing 중 하나이며 `label.ko`/`label.en`이 필수입니다 |
|
||||
| blocked_domains | body | array | 아니오 | — | 카테고리별 차단 도메인 패턴 배열(necessary 제외). FQDN 및 `*.` 와일드카드 prefix만 허용되며 textarea 줄바꿈 입력도 배열로 정규화됩니다 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
PUT /api/plugins/sirsoft-gdpr/admin/settings HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"privacy_policy_slug": "example-key",
|
||||
"legal_entity_name": "예시 이름",
|
||||
"data_storage_location": "예시값",
|
||||
"banner_enabled": true,
|
||||
"banner_position": "bottom_bar",
|
||||
"cookie_categories": "예시값",
|
||||
"blocked_domains": [
|
||||
"예시값"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -92,6 +211,14 @@ _단건 응답: `data` 객체의 필드._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-gdpr/settings HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -109,6 +236,144 @@ _단건 응답: `data` 객체의 필드._
|
||||
| blocked_domains | object | `{"functional":["*.crisp.chat","widget.intercom.io"],"anal…` | 현재 설정된 카테고리별 차단 도메인 패턴(키→도메인 배열). 게스트도 차단이 동작해야 하므로 공개 응답에 노출되며 본 컨트롤러가 노출 SSoT입니다 |
|
||||
| default_blocked_domains_preview | object | `{"functional":["*.crisp.chat","client.crisp.chat","*.inte…` | 플러그인 기본 차단 도메인 카탈로그 미리보기(변경 불가 기본값). 관리자가 커스텀 차단 목록을 편집할 때 참고용 기본 패턴을 보여줍니다 |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"cookie_policy_version": "1",
|
||||
"privacy_policy_slug": "privacy",
|
||||
"privacy_policy_available": true,
|
||||
"legal_entity_name": "",
|
||||
"data_storage_location": "",
|
||||
"banner_enabled": true,
|
||||
"banner_position": "bottom_bar",
|
||||
"cookie_categories": [
|
||||
{
|
||||
"key": "necessary",
|
||||
"required": true,
|
||||
"label": {
|
||||
"ko": "필수 쿠키",
|
||||
"en": "Strictly Necessary"
|
||||
},
|
||||
"description": {
|
||||
"ko": "세션·CSRF·로그인 토큰, 장바구니 식별자, 사용자가 가입 시 선택한 언어 설정, 쿠키 동의 기록 등 사이트 운영에 반드시 필요한 항목입니다. 비활성화할 수 없습니다.",
|
||||
"en": "Strictly necessary for site operation: session/CSRF/auth tokens, shopping basket identifier, user-selected language preference at registration, cookie consent record. Cannot be disabled."
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "functional",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "기능 쿠키",
|
||||
"en": "Functional"
|
||||
},
|
||||
"description": {
|
||||
"ko": "사용자 선호도(다크모드, 표시 통화 등)를 기억하는 쿠키입니다. 거부 시 매 방문마다 기본값으로 표시됩니다.",
|
||||
"en": "Cookies that remember user preferences such as dark mode and display currency. If declined, defaults are used on every visit."
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "analytics",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "분석 쿠키",
|
||||
"en": "Analytics"
|
||||
},
|
||||
"description": {
|
||||
"ko": "방문자가 사이트를 어떻게 이용하는지 익명으로 측정해 더 나은 서비스를 만드는 데 사용됩니다. (예: Google Analytics, Hotjar)",
|
||||
"en": "Used to anonymously measure how visitors use the site so we can improve it. (e.g. Google Analytics, Hotjar)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "marketing",
|
||||
"required": false,
|
||||
"label": {
|
||||
"ko": "마케팅 쿠키",
|
||||
"en": "Marketing"
|
||||
},
|
||||
"description": {
|
||||
"ko": "관심사에 맞는 광고를 보여주거나, 광고가 얼마나 효과적이었는지 측정하는 데 사용됩니다. SNS 영상 임베드 등도 포함됩니다. (예: Facebook 픽셀, Google 광고, YouTube 영상)",
|
||||
"en": "Used to show ads relevant to your interests, measure ad performance, and embed social media content. (e.g. Facebook Pixel, Google Ads, YouTube embeds)"
|
||||
}
|
||||
}
|
||||
],
|
||||
"blocked_domains": {
|
||||
"functional": [
|
||||
"*.crisp.chat",
|
||||
"widget.intercom.io"
|
||||
],
|
||||
"analytics": [
|
||||
"google-analytics.com"
|
||||
],
|
||||
"marketing": [
|
||||
"facebook.com"
|
||||
]
|
||||
},
|
||||
"default_blocked_domains_preview": {
|
||||
"functional": [
|
||||
"*.crisp.chat",
|
||||
"client.crisp.chat",
|
||||
"*.intercom.io",
|
||||
"widget.intercom.io",
|
||||
"*.tawk.to",
|
||||
"embed.tawk.to",
|
||||
"cdn.weglot.com",
|
||||
"*.weglot.com",
|
||||
"*.usercentrics.eu"
|
||||
],
|
||||
"analytics": [
|
||||
"google-analytics.com",
|
||||
"*.google-analytics.com",
|
||||
"googletagmanager.com",
|
||||
"*.googletagmanager.com",
|
||||
"ssl.google-analytics.com",
|
||||
"*.hotjar.com",
|
||||
"static.hotjar.com",
|
||||
"*.mixpanel.com",
|
||||
"cdn.mxpnl.com",
|
||||
"*.amplitude.com",
|
||||
"cdn.amplitude.com",
|
||||
"*.segment.io",
|
||||
"*.segment.com",
|
||||
"wcs.naver.net",
|
||||
"wcs.naver.com",
|
||||
"*.beusable.net"
|
||||
],
|
||||
"marketing": [
|
||||
"facebook.net",
|
||||
"connect.facebook.net",
|
||||
"facebook.com",
|
||||
"*.facebook.com",
|
||||
"doubleclick.net",
|
||||
"*.doubleclick.net",
|
||||
"googleadservices.com",
|
||||
"googlesyndication.com",
|
||||
"ads.google.com",
|
||||
"*.criteo.com",
|
||||
"static.criteo.net",
|
||||
"*.adnxs.com",
|
||||
"*.taboola.com",
|
||||
"cdn.taboola.com",
|
||||
"*.outbrain.com",
|
||||
"*.kakao.com",
|
||||
"analytics.ad.daum.net",
|
||||
"platform.twitter.com",
|
||||
"*.twitter.com",
|
||||
"platform.linkedin.com",
|
||||
"*.linkedin.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
_대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있으면 보강 -->_
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Sirsoft\Gdpr\Support\ApiDoc;
|
||||
|
||||
use App\Contracts\ApiDoc\ApiDocSampleSeeder;
|
||||
use App\Models\User;
|
||||
use Plugins\Sirsoft\Gdpr\Enums\GdprPolicyChangeType;
|
||||
use Plugins\Sirsoft\Gdpr\Models\GdprPolicyVersion;
|
||||
|
||||
/**
|
||||
* sirsoft-gdpr API 문서 실측용 완전 샘플 시더
|
||||
*
|
||||
* 정책 버전 상세 GET(`admin/policy-versions/{version}`)은 route-model binding 없이
|
||||
* `show(int $version)` 로 `version` 컬럼 값을 조회한다. 실측 시 `{version}` 를 실제
|
||||
* 발행된 정책 버전 번호로 치환하지 못하면 상세 GET 이 실측 제외(unresolved-path-param)로
|
||||
* 남으므로, 이 시더는 발행된 정책 버전 1건을 멱등 생성하고 `policy-versions` 도메인의
|
||||
* `path_params` 맵으로 `{version}` 를 실제 버전 번호로 정확 일치 치환한다.
|
||||
*
|
||||
* `api:docgen --scope=plugin:sirsoft-gdpr --seed` 실행 시 커맨드가 규약 위치
|
||||
* (`Plugins\Sirsoft\Gdpr\Support\ApiDoc\ApiDocSampleService`)로 자동 발견한다.
|
||||
*/
|
||||
class ApiDocSampleService implements ApiDocSampleSeeder
|
||||
{
|
||||
/**
|
||||
* @var int 샘플 정책 버전 번호
|
||||
*/
|
||||
private const SAMPLE_VERSION = 1;
|
||||
|
||||
/**
|
||||
* GDPR 정책 버전 완전 샘플을 멱등 생성하고 `policy-versions` 도메인의 path_params 맵을 반환합니다.
|
||||
*
|
||||
* @return array<string, array{model: class-string, key: string, value: string, path_params?: array<string, string>}> 도메인 => 대표 레코드 정보
|
||||
*/
|
||||
public function seed(): array
|
||||
{
|
||||
if (! class_exists(GdprPolicyVersion::class)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$version = $this->seedPolicyVersion();
|
||||
|
||||
$entry = [
|
||||
'model' => GdprPolicyVersion::class,
|
||||
'key' => 'version',
|
||||
'value' => (string) $version->version,
|
||||
'path_params' => [
|
||||
'version' => (string) $version->version,
|
||||
],
|
||||
];
|
||||
|
||||
return [
|
||||
'policy-versions' => $entry,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 발행된 GDPR 정책 버전 1건을 멱등 생성합니다.
|
||||
*
|
||||
* @return GdprPolicyVersion 샘플 정책 버전
|
||||
*/
|
||||
private function seedPolicyVersion(): GdprPolicyVersion
|
||||
{
|
||||
$actor = User::query()->orderBy('id')->first();
|
||||
|
||||
return GdprPolicyVersion::query()->firstOrCreate(
|
||||
['version' => self::SAMPLE_VERSION],
|
||||
[
|
||||
'change_type' => GdprPolicyChangeType::Initial,
|
||||
'memo' => 'API 문서 실측용 샘플 정책 버전',
|
||||
'snapshot' => [
|
||||
'privacy_policy_slug' => 'privacy',
|
||||
'banner_enabled' => true,
|
||||
'banner_position' => 'bottom_bar',
|
||||
],
|
||||
'created_by' => $actor?->getKey(),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plugins\Sirsoft\Gdpr\Tests\Unit\Support;
|
||||
|
||||
use App\Contracts\ApiDoc\ApiDocSampleSeeder;
|
||||
use App\Models\User;
|
||||
use Plugins\Sirsoft\Gdpr\Models\GdprPolicyVersion;
|
||||
use Plugins\Sirsoft\Gdpr\Support\ApiDoc\ApiDocSampleService;
|
||||
use Plugins\Sirsoft\Gdpr\Tests\PluginTestCase;
|
||||
|
||||
/**
|
||||
* sirsoft-gdpr API 문서 실측용 완전 샘플 시더 테스트.
|
||||
*
|
||||
* 정책 버전 상세 GET(`admin/policy-versions/{version}`) 실측을 위한 발행 정책 버전
|
||||
* 대표 샘플이 생성되고, `policy-versions` 도메인의 path_params 맵이 반환되며,
|
||||
* 재실행 시 멱등한지 검증한다.
|
||||
*/
|
||||
class ApiDocSampleServiceTest extends PluginTestCase
|
||||
{
|
||||
/**
|
||||
* 실제 docgen 실행에서는 코어 ApiDocSampleService 가 먼저 실측 사용자를 시드한다.
|
||||
* 정책 버전의 created_by 소유자를 만족시키기 위해 사용자를 먼저 만든다.
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
User::factory()->create([
|
||||
'email' => 'apidoc-sample-user@example.com',
|
||||
'name' => 'API 문서 샘플 사용자',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 계약을 구현한다.
|
||||
*/
|
||||
public function test_seeder_implements_contract(): void
|
||||
{
|
||||
$this->assertInstanceOf(ApiDocSampleSeeder::class, new ApiDocSampleService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 발행된 정책 버전 대표 샘플을 생성한다.
|
||||
*/
|
||||
public function test_seed_creates_policy_version(): void
|
||||
{
|
||||
(new ApiDocSampleService)->seed();
|
||||
|
||||
$version = GdprPolicyVersion::query()->where('version', 1)->first();
|
||||
|
||||
$this->assertNotNull($version);
|
||||
$this->assertSame(1, $version->version);
|
||||
$this->assertNotNull($version->change_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 시더가 policy-versions 도메인의 path_params 맵을 반환한다.
|
||||
*/
|
||||
public function test_seed_returns_policy_versions_path_params_map(): void
|
||||
{
|
||||
$map = (new ApiDocSampleService)->seed();
|
||||
|
||||
$this->assertArrayHasKey('policy-versions', $map);
|
||||
$entry = $map['policy-versions'];
|
||||
$this->assertSame(GdprPolicyVersion::class, $entry['model']);
|
||||
$this->assertSame('version', $entry['key']);
|
||||
$this->assertArrayHasKey('version', $entry['path_params']);
|
||||
$this->assertSame('1', $entry['path_params']['version']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 재실행 시 정책 버전이 중복 생성되지 않는다 (멱등).
|
||||
*/
|
||||
public function test_seed_is_idempotent(): void
|
||||
{
|
||||
(new ApiDocSampleService)->seed();
|
||||
(new ApiDocSampleService)->seed();
|
||||
|
||||
$this->assertSame(1, GdprPolicyVersion::query()->where('version', 1)->count());
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
PUT /api/plugins/sirsoft-marketing/admin/channels HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
@@ -27,6 +27,14 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-marketing/settings HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/cbt-connectivity-check HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -38,6 +47,42 @@ _단건 응답: `data` 객체의 필드._
|
||||
| hosts | array | `[{"name":"devcbt.inicis.com","env":"test","dns_resolved_i…` | 진단 대상 호스트별 결과 배열. 각 항목은 호스트명(`devcbt.inicis.com`), 환경(`test`), DNS 해석 IP(`dns_resolved_ip`), TCP 443 도달 여부(`tcp_443_reachable`)와 에러·응답지연(`tcp_443_error`, `tcp_443_latency_ms`)을 담는다. 운영계(`cbt.inicis.com`)는 화이트리스트 제약이 없어 제외된다. |
|
||||
| callback | object | `{"app_url":"https:\/\/test.example.com","callback_url":"h…` | 결제 콜백 URL 진단 정보. 앱 URL·콜백 URL과 각각의 HTTPS 여부(`app_url_https`, `callback_url_https`)·공인 호스트 여부(`app_url_public`, `callback_url_public`), 그리고 콜백 호스트가 앱 URL 호스트와 일치하는지(`host_matches_app_url`)를 담아 CBT 콜백 수신 가능 여부를 점검한다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "sirsoft-pay_kginicis::messages.cbt_connectivity.checked",
|
||||
"data": {
|
||||
"egress_ip": "59.10.38.149",
|
||||
"server_ip": "127.0.0.1",
|
||||
"hosts": [
|
||||
{
|
||||
"name": "devcbt.inicis.com",
|
||||
"env": "test",
|
||||
"dns_resolved_ip": "183.109.71.154",
|
||||
"tcp_443_reachable": false,
|
||||
"tcp_443_error": "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond",
|
||||
"tcp_443_latency_ms": 3008
|
||||
}
|
||||
],
|
||||
"callback": {
|
||||
"app_url": "https://test.example.com",
|
||||
"callback_url": "https://api.example.com/plugins/sirsoft-pay_kginicis/payment/cbt/callback",
|
||||
"app_url_https": true,
|
||||
"callback_url_https": true,
|
||||
"app_url_public": true,
|
||||
"callback_url_public": true,
|
||||
"host_matches_app_url": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -62,9 +107,44 @@ _단건 응답: `data` 객체의 필드._
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/cbt-test-product HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| product_id | integer | `4` | product 식별자 (연관 리소스 참조) |
|
||||
| product_code | string | `CBT-TEST-20260708063238` | 생성된 테스트 상품의 상품코드. `CBT-TEST-` 접두사에 생성 시각(YmdHis)을 붙여 자동 부여되며, SKU는 여기에 `KGINICIS-` 접두사를 더해 만들어진다. |
|
||||
| admin_url | string | `/admin/ecommerce/products/4/edit` | admin URL |
|
||||
| shop_url | string | `/shop/products/4?locale=ja` | shop URL |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"product_id": 4,
|
||||
"product_code": "CBT-TEST-20260708063238",
|
||||
"admin_url": "/admin/ecommerce/products/4/edit",
|
||||
"shop_url": "/shop/products/4?locale=ja"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/orders/test-mode-map HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -37,6 +46,22 @@ _단건 응답: `data` 객체의 필드._
|
||||
| 20260619-1425382147 | boolean | `true` | 위와 동일 — 키가 주문번호, 값 `true`는 테스트 모드 결제 주문임을 나타낸다. |
|
||||
| APIDOC-KGINICIS-000001 | boolean | `true` | 위와 동일 — 키가 주문번호, 값 `true`는 테스트 모드 결제 주문임을 나타낸다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"APIDOC-KGINICIS-000001": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -62,10 +87,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cash-receipt HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -92,6 +130,15 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-cvs HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -119,7 +166,7 @@ _단건 응답: `data` 객체의 필드._
|
||||
| last_notify_result | string | `` | 마지막 입금 통보(NOTI) 처리 결과. `confirmed`(입금확정)·`ignored`(무시)·`failed`(검증실패) 중 하나가 기록된다. |
|
||||
| last_notify_reason | string | `` | 마지막 통보 처리 결과의 상세 사유(예: `deposit_confirmed`, `tid_mismatch`, `amount_mismatch`, `already_paid` 등). |
|
||||
| notify_history | array | `[]` | 최근 입금 통보 이력 목록(최대 10건). 각 항목은 수신시각·발신IP·결과·사유와 통보 payload 요약(tid·금액·통화 등)을 담는다. |
|
||||
| notify_url | string | `https://g7_2.dev/plugins/sirsoft-pay_…` | notify URL |
|
||||
| notify_url | string | `https://api.example.com/plugins/sirsoft-pay_…` | notify URL |
|
||||
| can_simulate_notify | boolean | `false` | simulate notify 수행 가능 여부 (권한 기반) |
|
||||
| can_mark_expired | boolean | `false` | mark expired 수행 가능 여부 (권한 기반) |
|
||||
| last_recheck_at | string | `` | last recheck 일시 |
|
||||
@@ -127,6 +174,49 @@ _단건 응답: `data` 객체의 필드._
|
||||
| expired_at | string | `` | expired 일시 |
|
||||
| expiry_reason | string | `` | 만료 처리 사유. 입금 기한 경과로 만료된 경우 `payment_term_elapsed` 가 기록된다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"is_cbt_cvs": true,
|
||||
"order_number": "APIDOC-KGINICIS-000001",
|
||||
"order_status": "pending_payment",
|
||||
"payment_status": "paid",
|
||||
"tid": "INIJPGCARDapidocsmpl0000000001",
|
||||
"amount": 5000,
|
||||
"currency": "KRW",
|
||||
"cbt_mid": "apidocmid1",
|
||||
"cbt_sid": "apidocsid1",
|
||||
"is_test_mode": true,
|
||||
"convenience": "seven_eleven",
|
||||
"conf_no": "1234567890",
|
||||
"receipt_no": "0987654321",
|
||||
"payment_term": "20260710235959",
|
||||
"payment_term_formatted": "2026-07-10 23:59:59",
|
||||
"is_expired_by_time": false,
|
||||
"cvs_status": "waiting_deposit",
|
||||
"last_notify_at": "",
|
||||
"last_notify_result": "",
|
||||
"last_notify_reason": "",
|
||||
"notify_history": [],
|
||||
"notify_url": "https://api.example.com/plugins/sirsoft-pay_kginicis/payment/cbt/cvs-notify",
|
||||
"can_simulate_notify": false,
|
||||
"can_mark_expired": false,
|
||||
"last_recheck_at": "",
|
||||
"last_recheck_result": "",
|
||||
"expired_at": "",
|
||||
"expiry_reason": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -153,10 +243,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-cvs/expire HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -183,9 +286,92 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-cvs/recheck HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| is_cbt_cvs | boolean | `true` | cbt cvs 여부 |
|
||||
| order_number | string | `APIDOC-KGINICIS-000001` | 주문번호 |
|
||||
| order_status | string | `pending_payment` | 주문상태 (OrderStatusEnum) |
|
||||
| payment_status | string | `paid` | 결제 상태값(PaymentStatusEnum). CVS 입금 흐름에서는 `waiting_deposit`(입금대기) → `paid`(입금완료) 또는 `expired`(기한만료) 로 전이한다. |
|
||||
| tid | string | `INIJPGCARDapidocsmpl0000000001` | KG 이니시스 거래 ID(transaction_id). 결제 승인·통보를 식별하는 이니시스 측 거래번호다. |
|
||||
| amount | integer | `5000` | 청구 금액. 결제 메타의 `cvs_amount`(CVS 통보 기준 결제 통화 환산액)를 우선 사용하고, 없으면 결제 승인액 또는 주문 총 청구액으로 대체한다. |
|
||||
| currency | string | `KRW` | 결제 통화 (KRW, USD, EUR 등) |
|
||||
| cbt_mid | string | `apidocmid1` | CBT(일본결제)에 사용된 KG 이니시스 일본 가맹점 ID. 입금 통보(NOTI) 검증 시 통보의 mid와 대조하는 기준값이다. |
|
||||
| cbt_sid | string | `apidocsid1` | CBT 결제 세션/상점 식별자(SID). 입금 통보의 sid와 일치하는지 검증하는 데 사용된다. |
|
||||
| is_test_mode | boolean | `true` | test mode 여부 |
|
||||
| convenience | string | `seven_eleven` | 구매자가 선택한 일본 편의점 식별값. 어느 편의점에서 입금하는지를 나타낸다. |
|
||||
| conf_no | string | `1234567890` | 편의점 입금용 확인번호(수납확인번호). 구매자가 편의점 단말에서 입력·제시하는 번호다. |
|
||||
| receipt_no | string | `0987654321` | 편의점 입금용 접수번호(수납번호). 확인번호와 함께 편의점 결제 접수를 식별한다. |
|
||||
| payment_term | string | `20260710235959` | 편의점 입금 마감 일시(YmdHis 압축 문자열). 이 기한이 지나면 시간 경과 만료 대상이 된다. |
|
||||
| payment_term_formatted | string | `2026-07-10 23:59:59` | `payment_term` 값의 표시용 포맷 문자열 (통화/용량/일시 등 로케일·단위 포맷) |
|
||||
| is_expired_by_time | boolean | `false` | expired by time 여부 |
|
||||
| cvs_status | string | `waiting_deposit` | CVS 입금 상태(`payment_meta.cvs_status`). 입금대기(`waiting_deposit`)·입금완료(`paid`)·만료(`expired`) 등을 나타내며, 메타값이 없고 결제가 입금대기면 `waiting_deposit`로 채운다. |
|
||||
| last_notify_at | string | `` | last notify 일시 |
|
||||
| last_notify_result | string | `` | 마지막 입금 통보(NOTI) 처리 결과. `confirmed`(입금확정)·`ignored`(무시)·`failed`(검증실패) 중 하나가 기록된다. |
|
||||
| last_notify_reason | string | `` | 마지막 통보 처리 결과의 상세 사유(예: `deposit_confirmed`, `tid_mismatch`, `amount_mismatch`, `already_paid` 등). |
|
||||
| notify_history | array | `[]` | 최근 입금 통보 이력 목록(최대 10건). 각 항목은 수신시각·발신IP·결과·사유와 통보 payload 요약(tid·금액·통화 등)을 담는다. |
|
||||
| notify_url | string | `http://localhost/plugins/sirsoft-pay_…` | notify URL |
|
||||
| can_simulate_notify | boolean | `false` | simulate notify 수행 가능 여부 (권한 기반) |
|
||||
| can_mark_expired | boolean | `false` | mark expired 수행 가능 여부 (권한 기반) |
|
||||
| last_recheck_at | string | `2026-07-08T06:32:39+00:00` | last recheck 일시 |
|
||||
| last_recheck_result | string | `local_status_checked` | 마지막 로컬 상태 재확인 결과. recheck 액션 실행 시 `local_status_checked` 로 기록되며, CBT 편의점 입금은 외부 PG 조회 대상이 아니라 로컬 확인 흔적만 남긴다. |
|
||||
| expired_at | string | `` | expired 일시 |
|
||||
| expiry_reason | string | `` | 만료 처리 사유. 입금 기한 경과로 만료된 경우 `payment_term_elapsed` 가 기록된다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "sirsoft-pay_kginicis::messages.cbt_cvs.recheck_success",
|
||||
"data": {
|
||||
"is_cbt_cvs": true,
|
||||
"order_number": "APIDOC-KGINICIS-000001",
|
||||
"order_status": "pending_payment",
|
||||
"payment_status": "paid",
|
||||
"tid": "INIJPGCARDapidocsmpl0000000001",
|
||||
"amount": 5000,
|
||||
"currency": "KRW",
|
||||
"cbt_mid": "apidocmid1",
|
||||
"cbt_sid": "apidocsid1",
|
||||
"is_test_mode": true,
|
||||
"convenience": "seven_eleven",
|
||||
"conf_no": "1234567890",
|
||||
"receipt_no": "0987654321",
|
||||
"payment_term": "20260710235959",
|
||||
"payment_term_formatted": "2026-07-10 23:59:59",
|
||||
"is_expired_by_time": false,
|
||||
"cvs_status": "waiting_deposit",
|
||||
"last_notify_at": "",
|
||||
"last_notify_result": "",
|
||||
"last_notify_reason": "",
|
||||
"notify_history": [],
|
||||
"notify_url": "http://localhost/plugins/sirsoft-pay_kginicis/payment/cbt/cvs-notify",
|
||||
"can_simulate_notify": false,
|
||||
"can_mark_expired": false,
|
||||
"last_recheck_at": "2026-07-08T06:32:39+00:00",
|
||||
"last_recheck_result": "local_status_checked",
|
||||
"expired_at": "",
|
||||
"expiry_reason": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
@@ -213,10 +399,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-cvs/simulate-notify HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -243,12 +442,35 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-reconciliation HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
|
||||
|
||||
<!-- 실측 응답에 필드 없음(빈 목록 등) — 데이터가 있는 상태로 재실측하거나 사람이 작성. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -275,10 +497,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/cbt-reconciliation/refund-retry HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -305,6 +540,15 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/escrow-delivery HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -320,6 +564,49 @@ _단건 응답: `data` 객체의 필드._
|
||||
| escrow_confirm | null | `null` | 구매확정 이력(`payment_meta.escrow_confirm`). 구매자 구매확정 처리 전이면 `null`이다. |
|
||||
| deny_confirmed | boolean | `false` | 판매자 구매거절 확인 이력(`payment_meta.escrow_deny_confirm`) 존재 여부. 이미 거절확인했으면 `true`가 되어 중복 처리를 막는다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"has_escrow_payment": true,
|
||||
"tid": "INIJPGCARDapidocsmpl0000000001",
|
||||
"price": 460829,
|
||||
"courier_codes": {
|
||||
"hanjin": "한진택배",
|
||||
"cjgls": "CJ대한통운",
|
||||
"loge": "롯데택배",
|
||||
"epost": "우체국택배",
|
||||
"lotte": "롯데글로벌로지스",
|
||||
"kdexp": "경동택배",
|
||||
"cvs": "편의점택배",
|
||||
"ilyang": "일양로지스",
|
||||
"chunil": "천일택배",
|
||||
"cvsnet": "CVSnet편의점",
|
||||
"daesin": "대신택배",
|
||||
"kunyoung": "건영택배",
|
||||
"gsilogis": "GSI Express",
|
||||
"etc": "기타"
|
||||
},
|
||||
"prefill": {
|
||||
"recvName": "API 문서 샘플 수령인",
|
||||
"recvTel": "010-0000-0002",
|
||||
"recvPost": "06134",
|
||||
"recvAddr": "서울특별시 강남구 테헤란로 001 API 문서 샘플 빌딩 1층"
|
||||
},
|
||||
"registered_delivery": null,
|
||||
"escrow_confirm": null,
|
||||
"deny_confirmed": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -346,10 +633,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/escrow-delivery HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -376,10 +676,23 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/escrow-deny-confirm HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-502 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -406,6 +719,15 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/orders/APIDOC-KGINICIS-000001/transaction-status HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
@@ -459,6 +781,77 @@ _단건 응답: `data` 객체의 필드._
|
||||
| _local_notice | string | `CBT 거래는 한국 INIAPI 거래조회 대상이 아니므로 저장된 승…` | CBT 로컬 확인 경로에서만 채워지는 안내 문구. 이 거래가 실시간 PG 조회가 아니라 저장된 승인/입금 정보로 표시됨을 관리자에게 알린다. |
|
||||
| _cbt_cvs | object | `{"status":"waiting_deposit","last_notify_at":"","last_not…` | CBT 편의점(CVS) 결제일 때만 채워지는 입금 운영 요약. 입금 상태·최근 통보/재확인 결과·만료 정보·최근 통보 이력(최대 10건)을 담으며, CVS가 아니면 `null`이다. |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "messages.success",
|
||||
"data": {
|
||||
"resultCode": "0000",
|
||||
"resultMsg": "정상처리",
|
||||
"tid": "INIJPGCARDapidocsmpl0000000001",
|
||||
"_is_cbt": true,
|
||||
"_is_local_confirmation": true,
|
||||
"_is_test_mode": true,
|
||||
"_local_is_escrow": true,
|
||||
"_pay_method": "CVS",
|
||||
"_base_pay_method_label": "일본 편의점결제",
|
||||
"_embedded_pg_provider": null,
|
||||
"_embedded_pg_provider_label": null,
|
||||
"_pay_method_label": "일본 편의점결제",
|
||||
"_auth_code": null,
|
||||
"_auth_date": "2026-07-08 06:32:34",
|
||||
"_total_price": "5000",
|
||||
"_currency": "JPY",
|
||||
"_moid": "APIDOC-KGINICIS-000001",
|
||||
"_buyer_name": "API 문서 샘플 구매자",
|
||||
"_buyer_email": "apidoc-sample-user@example.com",
|
||||
"_buyer_tel": "010-0000-0001",
|
||||
"_status": "waiting_deposit",
|
||||
"_cancel_price": null,
|
||||
"_cancel_date": null,
|
||||
"_part_cancel_list": [],
|
||||
"_card_name": "신한카드",
|
||||
"_card_num": "2570-****-****-6458",
|
||||
"_card_code": null,
|
||||
"_card_quota": "일시불",
|
||||
"_card_interest": null,
|
||||
"_vbank_num": null,
|
||||
"_vbank_bank_code": null,
|
||||
"_vbank_bank_name": "CVS",
|
||||
"_vbank_holder": null,
|
||||
"_vbank_expire_date": "2026-07-10 23:59:59",
|
||||
"_vbank_status": "waiting_deposit",
|
||||
"_vbank_paid_at": null,
|
||||
"_bank_code": null,
|
||||
"_bank_name": null,
|
||||
"_bank_acnt_num": null,
|
||||
"_hpp_num": null,
|
||||
"_hpp_corp": null,
|
||||
"_escrow_status": null,
|
||||
"_escrow_confirm": null,
|
||||
"_inquiry_at": "2026-07-08 06:32:40",
|
||||
"_local_notice": "CBT 거래는 한국 INIAPI 거래조회 대상이 아니므로 저장된 승인/입금 확인 정보로 표시됩니다.",
|
||||
"_cbt_cvs": {
|
||||
"status": "waiting_deposit",
|
||||
"last_notify_at": "",
|
||||
"last_notify_result": "",
|
||||
"last_notify_reason": "",
|
||||
"last_recheck_at": "",
|
||||
"last_recheck_result": "",
|
||||
"expired_at": "",
|
||||
"expiry_reason": "",
|
||||
"notify_history": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -485,12 +878,84 @@ _단건 응답: `data` 객체의 필드._
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| orderNumber | path | string | 예 | — | 대상 order number의 식별자 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/user/orders/APIDOC-KGINICIS-000001/receipt HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN} (optional.sanctum: 비회원은 헤더 생략 가능)
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
|
||||
|
||||
<!-- 실측 응답에 필드 없음(빈 목록 등) — 데이터가 있는 상태로 재실측하거나 사람이 작성. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"receipt_type": "cbt_confirmation",
|
||||
"receipt_url": null,
|
||||
"receipt_label": "결제확인",
|
||||
"receipt_view_label": "결제확인서 보기",
|
||||
"receipt_title": "KG 이니시스 CBT 결제확인서",
|
||||
"receipt_notice": "일본 CBT 결제는 한국 KG 이니시스 매출전표 조회와 별도로 결제 승인 정보를 표시합니다.",
|
||||
"receipt_fields": [
|
||||
{
|
||||
"label": "주문번호",
|
||||
"value": "APIDOC-KGINICIS-000001"
|
||||
},
|
||||
{
|
||||
"label": "결제수단",
|
||||
"value": "일본 편의점결제"
|
||||
},
|
||||
{
|
||||
"label": "거래번호",
|
||||
"value": "INIJPGCARDapidocsmpl0000000001"
|
||||
},
|
||||
{
|
||||
"label": "결제금액",
|
||||
"value": "5,000 KRW"
|
||||
},
|
||||
{
|
||||
"label": "입금 상태",
|
||||
"value": "입금완료"
|
||||
},
|
||||
{
|
||||
"label": "편의점 코드",
|
||||
"value": "seven_eleven"
|
||||
},
|
||||
{
|
||||
"label": "편의점 확인번호",
|
||||
"value": "1234567890"
|
||||
},
|
||||
{
|
||||
"label": "편의점 접수번호",
|
||||
"value": "0987654321"
|
||||
},
|
||||
{
|
||||
"label": "입금 마감일시",
|
||||
"value": "2026-07-10 23:59:59"
|
||||
}
|
||||
],
|
||||
"is_test_mode": true,
|
||||
"payment_method_label": "일본 편의점결제",
|
||||
"payment_method_display_label": "일본 편의점결제",
|
||||
"cbt_pay_method": "CVS",
|
||||
"payment_status": "paid",
|
||||
"selected_payment_method": null,
|
||||
"embedded_pg_provider": null,
|
||||
"embedded_pg_provider_label": null
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
|
||||
@@ -27,10 +27,22 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/payment/cbt/checkout-token HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
_대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있으면 보강 -->_
|
||||
@@ -52,10 +64,22 @@ _대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/payment/cbt/hash-data HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
_대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있으면 보강 -->_
|
||||
@@ -84,10 +108,32 @@ _대표 에러 없음 (공개 조회). <!-- TODO: 도메인 특이 에러가 있
|
||||
| payment_method | body | string | 아니오 | max 50 | 사용자가 결제창에서 선택했던 간편결제 등 결제수단 식별값. 결제 메타에 병합해 어떤 수단에서 창을 닫았는지 남긴다. |
|
||||
| reason | body | string | 아니오 | max 80 | 결제창 닫힘 사유 문자열. 실패/취소 이력에 참고 정보로 기록된다. |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/payment/close-report HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"oid": "예시값",
|
||||
"price": 1,
|
||||
"buyer_email": "user@example.com",
|
||||
"buyer_phone": "010-1234-5678",
|
||||
"payment_method": "예시값",
|
||||
"reason": "예시값"
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-404 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -117,10 +163,31 @@ PC 표준결제창(KRW)에서 사용자가 결제를 완료하지 않고 창을
|
||||
| buyer_email | body | string | 아니오 | max 255 | 구매자 이메일. 제공 시 주문의 구매자 정보와 대조해 본인 결제 요청인지 확인하는 데 사용된다. |
|
||||
| buyer_phone | body | string | 아니오 | max 30 | 구매자 전화번호. 제공 시 주문의 구매자 정보와 대조해 본인 결제 요청인지 확인하는 데 사용된다. |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/payment/mobile/signature HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"oid": "예시값",
|
||||
"price": 1,
|
||||
"timestamp": "예시값",
|
||||
"buyer_email": "user@example.com",
|
||||
"buyer_phone": "010-1234-5678"
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
@@ -150,10 +217,31 @@ PC 표준결제창(KRW)에서 사용자가 결제를 완료하지 않고 창을
|
||||
| buyer_email | body | string | 아니오 | max 255 | 구매자 이메일. 제공 시 주문의 구매자 정보와 대조해 본인 결제 요청인지 확인하는 데 사용된다. |
|
||||
| buyer_phone | body | string | 아니오 | max 30 | 구매자 전화번호. 제공 시 주문의 구매자 정보와 대조해 본인 결제 요청인지 확인하는 데 사용된다. |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/payment/signature HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"oid": "예시값",
|
||||
"price": 1,
|
||||
"timestamp": "예시값",
|
||||
"buyer_email": "user@example.com",
|
||||
"buyer_phone": "010-1234-5678"
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
|
||||
@@ -27,10 +27,23 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
POST /api/plugins/sirsoft-pay_kginicis/admin/transaction/query HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: write-method — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
**응답 예시**
|
||||
|
||||
<!-- 실측 제외: http-422 — 응답 예시는 사람이 작성하세요. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
| 상태코드 | 의미 | 발생 조건 |
|
||||
|
||||
@@ -26,14 +26,39 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-pay_kginicis/admin/vbank-notify-url HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
_단건 응답: `data` 객체의 필드._
|
||||
|
||||
| 필드 | 타입 | 실측 예시값 | 용도/설명 |
|
||||
| --- | --- | --- | --- |
|
||||
| url | string | `https://g7_2.dev/plugins/sirsoft-pay_…` | PC 웹용 가상계좌 입금통보(NOTI) 수신 콜백 URL(`/plugins/sirsoft-pay_kginicis/payment/vbank-notify`)의 절대 주소. 운영자가 이 값을 KG 이니시스 가맹점 설정에 입금통보 URL로 등록하면, 구매자가 가상계좌에 실제 입금했을 때 KG 이니시스가 이 주소로 통보한다. |
|
||||
| mobile_url | string | `https://g7_2.dev/plugins/sirsoft-pay_…` | mobile URL |
|
||||
| url | string | `https://api.example.com/plugins/sirsoft-pay_…` | PC 웹용 가상계좌 입금통보(NOTI) 수신 콜백 URL(`/plugins/sirsoft-pay_kginicis/payment/vbank-notify`)의 절대 주소. 운영자가 이 값을 KG 이니시스 가맹점 설정에 입금통보 URL로 등록하면, 구매자가 가상계좌에 실제 입금했을 때 KG 이니시스가 이 주소로 통보한다. |
|
||||
| mobile_url | string | `https://api.example.com/plugins/sirsoft-pay_…` | mobile URL |
|
||||
|
||||
**응답 예시**
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"url": "https://api.example.com/plugins/sirsoft-pay_kginicis/payment/vbank-notify",
|
||||
"mobile_url": "https://api.example.com/plugins/sirsoft-pay_kginicis/payment/mobile/vbank-notify"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**에러 응답**
|
||||
|
||||
|
||||
@@ -27,9 +27,20 @@
|
||||
|
||||
_요청 파라미터 없음._
|
||||
|
||||
**요청 예시**
|
||||
|
||||
```http
|
||||
GET /api/plugins/sirsoft-verification_kginicis/me/identity/inicis HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
```
|
||||
|
||||
**응답 필드** (`data` 내부)
|
||||
|
||||
<!-- 실측 제외: no-token — 응답 필드는 사람이 작성하세요. -->
|
||||
|
||||
|
||||
<!-- 실측 응답에 필드 없음(빈 목록 등) — 데이터가 있는 상태로 재실측하거나 사람이 작성. -->
|
||||
|
||||
**에러 응답**
|
||||
|
||||
@@ -59,7 +70,7 @@ _요청 파라미터 없음._
|
||||
| is_foreigner | boolean | `false` | 외국인 여부. |
|
||||
|
||||
이 외에 `BaseApiResource` 공통 메타 `is_owner`(항상 본인이므로 `true`) + `abilities` 가 함께 붙는다.
|
||||
- **미설치 주의**: 이 문서는 플러그인 미설치 상태의 라우트 정적 분석으로 생성되어 실측 응답이 없다(`no-token`). 설치 후 `php artisan api:docgen --scope=plugin:sirsoft-verification_kginicis --seed` 로 실측하면 응답 예시가 채워진다.
|
||||
- **응답 예시 주의**: 실측 시 샘플 사용자에게 본인인증 record 가 없어 `data: null`(record 없음) 응답만 관측된다. 아래 두 응답 예시 중 "record 존재 시" 는 `InicisIdentityResource` 구조 기준 정적 작성이다. 실제 record 가 있는 사용자로 실측하면 마스킹된 본인확인 정보가 채워진다.
|
||||
|
||||
**응답 예시** (record 존재 시 — 정적, `InicisIdentityResource` 구조 기준)
|
||||
|
||||
|
||||
Reference in new issue
Block a user