Skip to Content
Sayren 유저가이드
결제

결제창 실패 보고

결제창을 열지 못했거나(`PREPARE_FAILURE`) 결제가 거절됐거나(`DECLINED`) 구매자가 결제창을 닫았을 때(`USER_CANCELED`) 보낸다. 복귀 주소의 `sayrenAttemptId`·`sayrenToken`(결제창을 열기 전이면 `launch.attemptId`·`launch.callbackToken`)이 필요하다. 서버는 PG 기록으로 보고를 확인한 뒤 시도를 닫고, 응답의 `category`가 확인한 분류다(보고와 다를 수 있다). PG에서 이미 결제가 끝났으면 409 `ATTEMPT_CAPTURED`이고 `details.pgTransactionId`로 결제 승인을 부른다. 닫은 뒤에는 같은 결제를 다른 결제 옵션으로 재시도(`POST /payments/{paymentId}/attempts`)할 수 있다.

POST
/storefront/v1/payments/{paymentId}/failure

결제창을 열지 못했거나(PREPARE_FAILURE) 결제가 거절됐거나(DECLINED) 구매자가 결제창을 닫았을 때(USER_CANCELED) 보낸다. 복귀 주소의 sayrenAttemptId·sayrenToken(결제창을 열기 전이면 launch.attemptId·launch.callbackToken)이 필요하다. 서버는 PG 기록으로 보고를 확인한 뒤 시도를 닫고, 응답의 category가 확인한 분류다(보고와 다를 수 있다). PG에서 이미 결제가 끝났으면 409 ATTEMPT_CAPTURED이고 details.pgTransactionId로 결제 승인을 부른다. 닫은 뒤에는 같은 결제를 다른 결제 옵션으로 재시도(POST /payments/{paymentId}/attempts)할 수 있다.

Authorization

headerAuthorizationBearer <JWT>

회원 accessToken

Path Parameters

paymentId*string

Request Body

application/json
  1. body
attemptId*string

실패한 결제 시도 id

Length1 <= length
callbackToken*string

복귀 주소의 sayrenToken(또는 launch.callbackToken)

Length1 <= length
category*string

PREPARE_FAILURE 결제창을 띄우지 못함 · DECLINED 결제 실패 · USER_CANCELED 구매자가 결제창을 닫음

Value in"PREPARE_FAILURE""DECLINED""USER_CANCELED"
code?string

PG가 준 오류 코드

Lengthlength <= 100
message?string

PG가 준 오류 메시지

Lengthlength <= 500

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
Example Request
curl -X POST 'https://api.sayren.io/storefront/v1/payments/string/failure' \
  -H 'Content-Type: application/json' \
  -d '{
  "attemptId": "string",
  "callbackToken": "string",
  "category": "PREPARE_FAILURE"
}'
Example Response
{
  "meta": {
    "status": 200,
    "code": "OK",
    "message": "OK",
    "isSuccess": true
  },
  "data": {
    "paymentId": "string",
    "attemptId": "string",
    "category": "string"
  },
  "error": null
}