Test real Google Play purchases
To test real Google Play purchases without being charged, add your Google account as a license tester in Play Console, upload a build to the internal testing track, install it from the tester link, and buy with Test card, always approves. Google marks the order as a test purchase, so BillDog records it in Sandbox. Use your bd_public_test_ key and check the customer with the dashboard's Sandbox switch on.
Steps last checked against the SDK source on 15 Nov 2026.
What you'll build
- A license tester account that buys your subscription with no real charge
- A sandbox purchase in BillDog that unlocks the
premiumentitlement - Renewals every few minutes, so you can watch a full subscription lifecycle
What you'll need
- Google Play connected to BillDog, with products attached to an entitlement. See Connect Google Play to BillDog
- An app with the BillDog Android SDK (
billdog-composeandbilldog-paywall), as in the Android paywall codelab - A real Android device signed in to the Google account you will test with, with the Play Store app installed
1. Add license testers
3 minIn Play Console, go to the All apps page and open Settings → License testing in the left menu (it applies to your whole developer account, not one app) and add the Google account emails you will test with. Google's guide: Test in-app billing with application licensing.
License testers get test payment methods, so they are never charged, and their subscriptions renew in minutes instead of months.
Internal testers who are not also license testers pay real money. Add every test account to License testing, not only to the testing track.
2. Build with your test key
3 minConfigure the SDK with the bd_public_test_ key from Integration & Data → API Keys, and leave simulatedPurchases at its default (false) so purchases go to real Google Play Billing.
import android.app.Application
import io.billdog.core.BillDog
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
BillDog.configure(this, "bd_public_test_YOUR_KEY")
}
}Which environment a Play purchase is recorded in is decided by Google, not by your key. BillDog asks Google about every purchase token, and a license tester's purchase comes back marked as a test purchase, so it is recorded as sandbox. The key decides which side your customer lives on: with the test key, the customer and the purchase are both in Sandbox, where the dashboard shows them together.
3. Upload a build to internal testing
10 min- Build a signed release bundle (
./gradlew bundleRelease) with the same package name as your Play app and a higherversionCodethan any earlier upload. - In Play Console, open Testing → Internal testing, create a release, upload the
.aaband roll it out. - On the Testers tab, add your license tester accounts (an email list works) and copy the opt-in link.
Your subscription and its base plans must also be Active in Play Console. A product in draft is never returned to the app.
Google lets license testers sideload debug builds too, as long as the package name matches your Play app. Installing from the testing track is the most reliable route, because it rules out a signing or package mismatch. A new release can take a while to reach testers.
4. Install from the Play Store link
3 min- On the test device, open the opt-in link while signed in as a license tester and accept the invitation.
- Follow the link to the Play Store listing and install the app from there.
- If the device has several Google accounts, Play bills the account that downloaded the app. Make sure that is the license tester.
5. Buy with a test card
4 minOpen your paywall (or call BillDog.purchase(activity, "premium:monthly") with your own Play id). The purchase sheet shows a test notice, and the payment methods include test cards:
- Test card, always approves: a successful purchase.
- Test card, always declines: a failed payment, useful for grace period and account hold.
- Slow test card, approves after a few minutes: a pending purchase. The SDK returns
PurchaseResult.Pending, and BillDog unlocks only once Google reports it paid.
Then refresh customer info and confirm the entitlement is active:
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.lifecycle.lifecycleScope
import io.billdog.core.BillDog
import kotlinx.coroutines.launch
class MainActivity : ComponentActivity() {
fun checkAccess() {
lifecycleScope.launch {
BillDog.getCustomerInfo(forceRefresh = true)
.onSuccess { info ->
Log.d("BillDog", "User ${BillDog.getAppUserId()} premium=${info.hasEntitlement("premium")}")
}
.onFailure { Log.e("BillDog", "Could not read entitlements", it) }
}
}
}6. Check the purchase in the dashboard
3 min- Turn on the Sandbox switch in the dashboard header. With it off you see Production, and test purchases stay hidden.
- Open Audience → Customers and find the user ID the log printed. Open the customer to see the purchase and the active entitlement.
- Leave the subscription running. Test subscriptions renew about every 5 minutes for a monthly or weekly plan and every 30 minutes for a yearly plan, up to six renewals, then expire. Each renewal reaches BillDog through real-time developer notifications.
To test a failed renewal, change the payment method in the Play Store app under the subscription's settings to Test card, always declines before the next renewal. Google's full timing table, including free trial and grace period lengths, is in Test your Google Play Billing Library integration.
7. Fix common errors
5 min- Product not found or item unavailable: Play sells no product with that id to this app. Check that the Play Store Product ID in BillDog matches Play Console, that the product is active, that the package name matches, and that the device account is a license tester.
- Billing not available on this device: the device has no signed-in Play Store account, or it is an emulator image without Google Play.
- Purchase succeeded but nothing unlocked: the product isn't attached to an entitlement. Tick it under Product Mapping on the entitlement. A Play id BillDog has never seen is added as a new product with no entitlement.
- Purchase rejected with a test key: a
bd_public_test_key refuses a purchase Google did not mark as a test purchase. The account that paid is not a license tester. - Nothing in the dashboard: the header switch is on Production. Test purchases are in Sandbox.
Want to test paywall logic before any of this is ready? The Test Store codelab creates sandbox purchases with no Play account at all.