Closes the other half of I31 ("Direct ASSN v2 and Play RTDN in Mint") —
Apple App Store Server Notifications v2 was already built; this adds the
matching direct (no-aggregator) integration for Google Play.
New ProviderId::PlayStore in mint-payments, mirroring the AppStore adapter's
shape but necessarily async: an RTDN notification carries neither a price
nor the Mint account to credit, so a mintable delivery is re-confirmed
against the Play Developer API (OAuth2 service-account JWT, RS256 via the
already-vendored `ring` crate — no new dependency) before it mints.
Key correctness decisions, documented in the module:
- deposit_ref is keyed on the Developer API's own order id, not the purchase
token (which Play keeps stable across a subscription's own renewals) — a
renewal mints again instead of idempotently replaying the original
purchase, covered by a dedicated regression test.
- USD price comes from a static PLAYSTORE_PRICES_JSON catalog: neither the
v3 ProductPurchase nor SubscriptionPurchaseV2 Developer API resource
carries a price field.
- voidedPurchaseNotification (Google's refund signal) reverses by its own
orderId with no second network call; REVOKED/CANCELED on the primary
notification types are deliberately Ignored in favor of that cleaner,
orderId-bearing signal.
- the Pub/Sub push auth token travels as a `?token=` query parameter (push
subscriptions can't attach a custom static header); mint-server's
deposits.rs bridges it into a synthetic header so mint-payments itself
stays axum/query-string-free.
18 new unit tests in playstore.rs (the OAuth2 path signs with a real
synthetic RSA test key, not a mocked signer) plus 4 in mint-server's
deposits.rs for the query->header bridge. Full existing suites re-run green
with zero regressions: mint-payments 112+13+6+6+3, mint-server
22+13+14+3+3+6+8. cargo clippy --all-targets: zero warnings in any touched
file.
Also closes the gap in scripts/parity/recount.mjs: new wave-s.mjs moves I31
MISSING -> DONE on real evidence; infra now 30/10/4 (was 29/10/5),
--self-test still exits 0, recount.test.mjs extended with a Wave S test.
Not deployed: PLAYSTORE_SERVICE_ACCOUNT_KEY / CLIENT_EMAIL / PACKAGE_NAME /
WEBHOOK_TOKEN / PRICES_JSON all need a real Google Play Console service
account and a Pub/Sub push subscription, which is an owner-only step.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>