---
name: snap4id-debug-stuck-purchase
description: Diagnose a Snap4ID embed purchase that does not unlock or a photo that never arrives - error codes, binding, environment, trust mode, recovery. Use when a user paid but has no photo, or onError reports unlock problems.
---

# Debug a stuck Snap4ID purchase

Collect: the order code (if any), job id, `paymentRef`, platform, store environment (production / sandbox / Xcode),
the `onError` codes, and the redacted `onBridgeMessage` log. Never ask for receipts, keys or full signed links.

Walk the chain and stop at the first broken link:

1. **Page reached?** No `hello` from the page ⇒ the bridge is missing (Expo Go, Android without a rebuild) or the
   origin was rejected (`origin_rejected`). `embed_unavailable` ⇒ wrong partner id or embedding not enabled.
2. **Trust mode.** `trust_mode_mismatch` ⇒ `onVerifyPurchase` presence does not match the partner configuration.
3. **Purchase bound?** `binding_mismatch` / `unlock_rejected` ⇒ the store purchase lacked
   `appAccountToken` / `obfuscatedProfileId` = `paymentRef`.
4. **Product and environment.** `unknown_product` ⇒ product id missing from the configuration.
   `environment_not_allowed` ⇒ sandbox against production without a sandbox-in-production expiry, or an Xcode / fake
   receipt in production.
5. **Receipt.** `invalid_receipt` ⇒ wrong bundle id / package name or Play public key, or a revoked purchase.
6. **Backend trust.** `backend: timeout` ⇒ `onVerifyPurchase` exceeded 15 s; Partner API `401 unauthorized` ⇒ key id,
   key or clock skew > 5 min.
7. **Finished too early?** Purchase consumed but job unpaid ⇒ something finished it before the unlock (RevenueCat
   auto-finish, custom code outside `onConfirmPurchase`).
8. **Paid but not delivered.** Check `client.start()` runs at launch and `<Snap4IdResume>` is mounted; `onCompleted`
   must resolve (it is retried until it does). `artifacts_unavailable` resolves by itself.
9. **Duplicate.** `duplicate_purchase` / `already_paid` ⇒ the job was paid by another transaction: refund this one.

Fix the cause, then let recovery finish: restart the app (`client.start()`), or for backend trust re-run the unlock
(idempotent). Escalate to Snap4ID support with the order code, job id, `paymentRef` and Partner API `requestId`.
