Skip to content

feat: paywall experiments, refunds, attribution + Play every-region pricing - #214

Draft
therajanmaurya wants to merge 18 commits into
MobileByteLabs:devfrom
therajanmaurya:session-PayCraft-20261121183129947
Draft

therajanmaurya wants to merge 18 commits into
MobileByteLabs:devfrom
therajanmaurya:session-PayCraft-20261121183129947

Conversation

@therajanmaurya

@therajanmaurya therajanmaurya commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds paywall A/B experiments, App Store refund (consumption request) answers and ad-attribution forwarding, and fixes the Google Play checkout failures: subscriptions and one-time products were priced in only 14 regions, so most buyers got product_not_found. Also adds a post-deploy end-to-end check that runs in every production deploy.

Changes

Google Play sync

  • Subscriptions, free-trial offers and one-time products now get prices in every Play region via pricing:convertRegionPrices. Prices the operator set win over converted ones, and existing one-time region prices are kept unchanged.
  • An invalid recorded product id (over 40 characters, or bad characters) falls back to a sanitized id instead of failing every re-sync.
  • Readiness reporting covers region counts and store states.

Paywall experiments

  • Migrations 206 and 209, the /paywall/experiments page and API, and /config serving the experiment.
  • Events carry the experiment and variant, and an invalid variant becomes null.
  • An experiment cannot start while any variant's offering has no active product. The SDK also leaves the config untouched for an empty variant.

App Store refunds: migration 207, an answer to CONSUMPTION_REQUEST, and a "Refund requests" view on the App Store provider page.

Attribution: migration 208, the attribution-ids function, GA4 and AppsFlyer settings, and the SDK AttributionIdsSync.

SDK

  • Purchase-success events keep the catalogue SKU instead of the store's own id.
  • Startup is crash-safe when the key is misconfigured.
  • Paywall value_props are served as SDK triples.

Other: product type one_time (205), product retire, pricing writes and templates, the trial rule, and Stripe session fixes.

Deploy

  • New infra/deploy/e2e.sh runs in deploy phase 6. It covers the SQL tests, experiment config and events, attribution auth, and the Apple notification guard.
  • The build writes NEXT_PUBLIC_APP_ENV, and the smoke test asserts /api/health env.

Verification

  • Production deploys are green, with the e2e check at E2E FAILS=0.
  • All 21 Play products across the 5 apps are ACTIVE in 174 regions.
  • Dashboard jest, SDK tests (404 + 432) and tsc pass.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

therajanmaurya and others added 17 commits November 22, 2026 21:44
…/com/mobilebytelabs/paycraft/web/PayCraftWeb.kt cmp-paycraft-web/src/jsTest/kotlin/com/mobilebytelabs/paycraft/web/CoreParityTest.kt
…ql supabase/tests/205_product_type_one_time_test.sql
…ilebytelabs/paycraft/config/SuiteConfig.kt cmp-paycraft-core/src/commonMain/kotlin/com/mobilebytelabs/paycraft/model/Product.kt cmp-paycraft-core/src/commonTest/kotlin/com/mobilebytelabs/paycraft/tree/CanonicalRoleFallbackTest.kt
…ilebytelabs/paycraft/PayCraft.kt cmp-paycraft-core/src/commonMain/kotlin/com/mobilebytelabs/paycraft/analytics/PayCraftEvent.kt cmp-paycraft-core/src/commonMain/kotlin/com/mobilebytelabs/paycraft/config/SuiteConfig.kt
…ilebytelabs/paycraft/config/ExperimentAssignmentTest.kt dashboard/app/(dashboard)/paywall/page.tsx dashboard/components/sidebar.tsx
….tsx dashboard/tests/server-surfaces.spec.ts infra/deploy/PAYCRAFT_DEPLOY.md
…ilebytelabs/paycraft/config/Experiment.kt cmp-paycraft-core/src/commonTest/kotlin/com/mobilebytelabs/paycraft/config/ExperimentAssignmentTest.kt dashboard/lib/experiments.ts
….test.ts dashboard/lib/googleplay-product-sync.ts
…telabs/paycraft/ui/PaywallFunnelTracker.kt cmp-paycraft/src/commonTest/kotlin/com/mobilebytelabs/paycraft/ui/PaywallFunnelEventsTest.kt dashboard/__tests__/lib/inapp-product-sync.test.ts
….test.ts dashboard/lib/googleplay-inapp-sync.ts dashboard/lib/googleplay-product-sync.ts
….test.ts dashboard/__tests__/lib/pricing-template.test.ts dashboard/__tests__/lib/products-pricing-write.test.ts
…dashboard/__tests__/lib/products-pricing-write.test.ts dashboard/app/api/v1/products/[id]/pricing/route.ts
…stripe-route-helper.ts dashboard/__tests__/lib/trial-rule.test.ts
…dashboard/app/api/v1/products/[id]/retire/route.ts dashboard/lib/googleplay-product-sync.ts
…dashboard/app/api/v1/products/[id]/retire/route.ts
…rite

Plain-string value_props made the SDK reject the whole /config, so apps sat on a stale
cached catalogue (Status Saver showed the retired premium-quarterly plan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@therajanmaurya therajanmaurya changed the title Improvements feat: paywall experiments, refunds, attribution + Play every-region pricing Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant