# पेमेंट fail होने पर subscribers का access बनाए रखें

> किसी एजेंट से अपने ऐप के subscriptions के लिए Apple का billing grace period चालू करवाएँ, चुनें कि यह कितना लंबा हो और किन renewals पर लागू हो, और पहले Sandbox में आज़माएँ।

Source: https://air.build/hi/docs/app-store/let-subscribers-keep-access-when-a-payment-fails/

जब payment की समस्या की वजह से किसी subscriber का renewal fail होता है, तो Apple का billing grace period उन्हें कुछ और दिनों का access दे सकता है जब तक Apple payment लेने की कोशिश करता है। Apple इसे [Enable billing grace period for auto-renewable subscriptions](https://developer.apple.com/help/app-store-connect/manage-subscriptions/enable-billing-grace-period-for-auto-renewable-subscriptions) में बताता है। कोई एजेंट इसे आपके ऐप के लिए चालू कर सकता है, चुन सकता है कि यह कितना लंबा हो, और पहले Sandbox में आज़मा सकता है।

> [!NOTE]
> AirBuild में इसके लिए कोई control नहीं है: **In-App Purchases** टैब पर **Group Settings** सिर्फ़ किसी group का नाम बदलता या उसे delete करता है। आप प्रोजेक्ट की चैट में किसी एजेंट से पूछते हैं। वह `asc apps subscription-grace-period view` से setting पढ़ता है ([asc: ऐप और App Store लिस्टिंग](https://air.build/hi/docs/cli/asc-apps/#apps) में `apps` के नीचे दिया गया) और `asc subscriptions grace-periods update` से उसे बदलता है ([asc: इन-ऐप खरीदारी और सब्सक्रिप्शन](https://air.build/hi/docs/cli/asc-monetization/#subscriptions) में `subscriptions` के नीचे दिया गया)। दूसरे App Store Connect commands की तरह, ये AirBuild में जुड़े Apple Developer account के ज़रिए चलते हैं।

## पूरे ऐप के लिए एक setting

`asc` की help इसे "an app's subscription grace period" कहती है: ऐप का एक ही होता है, हर प्लान या हर subscription group का अलग नहीं। आप जो भी चुनें, वह ऐप के सभी subscriptions पर एक साथ लागू होता है।

## आप क्या चुनते हैं

| Setting | विकल्प | Flag |
| --- | --- | --- |
| कितना लंबा | 3, 16 या 28 दिन (`THREE_DAYS`, `SIXTEEN_DAYS`, `TWENTY_EIGHT_DAYS`) | `--duration` |
| कौन-से renewals | सभी renewals (`ALL_RENEWALS`), या सिर्फ़ एक paid period से अगले तक के renewals (`PAID_TO_PAID_ONLY`) | `--renewal-type` |
| Sandbox | चालू या बंद | `--sandbox-opt-in` |
| आपके subscribers | चालू या बंद | `--opt-in` |

हर विकल्प किन renewals पर लागू होता है, जैसे paid subscription में बदलने वाला free trial, यह जानने के लिए Apple का [पेज](https://developer.apple.com/help/app-store-connect/manage-subscriptions/enable-billing-grace-period-for-auto-renewable-subscriptions) देखें।

## पहले Sandbox में आज़माएँ

प्रोजेक्ट की चैट में पूछें, जैसे:

```text
Turn on the billing grace period in Sandbox only: 16 days, for all renewals. Don't turn it on for real subscribers yet.
```

1. एजेंट `asc apps subscription-grace-period view` से आपके ऐप का grace period पढ़ता है और बताता है कि अभी यह कैसे set है।
2. वह `asc subscriptions grace-periods update` से इसे बदलता है, यहाँ `--sandbox-opt-in true`, `--duration SIXTEEN_DAYS` और `--renewal-type ALL_RENEWALS` के साथ। command सिर्फ़ आपकी बताई settings भेजता है; बाकी जैसी हैं वैसी रहती हैं।
3. वह आपको setting वैसे दिखाता है जैसे Apple उसे लौटाता है।

फिर अपने iPhone पर किसी sandbox tester से test करें: देखें [रिलीज़ से पहले in-app purchases टेस्ट करें](https://air.build/hi/docs/app-store/test-purchases-before-release/#buy-as-a-sandbox-tester)। कोई एजेंट tester के subscriptions को तेज़ी से renew करवा सकता है, लेकिन `asc sandbox` में ऐसी कोई setting नहीं है जो payment fail करवाए। Sandbox में billing समस्या test करने के लिए Apple का [Overview of testing in sandbox](https://developer.apple.com/help/app-store-connect/test-in-app-purchases/overview-of-testing-in-sandbox) देखें।

### जाँचें कि आपका ऐप क्या करता है

grace period Apple पर set होता है। इस दौरान आपका ऐप अपने paid features खुले रखता है या नहीं, यह आपके ऐप के code पर निर्भर है। Apple का [पेज](https://developer.apple.com/help/app-store-connect/manage-subscriptions/enable-billing-grace-period-for-auto-renewable-subscriptions) बताता है कि ऐप को क्या करना होगा। अपने एजेंट से पूछें, जैसे:

```text
Check that the app keeps Premium open for a subscriber in Apple's billing grace period, and fix it if it doesn't.
```

## इसे सबके लिए चालू करें

जब यह Sandbox में काम करे, तो पूछें:

```text
The grace period works in Sandbox. Turn it on for real subscribers too, with the same settings.
```

एजेंट `--opt-in true` के साथ `asc subscriptions grace-periods update` चलाता है और आपको नतीजा दिखाता है।

## इसे बदलें या बंद करें

जो चाहिए वह माँगें, जैसे "billing grace period 28 दिन का कर दो।" या "billing grace period बंद कर दो।" एजेंट सिर्फ़ वही बदलता है जो आप बताते हैं: अवधि, renewals, या इसे बंद करने के लिए `--opt-in false` और `--sandbox-opt-in false`। इसे बदलते समय जो subscribers पहले से grace period में हैं उनके साथ क्या होता है, इसके लिए Apple का [पेज](https://developer.apple.com/help/app-store-connect/manage-subscriptions/enable-billing-grace-period-for-auto-renewable-subscriptions) देखें।

setting कभी भी देखने के लिए पूछें "ऐप का billing grace period दिखाओ।"

## सवाल

**क्या हर प्लान का अपना grace period हो सकता है?**

नहीं। `asc` की help इसे ऐप का subscription grace period कहती है: हर ऐप का एक।

**क्या मैं AirBuild में grace period देख सकता हूँ?**

नहीं। **In-App Purchases** टैब इसे नहीं दिखाता। किसी एजेंट से पूछें, या web पर App Store Connect में देखें।

**एजेंट कहता है कि कम से कम एक update flag ज़रूरी है।**

command को बदलने के लिए कुछ चाहिए: अवधि, renewals, Sandbox या आपके subscribers। बताएँ कि आप क्या बदलना चाहते हैं।

**एजेंट कहता है कि --duration THREE_DAYS, SIXTEEN_DAYS, TWENTY_EIGHT_DAYS में से एक होना चाहिए।**

सिर्फ़ यही तीन अवधियाँ हैं। 3, 16 या 28 दिन चुनें।

**एजेंट कहता है कि --renewal-type ALL_RENEWALS, PAID_TO_PAID_ONLY में से एक होना चाहिए।**

सभी renewals चुनें, या सिर्फ़ एक paid period से अगले तक के renewals।
