ShaunSocial mobile app guide 1.5.6 / In-app purchases
Google Play (Android)
This page takes you from nothing to members buying eWallet credits in your Android app through Google Play: a first test build, the products, the key your site needs to check every purchase, license testers, the test phone, the AdminCP, testing and refunds, orders and revenue, and what to do when a purchase does not work. Read In-app purchases first: it explains how buying credits works and what to prepare for both stores. Each section says who does it: Admin for the site owner, who also owns the Google Play and App Store accounts, and Developer for the person who builds and tests the app.
Android: upload a build to internal testing#
Last updated: 2026-11-19 · v1.5.6
The app's behaviour on this page was read from the code of the ShaunSocial app 1.5.6. The steps in Google Play Console and Google Cloud were not run for this guide, and those consoles rename their menus from time to time: look for the same words if a menu is named a little differently. The official help pages are listed at the end (Official store help pages).
Google Play lets you create in-app products, and test them, only after a build that uses Google Play Billing is on a testing track. The ShaunSocial app includes Google Play Billing, so any release build of it qualifies (how to build one: Build the Android release file).
- In Play Console open your app → Test and release → Testing → Internal testing →
Create new release, upload the
.aabfile, click Next, then Save and publish. - On the same page open the Testers tab → Create email list, give it a name, add the Google accounts of your testers, then Save changes.
- Tick that list in the Testers table, fill in Feedback URL or email address and click Save changes.
- Under How testers join your test click Copy link. Testers open this link on their phone (see Prepare an Android test phone).
Not while it is a draft or pending publication. After the first publish it can take a few hours before testers can open it.
Android: create the products in Google Play#
Last updated: 2026-11-19 · v1.5.6
- In Play Console open your app → Monetize with Play → Products → One-time products → Create one-time product.
- Enter the Product ID you planned, for example
wallet_credit_100(lower-case letters, numbers,_and.), a name and a description, answer the tax questions and click Next. - Add a purchase option of type Buy (any ID, for example
buy) and keep it backwards compatible. - Set the price and the countries, then click Activate. Repeat for every package.
Google Play has no "consumable" switch. The app uses up each purchase once your site has added the credits, so the same package can be bought again and again.
Android: create the service-account key#
Last updated: 2026-11-19 · v1.5.6
Your site asks Google about each purchase with a service account: a technical Google account that belongs to your Google Cloud project, with a key file in JSON format.
- Open the Google Cloud console and select or create a project.
- Open APIs & Services → Library, find Google Play Android Developer API and click Enable.
- Open IAM & Admin → Service accounts → Create service account. Give it a name, add no Cloud roles and click Done. Copy its e-mail address.
- Open the service account → Keys → Add key → Create new key → JSON. A
.jsonfile downloads. Keep it private: anyone with it can read your app's orders.
If creating a key is not allowed#
The message "Service account key creation is disabled" means an organisation policy forbids keys. Two policies with
almost the same name can each block it, and both must be off for your project:
iam.disableServiceAccountKeyCreation and iam.managed.disableServiceAccountKeyCreation. The
second one is on by default in Google Cloud organisations created since May 2024. Projects that belong to no
organisation (a plain Google account) are not affected.
- You need the Organization Policy Administrator role on the organisation; being the project owner is not enough. An administrator of your Google organisation can give it to themselves in IAM & Admin → IAM, with the organisation selected.
- Select the project in the top bar, open IAM & Admin → Organization policies and filter for
disableServiceAccountKeyCreation. Both policies are listed. - For each one shown as Enforced: open it → Manage policy → Override parent's policy → Add a rule → enforcement off → Set policy.
- Wait a few minutes and create the key again.
Once the key is downloaded you may set both policies back to Inherit parent's policy; keys that already exist keep working.
Android: give the key access in Play Console#
Last updated: 2026-11-19 · v1.5.6
- In Play Console open Manage account → Users and permissions → Invite new users and paste the service account's e-mail address.
- On the App permissions tab click Add app, choose your app and tick View financial data, orders, and cancellation survey responses and Manage orders and subscriptions, then Apply.
- Click Invite user (for a user that already exists: Save changes).
Tick them for your app on the App permissions tab even when the same boxes are already ticked under Account permissions; the account-level boxes alone have been seen not to be enough. New permissions can take many hours, sometimes more than a day, before Google accepts the key.
Android: license testers#
Last updated: 2026-11-19 · v1.5.6
License testers pay with test cards and are never charged. This is a different list from the internal-testing testers: a tester must be on both. The internal-testing list lets them install the app, the license-testing list makes their purchases free.
- In Play Console open Manage account → Play apps settings → License testing (older consoles: Settings → License testing). It is one list for every app in your account.
- Under License testers tick an e-mail list (the one you made for internal testing works) or enter a Google Group address.
- Set License response to LICENSED and click Save changes.
The owner of the developer account is always a license tester. Changes to the list can take up to 15 minutes to reach the phone.
Android: prepare a test phone#
Last updated: 2026-11-19 · v1.5.6
Google charges the purchase to the account that installed the app from Google Play. A copy installed any other way
(an APK file, from Android Studio, with adb) loads no products, or buys with the wrong account. In that case
the app shows "Product unavailable" with "This package is not available in the store."
- Add the tester's Google account to the phone (Settings → Passwords & accounts or Accounts → Add account → Google). A spare phone with only the tester account is simplest.
- In the Play Store, tap the profile picture and switch to the tester account.
- Clear the Play Store's cache: Settings → Apps → Google Play Store → Storage & cache → Clear cache.
- Uninstall any copy of the app that was not installed from Google Play.
- Open the internal-testing link (see Upload a build to internal testing) in Chrome on the phone, signed in with the same tester account, tap Become a tester (or Accept invite), then install the app from Google Play.
- Open the app, sign in as a member, open the wallet and tap Add fund, then choose a package.
What you should see: Google's payment sheet shows a test notice and the payment method Test card, always approves (or Test instrument, always approves).
The account is not a license tester, or the Play Store uses another account. Completing the purchase would charge real money. Check the license-testing list and the Play Store account, clear the cache, wait up to 15 minutes and install again from the link.
The same sheet offers other test cards: always declines (a failed payment) and slow cards that approve or decline after a few minutes. With a slow card the app says "Your payment is pending. Your wallet will be topped up once the payment is approved." and adds the credits once Google confirms.
An Android emulator works too if it uses a system image with Google Play: sign in through the Play Store and follow the same steps.
Android: fill in the AdminCP#
Last updated: 2026-11-19 · v1.5.6
Three fields connect Google Play to your site. What each field means is explained in the ShaunSocial guide; here is what to put in them:
| Field | Where | What to enter |
|---|---|---|
| Android package name | General Configuration → General Settings (see Package name and bundle ID) | your app's package name, exactly as Play Console shows it |
| Google Play service account key (JSON) | General Configuration → In-App Purchase (see The In-App Purchase settings) | open the .json key file in a text editor and paste all of it |
| Google product id | each deposit package (see Deposit packages) | the Play product ID of that package, for example wallet_credit_100; the package must be active |
The package name is in the General Settings part, not in the In-App Purchase part, and is easy to miss. While it or the key is empty, every Android purchase is refused with "Google in-app purchase is not available right now."
Android: test a purchase and a refund#
Last updated: 2026-11-19 · v1.5.6
- On the test phone (see Prepare an Android test phone), buy the smallest package.
What you should see: "Your wallet has been topped up.", and the balance goes up once.
- Buy something that costs more than the balance, choose Top up … and pay.
What you should see: after the top-up, the item is bought without asking again.
- The Admin refunds the test order in Play Console (Manage account → Order management, open the
order, Refund).
What you should see: within the next hour the credits are taken back and the member is told. What happens on a refund, and the notices you and the member get, is in Refunds and other events.
Google Play needs no refund address: your site asks Google for refunded orders once an hour.
The hourly refund check is the
task php artisan shaun_wallet:iap_voided_sync, run by the cron job. To see what it would take back without
changing anything, run it with --dry-run. Run it by hand only if you do not want to wait for the next
hour.
Google cancels and refunds a license-tester purchase that has not been confirmed within 3 minutes (a real purchase: within 3 days). Your site confirms a purchase as soon as it has added the credits. So if the check fails during a test, for example because a field in the AdminCP is still empty or the Play permissions are not active yet, Google cancels the test order and the later retry cannot credit it. Fix the cause and buy again.
Test purchases add credits like real ones while the eWallet setting Accept sandbox and test store purchases is on (it is on after installing; see After the stores approve your app).
Android: orders and revenue in Google Play#
Last updated: 2026-11-19 · v1.5.6
Check whether a member paid#
- Order management is at account level, not inside the app: click the Play Console logo to leave the app, then Manage account → Order management.
- Search by the order ID (it starts with
GPA.and is also in the buyer's Google Play receipt e-mail) or by the buyer's full e-mail address. Widen the date range for older orders. - Open the order for the price, tax, payment method and refund history. The Refund button is on this page.
| Status | What it means for the eWallet |
|---|---|
| Processed | the buyer was charged. Check the member's balance as well: an order the site could not check is refunded by Google after three days |
| Pending | not charged yet; the credits arrive when the payment completes |
| Cancelled | nothing charged, nothing credited |
| Refunded, Partially refunded | the hourly refund check takes the credits back |
A license-tester order is listed with Test: before the product name and a total of 0. Real orders show the price in the buyer's currency. When a member says "I paid but got nothing", find the order here, check their balance, and fix the cause (see When an Android purchase does not work) within three days: the app tries again by itself.
Revenue and payouts#
- Monetize with Play (inside your app) shows totals for the last 28 days. The figures are estimates, in UTC, refreshed once a day, so today's orders may not show yet. Do not use it to confirm a single purchase.
- Download reports → Financial (account level) has the estimated sales and, from about the 5th of the next month, the earnings report with Google's fees and refunds.
- Payments profile (account level) holds your bank account; Google pays a month's earnings around the 15th of the following month. Google's service fee depends on the buyer's country and programme; see its service fee page rather than assuming a flat rate.
When an Android purchase does not work#
Last updated: 2026-11-19 · v1.5.6
When a payment went through but your site could not add the credits, the app says "Your payment was received but has not been added to your wallet yet. It will be retried automatically.", followed by your site's reason on a second line. The app keeps the purchase and sends it again the next time the member opens the app or signs in, or when they choose the same package again; nobody needs to pay twice. Your site never credits the same purchase twice.
| What you see | Likely cause |
|---|---|
| "Product unavailable" / "This package is not available in the store." | the product is not active in Play Console, its ID differs from the package's Google product id, or the app was not installed from a Google Play testing track |
| The internal-testing link says the app is not available | the release is not published yet or still spreading (a few hours), the account is not on the testers' list, or Chrome is signed in with another account |
| The payment sheet shows a real card and no test notice | the account is not a license tester, or the Play Store uses another account; do not complete the purchase |
| "This version of the application is not configured for billing through Google Play" | the app was installed outside Google Play, or its version, package name or signing key differs from the release on the track; uninstall and install from the testing link |
| A test purchase is cancelled about 3 minutes later | the site could not check it in time; see the warning in Test a purchase and a refund |
| Second line "Google in-app purchase is not available right now." | Android package name or the service-account key is empty in the AdminCP |
| Second line "The purchase could not be verified with Google Play. Please try again." | Google refused your site's question; the reason is in the system log (see the list below) |
| Second line "The package not found." | no active deposit package has this product ID. The root admin account gets a notification naming the product; activate or correct the package and the app's next try credits the purchase |
| "Test purchases are not accepted." | Accept sandbox and test store purchases is off (see After the stores approve your app) |
For "could not be verified", open AdminCP → System Setting → System Log (see
System log) and look for the line Google IAP purchase lookup
failed. Its error text says what Google answered:
permissionDeniedor "insufficient permissions": the key is fine, but the service account has no access to this app yet. Check that the app is added on the App permissions tab with both permissions (see Give the key access in Play Console), then wait: Google can take more than a day to accept new permissions.- "Google Play Android Developer API has not been used in project … or it is disabled": enable the API in the Google Cloud project the key belongs to.
- 404 or "Invalid Value": the Android package name or the product ID does not match the app.
invalid_grantor "Invalid JWT Signature": the key was deleted in Google Cloud, only part of the file was pasted, or the server's clock is wrong.- A cURL error 6 or 28: the server cannot reach Google (firewall or DNS).
Official store help pages#
Last updated: 2026-11-19 · v1.5.6
Google Play and Google Cloud:
- Overview of one-time products
- Getting ready (upload a billing build first)
- Google Play Developer API: getting started
- Create service account keys
- Test in-app billing with license testing
- Test your Google Play Billing integration
- Set up an internal test
- View and manage orders
- Order processing and payouts
- Service fees
Change log#
Last updated: 2026-11-19 · v1.5.6
| Date (GMT+7) | Section | What changed |
|---|---|---|
| 2026-11-19 | all | First version for the ShaunSocial app 1.5.6. The app's behaviour was read from the 1.5.6 code; the steps in the store consoles were not run for this guide. |
| 2026-11-19 | all | Split by platform: Android and iOS have their own pages. |