rc-payment-recovery — скилл для Claude Code: что делает, установка
Подсказывает ИИ-агенту, как обрабатывать сбои продления подписок Google Play через RevenueCat. Помогает настроить льготный период и системные сообщения.
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a claude-codeЧто делает rc-payment-recovery
Скилл обучает ассистента логике восстановления платежей в Android-приложениях на базе RevenueCat SDK. При сбое продления подписки Google переводит аккаунт в льготный период (Grace Period) или блокировку (Account Hold). Скилл поясняет, как эти состояния отражаются в объекте CustomerInfo.
В коде логика опирается на два поля в EntitlementInfo: дату billingIssueDetectedAt и признак isActive. По умолчанию SDK сам показывает системный снекбар Google Play через вызов showInAppMessagesIfNeeded. Для собственного экрана предупреждений скилл даёт готовую схему ветвления и перенаправление на страницу управления через customerInfo.managementURL.
Обрабатывать RTDN вручную не придётся. RevenueCat отправляет серверный вебхук BILLING_ISSUE при первой смене статуса. Если нужно показывать системные диалоги только на выбранных экранах, автопоказ придётся отключить в PurchasesConfiguration.Builder.
Какие задачи решает
- отслеживать льготный период Grace Period в Android-приложении
- блокировать доступ при переходе подписки в статус Account Hold
- настроить показ системных сообщений Google Play через showInAppMessagesIfNeeded
- перенаправить пользователя на страницу оплаты через managementURL
Примеры запросов агенту
- Покажи, как обработать льготный период подписки через RevenueCat в Kotlin
- Настрой показ системных сообщений Google Play только на главном экране
- Как проверить статус Account Hold по объекту CustomerInfo?
Как установить rc-payment-recovery
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a claude-code2Вручную: положить файлы
~/.claude/skills/rc-payment-recovery/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/rc-payment-recovery/
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a codex2Вручную: положить файлы
.agents/skills/rc-payment-recovery/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a cursor2Вручную: положить файлы
.cursor/skills/rc-payment-recovery/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install RevenueCat/ai-toolkit rc-payment-recovery2Вручную: положить файлы
.github/skills/rc-payment-recovery/SKILL.md1Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a gemini-cli2Командой платформы
gemini skills install https://github.com/RevenueCat/ai-toolkit --path revenuecat-play-billing/skills/rc-payment-recoveryВручную: положить файлы
.devin/skills/rc-payment-recovery/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о rc-payment-recovery
Как установить rc-payment-recovery в Claude Code?
Выполните команду npx skills add RevenueCat/ai-toolkit --skill rc-payment-recovery -a claude-code. Файл сохранится по пути ~/.claude/skills/rc-payment-recovery/SKILL.md.
Зачем нужен скилл rc-payment-recovery?
Он помогает агенту корректно реализовать сценарии отклонённых платежей в Google Play с помощью RevenueCat SDK, разграничивая состояния Grace Period и Account Hold.
Нужно ли парсить RTDN-уведомления от Google вручную?
Нет, всю работу выполняет RevenueCat и отправляет готовый серверный вебхук BILLING_ISSUE при первой смене статуса подписки.
Исходный текст
SKILL.md · MIT
---
name: rc-payment-recovery
description: Use this skill when handling failed renewals on Android with RevenueCat. Covers how Grace Period and Account Hold are reflected in CustomerInfo automatically, when to prompt the user, and how to trigger Google's in app messaging via showInAppMessages.
license: Apache-2.0; see LICENSE
metadata:
author: RevenueCat
source: revenuecat-handbook chapter 12
keywords:
- android
- revenuecat
- payment-recovery
- grace-period
- account-hold
- in-app-messaging
---
# Payment Recovery
Failed renewals on Google Play move a subscription through two states: grace period (user keeps access while Google retries the card) and account hold (access revoked until the user fixes the payment method). With RevenueCat, both states land in `CustomerInfo` automatically, and Google's in app message shows by default.
## Phase 1: Understand
Three things happen when a renewal fails:
| State | Access | How RevenueCat surfaces it | User sees |
| --- | --- | --- | --- |
| Grace period | Retained | `entitlement.isActive == true` and `billingIssueDetectedAt != null` | Google in app snackbar by default |
| Account hold | Revoked | `entitlement.isActive == false` and `billingIssueDetectedAt != null` | Google in app snackbar by default |
| Recovered | Retained | `billingIssueDetectedAt == null` | Nothing |
Two signals matter in the SDK:
- `EntitlementInfo.billingIssueDetectedAt` is non null from the moment Google reports a billing problem until the user resolves it.
- `EntitlementInfo.isActive` tells you whether they still have access.
On the backend, a `BILLING_ISSUE` webhook fires once per transition. You do not decode RTDNs.
## Phase 2: Plan
Before you write app code, decide what you actually need. Most apps need none.
Ask:
1. Do you want the default Google in app message? If yes, do nothing. The SDK calls `showInAppMessagesIfNeeded` on BillingClient connect.
2. Do you want your own banner or dialog? If yes, read `billingIssueDetectedAt` from `CustomerInfo` and branch on `isActive`.
3. Do you want to gate the message to specific screens? If yes, disable the automatic call and invoke `showInAppMessagesIfNeeded(activity)` yourself.
4. Do you need a server side flag (for example, to send a recovery email)? If yes, handle the `BILLING_ISSUE` webhook. No app code required.
If you only want the default behavior, stop here.
## Phase 3: Execute
### Default (recommended)
Leave automatic in app messages on. This is the default:
```kotlin
PurchasesConfiguration.Builder(context, apiKey)
.showInAppMessagesAutomatically(true)
.build()
```
### Manual trigger
Disable the automatic call and show the message from your chosen activity:
```kotlin
PurchasesConfiguration.Builder(context, apiKey)
.showInAppMessagesAutomatically(false)
.build()
Purchases.sharedInstance.showInAppMessagesIfNeeded(activity)
```
### Your own UI during grace period
Read the entitlement and branch on both flags:
```kotlin
val entitlement = customerInfo.entitlements["pro_access"]
when {
entitlement == null || !entitlement.isActive ->
showSubscribeScreen()
entitlement.billingIssueDetectedAt != null && entitlement.isActive ->
showGracePeriodWarning()
entitlement.billingIssueDetectedAt != null && !entitlement.isActive ->
showAccountHoldScreen()
else ->
showPremiumContent()
}
```
### Send the user to fix payment
`CustomerInfo.managementURL` points to the Google Play subscription page:
```kotlin
customerInfo.managementURL?.let { url ->
startActivity(Intent(Intent.ACTION_VIEW, url))
}
```
## Phase 4: Verify
Test each transition:
- Use a Google Play test card that declines renewals to push a subscription into grace period.
- Confirm `entitlement.billingIssueDetectedAt` becomes non null and `isActive` stays `true`.
- Wait for account hold and confirm `isActive` flips to `false` while `billingIssueDetectedAt` remains non null.
- Update the payment method and confirm `billingIssueDetectedAt` returns to `null`.
- On backend, confirm a `BILLING_ISSUE` webhook fires on the first transition.
## References
- [Full chapter](https://www.revenuecat.com/guides/revenuecat-android-sdk/payment-recovery)
© RevenueCat · MIT · RevenueCat/ai-toolkit