주문 취소 웹훅
Aghanim은 주문 취소 웹훅을 활용하여 은행이나 결제 시스템에서 취소된 거래를 알리고 해당 이벤트에 대한 자세한 정보를 제공합니다.
주문 취소 웹훅은 주문 취소 이벤트를 통해 활성화되며, 이것은 게임 → 웹훅에서 선택할 수 있습니다.
경고
플레이어 계정에서 게임 아이템을 제거하려면 item.remove 웹훅을 사용하세요. 주문 취소 웹훅은 item.remove가 충분하지 않을 때 상세한 데이터를 제공하도록 설계되었습니다.


요구 사항
Aghanim의 주문 취소 웹훅을 사용하려면 웹훅 서버를 다음과 같이 구성해야 합니다.
- POST 웹훅 요청을 수락하는 HTTPS 엔드포인트.
- Aghanim이 생성하고 서명한 이벤트를 수신합니다.
- 웹훅 페이로드에 포함된
idempotency_key를 처리하여 중복 웹훅 처리를 방지합니다. - 주문 취소 이벤트 처리 성공 시 2xx 상태 코드로 응답하고, 거부 또는 오류 시 4xx 또는 5xx 상태 코드로 응답합니다.
구성
order.canceled웹훅 처리를 위한 함수를 개발합니다.- 엔드포인트를 사용 가능하게 설정하세요.
- Aghanim 계정 내에서 엔드포인트를 등록합니다 → 게임 → 웹훅 → 새 웹훅에서 주문 취소됨 이벤트를 선택합니다.
대안으로, 웹후크 생성 API 방법을 사용하여 Aghanim 내에서 엔드포인트를 등록할 수 있습니다.
요청 스키마
아래는 예시입니다 주문.취소 됨 웹훅 요청:
- HTTP
- cURL
POST /your/webhook/uri HTTP/1.1
Content-Type: application/json
Host: your-webhook-endpoint.com
User-Agent: Aghanim/0.1.0
X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812
X-Aghanim-Signature-Timestamp: 1725548450
{
"event_type": "주문.취소됨",
"event_data": {
"amount": 9499,
"company_id": "com_exTAxmkZQCO",
"country": "미국",
"created_at": 1725547595,
"currency": "USD",
"game_id": "gm_exTAyxPsVwh",
"id": "ord_eCacpFwavzi",
"items": [
{
"id": "itm_exTBZQmIlDz",
"name": "크리스탈",
"description": "이 거대한 크리스탈 보물로 경쟁자들 위에 군림하십시오.",
"sku": "crystals",
"quantity": 480000,
"price": 9499,
"price_decimal": 94.99,
"currency": "USD",
"type": "item",
"nested_items": null
}
],
"modified_at": 1725547657,
"player_id": "2D2R-OP3C",
"receipt_number": "2409051289614565",
"status": "취소됨",
"user_id": "usr_eymySUreClx",
"metadata": null
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": "idmpt_aXRlb...JkX2VFS",
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "결제.취소",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}
curl "https://your-webhook-endpoint.com/your/webhook/uri" \
-X POST \
-H "Content-Type: application/json" \
-H "User-Agent: Aghanim/0.1.0" \
-H "X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812" \
-H "X-Aghanim-Signature-Timestamp: 1725548450" \
-d '{
"event_type": "주문.취소됨",
"event_data": {
"amount": 9499,
"company_id": "com_exTAxmkZQCO",
"country": "미국",
"created_at": 1725547595,
"currency": "USD",
"game_id": "gm_exTAyxPsVwh",
"id": "ord_eCacpFwavzi",
"items": [
{
"id": "itm_exTBZQmIlDz",
"name": "크리스탈",
"description": "이 거대한 크리스탈 보물로 경쟁자들 위에 군림하십시오.",
"sku": "crystals",
"quantity": 480000,
"price": 9499,
"price_decimal": 94.99,
"currency": "USD",
"type": "item",
"nested_items": null
}
],
"modified_at": 1725547657,
"player_id": "2D2R-OP3C",
"receipt_number": "2409051289614565",
"status": "취소됨",
"user_id": "usr_eymySUreClx",
"metadata": null
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": "idmpt_aXRlb...JkX2VFS",
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "결제.취소",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}'
이벤트 스키마
| Key | 유형 | 설명 |
|---|---|---|
event_id | string | Aghanim에 의해 생성된 고유 이벤트 ID. |
game_id | string | Aghanim 시스템에서의 귀하의 게임 ID. |
event_type | string | 이벤트의 유형, 주문.취소됨 이럴 경우. |
event_time | number | 유닉스 에포크 시간으로 된 이벤트 날짜. |
event_data | EventData | 이벤트 특정 데이터가 포함되어 있으며, 상속된 객체에 대한 가능한 키가 포함됩니다. |
idempotency_key | string | 웹훅 작업이 재시도되어도 한 번만 실행되도록 보장합니다. |
request_id | string|null | 이벤트가 API 요청에 의해 트리거된 경우, 요청 ID가 포함됩니다. |
sandbox | boolean | 이 이벤트가 샌드박스 게임 환경에서 전송되었는지를 표시합니다. |
trigger | string|null | The trigger that caused the event to be sent. |
transaction_id | string | Aghanim이 생성한 거래 ID입니다. 이 ID는 동일한 거래 내에서 발생한 여러 이벤트에서 동일할 수 있습니다. |
context | EventContext|null | 이벤트에 대한 컨텍스트 정보. |
EventContext 스키마
| Key | 유형 | 설명 |
|---|---|---|
order | OrderContext|null | 해당되는 경우 이벤트와 관련된 주문 정보입니다. |
player | PlayerContext|null | 플레이어 정보를 추가하려면 웹훅 설정에서 "플레이어 컨텍스트 추가"를 활성화하세요. |
EventData 스키마
| Key | 유형 | 설명 |
|---|---|---|
id | string | Aghanim에 의해 생성된 주문 ID. |
company_id | string | Aghanim 시스템에서의 귀하의 회사 ID. |
game_id | string | Aghanim 시스템에서의 귀하의 게임 ID. |
user_id | string | Aghanim 시스템에서 게임 허브 유저 ID. |
player_id | string | 고유한 플레이어 인증에 선택된 플레이어 ID. |
status | string | 주문 상태. 가능한 상태: created,captured,paid,canceled,refunded,refund_requested. |
amount | number | 주문 금액 소수 통화 단위. |
currency | string | 주문 통화. |
country | string | 결제 수단 국가. |
created_at | number | 유닉스 에포크 시간으로 된 주문 생성 날짜. |
modified_at | number | 유닉스 에포크 시간으로 된 주문 수정 날짜. |
items | Item[] | 구매한 아이템 세부사항 포함. |
fees | Fees | 세금 및 수수료에 대한 정보. |
revenue_usd | number | 예상 순수익은 예상 외환 환율 및 결제 수단 수수료를 사용하여 USD 센트로 변환됩니다. 최종 수치는 결제 제공업체와의 조정 후 다음 달 10일까지 결정됩니다. |
metadata | object|null | 주문에 대한 추가 정보를 저장하기 위한 키-값 쌍으로 구성된 메타데이터 객체입니다. |
creator | Creator|null | Information about creator associated with the order. |
아이템 스키마
| Key | Type | 설명 |
|---|---|---|
id | string | Aghanim에 의해 생성된 아이템 ID. |
name | string | 아이템 이름. |
description | string|null | 아이템 설명. |
sku | string | 게임과 Aghanim 측 모두에서 일치하는 아이템 SKU. |
quantity | number | 아이템 수량. |
price | number | 아이템 가격 소수 통화 단위. |
price_decimal | number | 소수점 단위로 표시된 아이템 가격입니다. |
currency | string | 항목 가격 통화. |
type | string | 항목 유형. 가능한 값: item, bundle. |
nested_items | NestedItem[]|null | 번들에 포함된 항목 배열. |
fallback_item | Item|null | 주 아이템을 플레이어에게 제공할 수 없을 경우 백업으로 제공할 수 있는 아이템입니다. |
항목 유형 bundle 내부에 여러 중첩된 항목을 포함할 수 있습니다.
번들의 공통 SKU를 처리하거나 각 중첩 항목을 개별적으로 처리할 수 있습니다.
NestedItem 스키마
| Key | 유형 | 설명 |
|---|---|---|
id | string | Aghanim에 의해 생성된 아이템 ID. |
name | string | 아이템 이름. |
description | string|null | 아이템 설명. |
sku | string | 게임과 Aghanim 측 모두에서 일치하는 아이템 SKU. |
quantity | number | 아이템 수량. |
type | string | 항목 유형. 가능한 값: item, bundle. |
nested_items | NestedItem[]|null | 번들에 포함된 항목 배열. |
PlayerContext 스키마
| Key | 유형 | 설명 |
|---|---|---|
player_id | string|null | 고유한 플레이어 인증에 선택된 플레이어 ID. |
player | object|null | 복합 인증 사용 시 플레이어 ID 구성 요소. |
attributes | Attributes | Aghanim이 기대하는 기본 플레이어 속성. |
custom_attributes | CustomAttributes | 사용자 정의 플레이어 속성. |
도움이 필요하세요?
통합팀에 문의하십시오 integration@aghanim.com