# \[IAP\] processProductGrant 가 true 를 반환했는데 onEvent "success" 가 오지 않고 주문이 미결로 남습니다 (SDK 3.8.1)

**URL:** <https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126>\
**Category:** 개발\
**Created:** [11월 3, 2026, 4:02오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126 "2026-11-03T04:02:08Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 3, 2026, 4:02오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/1 "2026-11-03T04:02:08Z")

</div>

### 이 글의 성격은 무엇인가요?

질문 / 문제 해결

### 내용을 설명해주세요

안녕하세요.  
출시 검토 전 QR(private 스킴) 환경에서 일회성 인앱결제를 실결제로 테스트하던 중,  
결제와 지급은 끝났는데 success 이벤트가 오지 않아 문의드립니다.

[개발 환경]

- 미니앱: pickabeau-image-consulting (웹뷰, React)
- @apps-in-toss/web-framework 3.8.1
- 테스트: 콘솔 QR / intoss-private:// + \_deploymentId
- deploymentId: 01a19f2e-0fe9-7059-93ce-0e335390ec15
- 기기: iOS, iPhone 15 Pro, toss ver 5.283.0
- 상품: 소모품, SKU ait.0000087457.45321107.c95fa9e2ce.2985374956, 판매가 4,895원
- 서버 지급: processProductGrant 콜백 안에서 User.createAnonymousKeyAuthCode() → 저희 서버가  
앱인토스 API 로 식별키 확인 후 주문 생성 → true 반환 (mTLS 정상)

[구현한 흐름 — 문서 「인앱 결제 \> 정상 결제 흐름」 그대로입니다]  
IAP.createOneTimePurchaseOrder({ options: { sku, processProductGrant }, onEvent, onError })  
processProductGrant({ orderId }) 에서 서버 지급 후 true 반환 (1초 이내)  
onEvent 가 type: “success” 로 오면 cleanup 호출 후 설문 화면으로 이동

[실제로 일어난 일]

- 2026-11-03 12:19 KST, orderId 05c47348-b4d1-466e-9d28-b18eb19fba88  
결제 승인 → processProductGrant 호출됨 → 저희 서버에 주문 생성 완료 → true 반환
- 그 뒤 onEvent(“success”) 도 onError 도 오지 않아 화면이 계속 대기했습니다.
- 미니앱을 닫고 다시 열자 IAP.getPendingOrders 에 같은 orderId 가 남아 있었고, 재지급 후  
IAP.completeProductGrant 를 호출하니 정상 종료되어 설문 화면으로 갔습니다.
- 즉 저희가 넘긴 isProductGranted: true 가 토스 쪽에서 지급 완료로 처리되지 않은 것으로 보입니다.

[질문]

1. processProductGrant 가 true 를 반환한 뒤 success 이벤트가 오지 않고 주문이 pending 으로  
남는 조건이 있나요? (QR/private 테스트 환경에서만 그런지, 특정 앱 버전 이슈인지)
2. 이 경우 파트너가 processProductGrant 반환 직후 IAP.completeProductGrant 를 추가로 호출해도  
되나요? 정상적으로 success 가 온 주문에 중복 호출하면 오류가 나는지도 알고 싶습니다.
3. 권장하시는 방어 방식이 있나요? 저희는 true 반환 후 3초 안에 success 가 없으면 다음 화면으로  
진행하고 completeProductGrant 로 주문을 닫도록 해 두었습니다. 문제가 있다면 알려 주세요.
4. 해당 orderId 로 토스 쪽 로그 확인이 가능하다면 어디서 끊겼는지 확인 부탁드립니다.

감사합니다!

### appName (선택)

pickabeau-image-consulting

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 3, 2026, 6:13오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/2 "2026-11-03T06:13:23Z")

</div>

안녕하세요 🙂  
QR 환경은 실제 라이브 환경과 동일하기 때문에 정상적으로 성공 이벤트가 전달되는게 맞습니다.  
`IAP.completeProductGrant`는 미결 주문 조회 후, 실제 지급을 해주신 뒤 호출해주시는게 맞습니다.  
상황에 따라 3초보다 지연될 수 있어, 타임아웃 없이 테스트 해봐주실 수 있을까요 ?

사용하신 코드를 공유주시면 확인해보겠습니다.

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 3, 2026, 6:47오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/3 "2026-11-03T06:47:25Z")

</div>

답변 감사합니다. 말씀하신 두 가지를 반영했고, 첫 결제 건은 지연이 아니라 누락으로 보여 상황을 다시 정리해 드립니다.

[1. 같은 기기에서 3건 중 2건은 success 가 오지 않았고, 1건은 확실하지 않습니다]  
같은 기기(iPhone 15 Pro, iOS, 토스 5.283.0)·같은 SKU 로 3건을 결제했습니다.

① 12:19 KST, orderId 05c47348-b4d1-466e-9d28-b18eb19fba88

- 당시 번들(deploymentId 01a19f2e-0fe9-7059-93ce-0e335390ec15)에는 타임아웃이 없었습니다. onEvent(“success”) 만 기다리는 코드였습니다.
- processProductGrant 호출 → 저희 서버 주문 생성(12:19:47) → 1초 안에 true 반환.
- 수 분을 기다렸지만 onEvent 도 onError 도 호출되지 않았습니다.
- 미니앱을 닫고 다시 열자 IAP.getPendingOrders 에 같은 orderId 가 남아 있었고, 재지급 후 IAP.completeProductGrant 로 정상 종료됐습니다.
- 이 결제는 App Store 구입 내역에 한동안 「대기 중」으로 표시됐습니다.

② 13:53 KST, orderId 27173733-a13c-472c-9253-7a98f62cd3cd

- 지급 뒤 몇 초 안에 다음 화면으로 넘어갔습니다. 다만 이 번들에는 3초 타임아웃이 있어 success 로 넘어간 것인지 타임아웃으로 넘어간 것인지 확정하지 못했습니다.

③ 15:40 KST, orderId 64e19a45-98c9-44da-8277-46deed106278

- processProductGrant 호출 → 서버 주문 생성(15:40:48) → true 반환까지는 같고, 그 뒤 결제 화면이 로딩 상태로 머물렀습니다.

→ ①·③ 은 저희가 넘긴 isProductGranted: true 가 토스 쪽에서 지급 완료로 처리되지 않은 것으로 보입니다. 두 orderId 로 어느 단계에서 끊겼는지 확인 부탁드립니다.

[2. 코드 수정 — 안내해 주신 대로 반영했습니다]

- 구매 흐름에서는 completeProductGrant 를 호출하지 않습니다. 미결 주문은 앱 시작 시 getPendingOrders → 지급 → completeProductGrant 순서의 복구 흐름만 처리합니다.
- 타임아웃은 10초로 두되, 그 안에 success 가 오면 정상 흐름 그대로 처리합니다. 10초가 지나면 (서버 지급은 이미 끝난 상태라) 다음 화면으로 넘어가고, 토스 쪽 주문은 다음 실행의 복구 흐름이 닫습니다. 토스 쪽에서 success 누락이 재현되지 않는다고 확인되면 이 타임아웃은 걷어 낼 예정입니다.

[3. 사용 코드]

```typescript
// 결제창 어댑터 — @apps-in-toss/web-framework 3.8.1
export const SUCCESS_EVENT_GRACE_MS = 10_000;

export async function openIapPurchase(sku, grant) {
  const { IAP } = await import("@apps-in-toss/web-framework");
  if (!IAP.createOneTimePurchaseOrder.isSupported()) return { kind: "unsupported" };
  return new Promise((resolve) => {
    let cleanup = null;
    let graceTimer = null;
    const finish = (result) => {
      if (graceTimer) clearTimeout(graceTimer);
      cleanup?.();
      resolve(result);
    };
    cleanup = IAP.createOneTimePurchaseOrder({
      options: {
        sku,
        processProductGrant: async ({ orderId }) => {
          // 서버 지급: User.createAnonymousKeyAuthCode() → 서버가 식별키 확인 후 주문 생성
          const granted = await grant(orderId).catch(() => false);
          if (granted) {
            // 첫 결제 당시 번들에는 이 타이머가 없었습니다(success 만 기다림).
            graceTimer = setTimeout(
              () => finish({ kind: "completed", successEvent: false }),
              SUCCESS_EVENT_GRACE_MS,
            );
          }
          return granted;
        },
      },
      onEvent: () => finish({ kind: "completed", successEvent: true }),
      onError: (error) => {
        const code = error?.code ?? String(error);
        if (code === "USER_CANCELED") return finish({ kind: "canceled" });
        if (code === "PRODUCT_NOT_GRANTED_BY_PARTNER") return finish({ kind: "not-granted", errorCode: code });
        finish({ kind: "failed", errorCode: code, message: error?.message });
      },
    });
  });
}

// 미결 주문 복구 — 앱 시작 시 1회
export async function recoverAppsInTossOrders() {
  const { orders } = await IAP.getPendingOrders();
  for (const { orderId } of orders) {
    const result = await grantOrder(orderId); // 서버 재지급(같은 결제면 같은 주문을 돌려줌)
    if (!result.ok) continue;
    await IAP.completeProductGrant({ params: { orderId } });
  }
}

```

[4. 여쭙고 싶은 것]

1. 위 두 orderId(05c47348…, 64e19a45…)의 토스 쪽 처리 로그 확인 — processProductGrant(isProductGranted: true) 수신 여부와 success 미발송 사유.
2. success 가 정상 전달된 주문에 복구 흐름이 completeProductGrant 를 중복 호출하는 일은 없지만, 혹시 중복 호출 시 오류가 나는지(멱등한지) 확인 부탁드립니다.
3. 이번처럼 success 가 전달되지 않는 경우에 대해 파트너 쪽에서 권장하는 처리 방식이 따로 있으면 알려 주세요.

감사합니다.

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 3, 2026, 7:27오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/4 "2026-11-03T07:27:14Z")

</div>

결제 성공 후 30초내에 `processProductGrant` 콜백이 호출되지 않거나 해당 콜백의 결과가 true가 아닌 경우, `{appName}에 문제가 생겼어요. 환불을 신청해주세요` 페이지가 노출되면서 미결 주문으로 남을 수 있습니다.

혹시 return 하는 `granted` 가 true가 맞나요 ?

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 3, 2026, 7:37오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/5 "2026-11-03T07:37:50Z")

</div>

확인했습니다. processProductGrant 는 true 를 반환하고 있고, 30초를 넘기지 않습니다.

- 콜백 안에서 저희 서버(지급 API)를 호출하는데, 서버 게이트웨이 로그 기준 오늘 4건 모두 HTTP 200, 처리 시간 151~265ms 였습니다(12:19:47 / 12:25:55 / 13:53:59 / 15:40:48 KST). 사전 요청을 합쳐도 2초 안입니다.
- 클라이언트는 그 응답에 주문번호·서명이 있으면 true 를 반환합니다. false 가 되는 경우는 서버 거절·네트워크 오류뿐인데, 해당 건들은 모두 200 이었습니다.

로그는 다음과 같습니다.

[저희 지급 API 게이트웨이 로그 — 2026-11-03, 시각은 UTC / (KST)]

2026-11-03T03:19:47.279Z (12:19:47)  
OPTIONS | 200 | upstream 1246ms | TossApp/5.283.0 iOS 18.7 AppsInToss | fn v5  
2026-11-03T03:19:47.680Z (12:19:47) POST | 200 | upstream 265ms | content-length 466 | fn v5  
→ 결제 ① orderId 05c47348-b4d1-466e-9d28-b18eb19fba88 지급 (주문번호·submitToken·reportToken 응답)

2026-11-03T03:25:55.265Z (12:25:55)  
OPTIONS | 200 | upstream 111ms | TossApp/5.283.0 iOS 18.7 AppsInToss | fn v5  
2026-11-03T03:25:55.457Z (12:25:55) POST | 200 | upstream 151ms | content-length 468 | fn v5  
→ 결제 ① 미니앱 재실행 후 getPendingOrders 복구 경로의 재지급(같은 주문 반환) → 이어서 completeProductGrant 호출로 정상 종료

2026-11-03T04:53:59.174Z (13:53:59)  
OPTIONS | 200 | upstream 118ms | TossApp/5.283.0 iOS 18.7 AppsInToss | fn v5  
2026-11-03T04:53:59.535Z (13:53:59) POST | 200 | upstream 217ms | content-length 467 | fn v5  
→ 결제 ② orderId 27173733-a13c-472c-9253-7a98f62cd3cd 지급

2026-11-03T06:40:48.640Z (15:40:48)  
OPTIONS | 200 | upstream 1399ms | TossApp/5.283.0 iOS 18.7 AppsInToss | fn v7  
2026-11-03T06:40:48.989Z (15:40:48) POST | 200 | upstream 246ms | content-length 469 | fn v7  
→ 결제 ③ orderId 64e19a45-98c9-44da-8277-46deed106278 지급

요약:

processProductGrant 콜백 안에서 호출하는 지급 API 는 4건 모두 HTTP 200, 처리 151~265ms  
(사전 요청 포함 최대 약 1.7초).

클라이언트는 이 200 응답(주문번호·서명 포함)을 받으면 true 를 반환합니다.

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 3, 2026, 9:45오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/6 "2026-11-03T09:45:31Z")

</div>

확인해보니 true가 반환되지 않은 것 같은데,  
`return granted` 전에 granted를 로그로 찍어봐주실 수 있을까요 ?

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 3, 2026, 10:17오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/7 "2026-11-03T10:17:27Z")

</div>

![1-event-list-ic_grant_callback](https://canada1.discourse-cdn.com/flex007/uploads/toss/original/2X/6/621d48ff17bc0bd57f14bb87d6347deaf7d2e879.jpeg)

 ![4-param-elapsed_ms-422](https://canada1.discourse-cdn.com/flex007/uploads/toss/original/2X/f/f47a95bd9e933c92bccf11cffa9b1283d3482575.jpeg)

 ![3-param-granted-true](https://canada1.discourse-cdn.com/flex007/uploads/toss/original/2X/4/4e58eb647d858df67b753278644ecc2ec3031bea.jpeg)

안녕하세요, 확인 감사합니다.

요청하신 대로 processProductGrant 콜백의 return granted 직전에 반환값을 기록하는 로그를 넣고,  
새 번들로 다시 결제해 봤습니다.

**테스트 환경**

- 일시: 2026-11-03 18:53 KST
- 기기: iPhone, 토스앱 5.283.0
- SDK: @apps-in-toss/web-framework 3.8.1
- deploymentId: 01a1a0d2-b97e-7870-aef1-0790d73b7372

**콜백 반환값 로그 결과** (콘솔 「분석 \> 이벤트」의 ic\_grant\_callback, 캡처 3장 첨부)

- stage=start → 콜백 진입
- stage=return, granted=true, elapsed\_ms=422 → 422ms 뒤 true 를 반환

콜백 코드는 아래와 같고, 반환값은 boolean 을 resolve 하는 Promise 입니다.

서버 지급이 성공했을 때만 true 가 되고, 예외는 모두 false 로 잡아 Promise 가 거부되는 경우는 없습니다.

```typescript
processProductGrant: async ({ orderId }) => {
  const startedAt = Date.now();
  logTossEvent("ic_grant_callback", { stage: "start" });
  const granted = await grant(orderId).catch(() => false); // 서버 지급 성공 여부(boolean)
  const elapsedMs = Date.now() - startedAt;
  logTossEvent("ic_grant_callback", { stage: "return", granted, elapsed_ms: elapsedMs });
  return granted;
},

```

**서버 측 기록**

- 18:53:48 지급 API(apps-in-toss-grant) 200 응답, 처리 187ms
- 토스 orderId: 91cf0302-048e-40c5-97bc-98071b2ddb5e

**결과**

이번 결제는 콜백 반환 직후 onEvent 로 success 이벤트가 정상 전달되어 설문 화면으로 진입했습니다.

**확인 부탁드리는 건**

콜백 코드는 아래 두 건과 동일한 경로이고, 그때도 저희 서버는 모두 0.2초 안에 200 으로 응답했습니다.

그런데 두 건 모두 콜백 이후 onEvent·onError 어느 쪽도 오지 않은 채 화면이 멈춰 있다가,  
수십 초 뒤 「문제가 생겼어요, 환불을 신청해주세요」 화면이 떴습니다.

앱을 다시 열었을 때는 getPendingOrders 에 해당 주문이 남아 있었고, 이후 미결 복구 흐름으로 지급 처리했습니다.

| 결제 시각(KST) | 토스 orderId | 서버 응답 | 증상 |
| --- | --- | --- | --- |
| 11/3 12:19:47 | 05c47348-b4d1-466e-9d28-b18eb19fba88 | 200, 0.2초 | success 미수신 → 수십 초 뒤 환불 안내 화면 → 미결 잔류 |
| 11/3 15:40:48 | 64e19a45-98c9-44da-8277-46deed106278 | 200, 0.2초 | success 미수신 → 수십 초 뒤 환불 안내 화면 → 미결 잔류 |

참고로 13:53:59 건(orderId 27173733-a13c-472c-9253-7a98f62cd3cd)은 정상 진입했습니다.

환불 안내 화면이 떴다는 것은 토스 앱이 「30초 안에 콜백이 true 로 끝나지 않았다」고  
판단했다는 뜻으로 이해하고 있습니다.

반면 저희 JS 콜백은 같은 코드로 1초 안에 true 를 반환하고 있으므로(이번 로그 422ms),  
반환값이 SDK 를 거쳐 토스 앱 네이티브까지 전달되는 구간에서 유실되는 경우가 있는지  
위 두 orderId 기준으로 토스 쪽 로그 확인 부탁드립니다. 추가로 필요한 정보가 있으면 바로 드리겠습니다.

감사합니다.

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 3, 2026, 11:55오후 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/8 "2026-11-03T23:55:53Z")

</div>

이번에도 true가 들어오지 않은 것 같은데,  
`return granted` 대신 `return true` 로 반환해봐주실 수 있을까요?

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 4, 2026, 4:11오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/9 "2026-11-04T04:11:48Z")

</div>

안녕하세요.

요청하신 대로 return true 리터럴로 바꾼 번들

(deploymentId 01a1a4ad-a538-7fa4-91c4-542d9613a3a8)로 다시 테스트했습니다.

이번에는 SDK 가 네이티브로 보내는 메시지 자체를 기록하도록

window.ReactNativeWebView.postMessage 를 감싸 이벤트로 남겼습니다.

**테스트 결제** : 2026-11-04 12:57 KST, orderId 806d7eb9-18a9-45f8-9a45-7653e56188fd (iOS)

**토스 콘솔 「분석 \> 이벤트」에 남은 값**

| 이벤트 | 파라미터 | 값 |
| --- | --- | --- |
| ic\_bridge\_env (앱 진입 시) | has\_process\_grant | true ( **bridgeMethods** 에 processProductGrant 있음) |
| ic\_bridge\_env | one\_time\_purchase | true (isRequestOneTimePurchaseSupported) |
| ic\_grant\_callback | granted | true (콜백 반환값) |
| ic\_bridge\_out | is\_product\_granted | true |
| ic\_bridge\_out | order\_id | 806d7eb9-18a9-45f8-9a45-7653e56188fd |
| ic\_purchase\_result | code | 없음 (success 이벤트 수신, 설문 화면 진입) |

```ts
1. 저희 processProductGrant 콜백 (IAP.createOneTimePurchaseOrder 의 options 에 넘기는 함수)

processProductGrant: async ({ orderId }) => {
        const startedAt = Date.now();
        logTossEvent("ic_grant_callback", { stage: "start" });
        const granted = await grant(orderId).catch(() => false); // 저희 서버 지급 API 호출
        const elapsedMs = Date.now() - startedAt;
        console.info("[mini-app] processProductGrant", { orderId, granted, elapsedMs });
        logTossEvent("ic_grant_callback", { stage: "return", granted, elapsed_ms: elapsedMs });
        if (!granted) return false;
        return true;
},

2. postMessage 추적 (미니앱 진입 시 한 번 실행)

const methods = window. __bridgeMethods__?? [];
logTossEvent("ic_bridge_env", {
        has_process_grant: methods.includes("processProductGrant"),
        method_count: methods.length,
        one_time_purchase: String(window.__appsInTossConstants?.isRequestOneTimePurchaseSupported),
});

const rn = window.ReactNativeWebView;
const original = rn.postMessage.bind(rn);
rn.postMessage = (message: string) => {
        try {
                const body = JSON.parse(message)?.body;
                if (body?.method === "processProductGrant") {
                        const arg = body.args?.[0] ?? {};
                        logTossEvent("ic_bridge_out", {
                                order_id: String(arg.orderId),
                                is_product_granted: String(arg.isProductGranted),
                                event_id: String(body.eventId),
                        });
                }
        } catch {}
        original(message);
};

3. 참고한 SDK 3.8.1 코드 
(@apps-in-toss/web-framework/dist/index.js, createOneTimePurchaseOrder)

return callEventMethod("requestOneTimePurchase", {
        params: { sku },
        onEvent: async (event) => {
                if (event.type === "purchased") {
                        const isProductGranted = await options.processProductGrant({ orderId: event.data.orderId });
                        await callAsyncMethod("processProductGrant", {
                                orderId: event.data.orderId,
                                isProductGranted
                        }).catch(onError);
                } else onEvent(event);
        },
        onError: (error) => onError(error)
});

```

ic\_bridge\_out 은 위 3번의 callAsyncMethod(“processProductGrant”, …) 가

postMessage 로 보내는 메시지에서 뽑은 값입니다.

즉 저희 콜백은 true 를 반환했고, SDK 는 그 값을 isProductGranted: true 로 담아 토스 앱에 postMessage 했습니다.

이번 건은 토스 앱도 success 를 정상적으로 보내 주었습니다.

따라서 「true 가 들어오지 않았다」는 판단이 어느 지점의 로그인지 알려 주시면 감사하겠습니다.

저희 쪽에서는 postMessage 까지 true 가 나간 것이 확인되므로,

그 이후 네이티브가 processProductGrant 브리지 호출을 수신·처리하는 구간을 확인 부탁드립니다.

참고로 앞서 멈춤이 났던 05c47348-b4d1-466e-9d28-b18eb19fba88, 64e19a45-98c9-44da-8277-46deed106278 건도 같은 코드 경로였고,

그때는 수십 초 뒤 환불 안내 화면과 함께 PRODUCT\_NOT\_GRANTED\_BY\_PARTNER 가 onError 로 전달됐습니다.

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 4, 2026, 5:28오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/10 "2026-11-04T05:28:31Z")

</div>

이번에는 정상적으로 `Nov 4, 2026 @ 12:57:16.189` 에 true 가 정상적으로 들어와 미결주문으로 남지 않았는데요.  
`91cf0302-048e-40c5-97bc-98071b2ddb5e`주문은 true 가 들어온 로그가 없습니다.

네이티브가 processProductGrant 브리지 호출을 수신·처리하는 구간의 이슈는 아닐 것 같은데,  
`grant()` 반환 타입을 알 수 있을까요 ?

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 4, 2026, 5:38오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/11 "2026-11-04T05:38:20Z")

</div>

안녕하세요. 문의 주신 부분을 정리해 드립니다.

## grant() 반환 타입

SDK 어댑터의 시그니처입니다. `grant` 는 `Promise<boolean>` 을 돌려주는 함수입니다.

```ts
export async function openIapPurchase(
        sku: string,
        grant: (orderId: string) => Promise<boolean>,
): Promise<IapPurchaseResult>

```

실제로 넘기는 함수입니다. 서버 지급 API 응답의 `ok` 를 `Boolean()` 으로 감싸 돌려주므로,

resolve 값은 항상 primitive boolean(`true` 또는 `false`)입니다.

```ts
const result = await deps.openIapPurchase(sku, async (orderId) => {
        const grant = await grantOrder(deps, orderId).catch(() => null);
        if (grant?.ok) granted = grant.grant;
        else grantError = grant?.errorCode ?? "ANON_KEY_UNAVAILABLE";
        return Boolean(grant?.ok);
});

```

`processProductGrant` 콜백은 이 값을 await 한 뒤 반환합니다.

어제(11/3 18:53, 91cf0302) 번들은 `return granted`,

오늘(11/4 12:57, 806d7eb9) 번들은 요청하신 대로 `return true` 입니다.

```ts
// 11/3 번들 (orderId 91cf0302)
processProductGrant: async ({ orderId }) => {
        const startedAt = Date.now();
        logTossEvent("ic_grant_callback", { stage: "start" });
        const granted = await grant(orderId).catch(() => false);
        logTossEvent("ic_grant_callback", {
                stage: "return",
                granted,
                elapsed_ms: Date.now() - startedAt,
        });
        return granted;
},

```

```ts
// 11/4 번들 (orderId 806d7eb9)
processProductGrant: async ({ orderId }) => {
        const startedAt = Date.now();
        logTossEvent("ic_grant_callback", { stage: "start" });
        const granted = await grant(orderId).catch(() => false);
        logTossEvent("ic_grant_callback", {
                stage: "return",
                granted,
                elapsed_ms: Date.now() - startedAt,
        });
        if (!granted) return false;
        return true;
},

```

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 4, 2026, 1:56오후 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/12 "2026-11-04T13:56:59Z")

</div>

혹시 로그를 조금 더 상세히 찍어볼 수 있을까요 ?  
선언된 타입과 실제 런타임 값이 다를 수 있을까요 ?

```auto
logTossEvent("ic_grant_callback", {
  stage: "return",
  orderId,
  granted,
  granted_type: typeof granted,
  is_true: granted === true,
  elapsed_ms: Date.now() - startedAt,
});

```

---

<div class="post-metadata">

**Author:** ![Dorae](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@Dorae](https://techchat-apps-in-toss.toss.im/u/Dorae)\
**Post date:** [11월 4, 2026, 11:48오후 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/13 "2026-11-04T23:48:40Z")

</div>

안녕하세요.

11/5 08:35 결제(orderId 4178a21a-4d28-4b96-bbcc-3117f29412ec)에서  
다시 수십 초 뒤 환불 안내 화면이 떴습니다.

요청하신 로그를 그대로 넣은 번들(01a1a8e6-2231-779b-82cd-b288f39838b0)이었고,  
콘솔 이벤트에 다음이 남았습니다.

- ic\_grant\_callback: granted\_type = boolean, is\_true = true (콜백 반환값)
- ic\_bridge\_out: is\_product\_granted = true, is\_product\_granted\_type = boolean  
(SDK 가 postMessage 로 보낸 processProductGrant 메시지의 값)

즉 선언 타입과 런타임 값이 모두 boolean true 이고,  
SDK 는 그 값을 담은 processProductGrant 브리지 메시지를  
window.ReactNativeWebView.postMessage 로 실제 전송했습니다.

이 ic\_bridge\_out 로그 자체가 같은 postMessage 채널로 보내는 eventLog 호출이며  
processProductGrant 메시지 직전에 나갑니다.

앞 메시지는 토스 분석 서버에 도달했으므로 그 시점 채널은 정상이었습니다.

따라서 호스트가 processProductGrant 메시지를 수신한 뒤의 처리(네이티브 핸들러 또는 네이티브→토스 서버 전달)에서  
이 orderId 의 결과가 유실된 것으로 보입니다.

해당 orderId 로 호스트 측 수신·처리 로그 확인을 부탁드립니다.

감사합니다.

---

<div class="post-metadata">

**Author:** ![Dylan](https://yyz1.discourse-cdn.com/flex007/user_avatar/techchat-apps-in-toss.toss.im/dylan/32/597_2.png) [@Dylan](https://techchat-apps-in-toss.toss.im/u/Dylan)\
**Post date:** [11월 23, 2026, 9:39오전 UTC](https://techchat-apps-in-toss.toss.im/t/iap-processproductgrant-true-onevent-success-sdk-3-8-1/5126/14 "2026-11-23T09:39:00Z")

</div>

iOS 환경 + 특정 조건에서 true를 반환해도 해당 이슈가 발생되는 것을 추가로 확인하여 조치중입니다.  
완료되면 공유드리겠습니다! 감사합니다.
