Skip to Content
Sayren 유저가이드
결제

결제 재시도 (다른 결제 옵션)

같은 결제에서 다른 결제 옵션으로 새 결제 시도를 열고 새 결제창 호출 값(`launch`)을 돌려준다. 카드 거절·결제창 취소·결제창 오류 뒤에 다른 결제사나 결제수단으로 바꿀 때 쓴다. 결제 전 시도(결제창을 닫고 돌아오지 않은 경우)는 버리고 새 시도를 연다. `returnUrl`을 생략하면 결제 시작 때의 복귀 주소를 그대로 쓰고, 보내면 그 주소로 바꾼다(검증은 결제 시작과 같다). 승인 중이거나 결과 확인 중이면 409 `PAYMENT_IN_PROGRESS`다.

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

같은 결제에서 다른 결제 옵션으로 새 결제 시도를 열고 새 결제창 호출 값(launch)을 돌려준다. 카드 거절·결제창 취소·결제창 오류 뒤에 다른 결제사나 결제수단으로 바꿀 때 쓴다. 결제 전 시도(결제창을 닫고 돌아오지 않은 경우)는 버리고 새 시도를 연다. returnUrl을 생략하면 결제 시작 때의 복귀 주소를 그대로 쓰고, 보내면 그 주소로 바꾼다(검증은 결제 시작과 같다). 승인 중이거나 결과 확인 중이면 409 PAYMENT_IN_PROGRESS다.

Authorization

headerAuthorizationBearer <JWT>

회원 accessToken

Path Parameters

paymentId*string

Request Body

application/json
  1. body
option*||||
returnUrl?string

결제를 마치면 돌아올 스토어프론트 주소. 상점 결제 도메인에 등록된 도메인이어야 한다

Formaturi
Lengthlength <= 2048
cashReceipt?

현금영수증 신청. 계좌이체·가상계좌 옵션에서만 보낼 수 있다(그 밖의 옵션이면 400 CASH_RECEIPT_NOT_AVAILABLE). 결제가 승인되면 발급한다

Response Body

성공

application/json
  1. response
meta*
data*
error*|null
Example Request
curl -X POST 'https://api.sayren.io/storefront/v1/payments/string/attempts' \
  -H 'Content-Type: application/json' \
  -d '{
  "option": {
    "pg": "tosspayments",
    "method": "CARD"
  }
}'
Example Response
{
  "meta": {
    "status": 200,
    "code": "OK",
    "message": "OK",
    "isSuccess": true
  },
  "data": {
    "paymentId": "string",
    "status": "pending",
    "orderId": null,
    "orderNo": null,
    "attemptId": "string",
    "option": {
      "pg": "tosspayments",
      "method": "CARD"
    },
    "payUrl": "string",
    "launch": null,
    "expiresAt": "string",
    "testPayment": true,
    "amounts": {
      "productAmount": 0,
      "deliveryFee": 0,
      "totalAmount": 0,
      "couponDiscountAmount": 0,
      "deliveryDiscountAmount": 0,
      "pointAmount": 0
    },
    "delivery": {
      "baseFee": 0,
      "remoteSurcharge": 0,
      "remoteArea": "NONE",
      "remoteAreaLabel": "string",
      "bundleCount": 0,
      "freeByThreshold": true,
      "zipCode": "string"
    }
  },
  "error": null
}