Skip to content

Commit fafec6a

Browse files
Premium App Subscriptions: Testing guidance (#6548)
* Update to testing docs * Changelog for testing entitlements * bump date * Clarify test entitlement deletion * fix description for exclude_ended? * Update docs/Change_Log.md Co-authored-by: Jiralite <[email protected]> --------- Co-authored-by: Jiralite <[email protected]>
1 parent 4bac93c commit fafec6a

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

docs/Change_Log.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## Premium App Subscriptions: New Ways for Testing App Subscriptions
4+
#### Nov 29, 2023
5+
6+
Following feedback on Premium App Subscriptions, we've made it easier for developers to test their app subscriptions. The goal is to provide you with flexibility during testing and prevent you from having to use live payment methods.
7+
8+
- Team members will automatically receive a 100% discount on a subscription for your app, allowing you to test the end-to-end payment flow
9+
- Developers can create and delete [test entitlements](#DOCS_MONETIZATION_ENTITLEMENTS/create-test-entitlement) to toggle access to an application's premium features
10+
11+
Read more about [Testing your App Subscriptions Implementation](#DOCS_MONETIZATION_APP_SUBSCRIPTIONS/testing-your-implementation) for details.
12+
313
## Fix Message Edit Interaction Response Permissions
414
#### Nov 1, 2023
515

docs/monetization/App_Subscriptions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ return new JsonResponse({
4949

5050
If someone is already subscribed, this command will show the upgrade prompt with a disabled upgrade button. In order to avoid this, your interaction handler should check to see if the user or guild has an active entitlement for your SKU.
5151

52-
Each interaction payload includes an `entitlements` field containing an array of full entitlement objects that the guild or user currently has entitlement to.
52+
Each interaction payload includes an `entitlements` field containing an array of full [entitlement objects](#DOCS_MONETIZATION_ENTITLEMENTS/entitlement-object).
5353

5454
You can use this field to determine if the user or guild is subscribed to your app.
5555

@@ -74,11 +74,22 @@ For example, you might keep track of our entitlements in a database and check a
7474

7575
## Testing Your Implementation
7676

77+
### Using Test Entitlements
78+
7779
You can test your implementation by [creating](#DOCS_MONETIZATION_ENTITLEMENTS/create-test-entitlement) and [deleting](#DOCS_MONETIZATION_ENTITLEMENTS/delete-test-entitlement) test entitlements. These entitlements will allow you to test your premium offering in both a subscribed and unsubscribed state as a user or guild.
7880

7981
> info
8082
> Test Entitlements do not have a `starts_at` or `ends_at` field as they are valid until they are deleted.
8183
84+
### Testing Payment Flow with Live Entitlements
85+
86+
If you'd like to test the full payment flow for your app, you can do so by interacting with the `Upgrade` button. Any team members associated with your app will automatically see a 100% discount on the price of the subscription, allowing you to purchase without the use of live payment method.
87+
88+
After checkout, you will have a live subscription that includes a `starts_at` and `ends_at` value. If you cancel this subscription, it will remain an active entitlement until the `ends_at` timestamp. This subscription will renew until cancelled and can be used in testing subscription renewals in your app.
89+
90+
> info
91+
> You can only delete entitlements created using the [create test entitlement](#DOCS_MONETIZATION_ENTITLEMENTS/create-test-entitlement) endpoint. If you need to toggle access to your premium features during your development process, it is best to use test entitlements.
92+
8293
## Receiving Payouts
8394

8495
Once an app has made its first $100 it will become eligible for payout. A review will be conducted and if everything looks good, your team will begin to receive payouts.

docs/monetization/Entitlements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Returns all entitlements for a given app, active and expired.
5858
| after? | snowflake | Retrieve entitlements after this entitlement ID |
5959
| limit? | integer | Number of entitlements to return, 1-100, default 100 |
6060
| guild_id? | snowflake | Guild ID to look up entitlements for |
61-
| exclude_ended? | boolean | Whether expired entitlements should be omitted |
61+
| exclude_ended? | boolean | Whether or not ended entitlements should be omitted |
6262

6363
```json
6464
[

0 commit comments

Comments
 (0)