Test Google Play purchases
Documents @snap4id-sdk/app-embed 1.0.0 · @snap4id-sdk/purchase-verifier 1.0.0
Play Billing needs a build installed from Google Play (a testing track) and a Google account the Play Console treats as a tester. Emulators with the Play Store work for flows; check kill-after-pay on a phone.
Set up
Section titled “Set up”- Product. Play Console → Monetize → In-app products: a consumable with your product id, activated.
- Track. Upload a release build (an
.aabsigned with your upload key) to internal testing and add your testers’ accounts to the track; testers install it from the opt-in link. Expo:expo prebuild, then./gradlew :app:bundleReleaseinandroid/; the SDK’sexamples/partner-app/README.md(“Google Play internal testing”) shows the full commands. - License testers. Settings → License testing: add the same accounts. Their purchases use test payment methods (“Test card, always approves”, “…declines”, “Slow test card” for a pending purchase) and are never charged.
- Licensing key. Monetization setup → Licensing: the base64 RSA public key; Snap4ID (when it checks purchases) or your backend needs it to check receipts.
Environment
Section titled “Environment”License-tester purchases are sandbox receipts. Production accepts them only while your sandbox window is open
(ask Snap4ID; with your backend it is your own allowed_environments / sandbox_in_prod_until). A purchase in the
wrong environment fails with environment_not_allowed.
What to check
Section titled “What to check”- The purchase is made with
obfuscatedProfileId= the page’spaymentRef(elsebinding_mismatch). - “Slow test card” gives a pending purchase: it must survive an app restart and unlock when it completes.
- Kill the app right after paying and reopen it: the photo arrives, and the purchase is consumed only then.
