Skip to content

Commit

Permalink
Merge branch 'ADP-1386-Custom-stores-server-side-api' into develop
Browse files Browse the repository at this point in the history
Fixed issues found by QA
  • Loading branch information
Lutik-sun committed Nov 6, 2024
2 parents b389d10 + 37d7437 commit 9029c42
Show file tree
Hide file tree
Showing 46 changed files with 320 additions and 320 deletions.
20 changes: 20 additions & 0 deletions src/components/reusable/AccessLevel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!---AccessLevel.md --->

| Parameter | Type | Required in request | Nullable in request | Description |
| :---------------------------- | :------------ | :------------------ | :------------------ | :----------------------------------------------------------- |
| access_level_id | String | :heavy_plus_sign: | :heavy_minus_sign: | ID for the Paid Access Level set up in the Adapty Dashboard. |
| store | String | :heavy_plus_sign: | :heavy_minus_sign: | Store where the product was bought. Options: **app_store**, **play_store**, **stripe**, or the name of your [custom store](initial-custom). |
| store_product_id | String | :heavy_plus_sign: | :heavy_minus_sign: | ID of the product in the app store (like App Store, Google Play, Stripe) that unlocked this access level. |
| store_base_plan_id | String | :heavy_plus_sign: | :heavy_plus_sign: | [Base plan ID](https://support.google.com/googleplay/android-developer/answer/12154973) in Google Play or [price ID](https://docs.stripe.com/products-prices/how-products-and-prices-work#what-is-a-price) in Stripe. |
| store_transaction_id | String | :heavy_plus_sign: | :heavy_minus_sign: | Transaction ID in the app store (App Store, Google Play, Stripe, etc.). |
| store_original_transaction_id | String | :heavy_plus_sign: | :heavy_minus_sign: | <p>For subscriptions, this ID links the original transaction in the chain of renewals. Later transactions are linked as renewals.</p><p>If there’s no renewal, store_original_transaction_id matches store_transaction_id.</p> |
| offer | Dictionary | :heavy_plus_sign: | :heavy_minus_sign: | Dictionary where keys are offer IDs set by the developer in Adapty Dashboard. Values are [Offer](server-side-api-objects#offer) objects. Can be `null` if the customer has no access levels. |
| environment | String | :heavy_minus_sign: | :heavy_minus_sign: | Environment for the transaction that granted access. Options: `Sandbox`, `Production`. |
| starts_at | ISO 8601 date | :heavy_plus_sign: | :heavy_plus_sign: | The date time when the access level becomes active. Could be in the future. |
| purchased_at | ISO 8601 date | :heavy_plus_sign: | :heavy_minus_sign: | The datetime of the most recent purchase for the access level. |
| originally_purchased_at | ISO 8601 date | :heavy_plus_sign: | :heavy_minus_sign: | For subscriptions, this is the date and time of the very first (original) purchase in the chain, tied to `store_original_transaction_id`. |
| expires_at | ISO 8601 date | :heavy_plus_sign: | :heavy_plus_sign: | The datetime when the access level expires. Might be in the past, or `null` for lifetime access. |
| renewal_cancelled_at | ISO 8601 date | :heavy_plus_sign: | :heavy_plus_sign: | The datetime when auto-renewal was turned off for a subscription. The subscription can still be active; it just won’t auto-renew. Set to `null` if the user reactivates the subscription. |
| billing_issue_detected_at | ISO 8601 date | :heavy_plus_sign: | :heavy_plus_sign: | The datetime when a billing issue was found (like a failed card charge). The subscription might still be active. This is cleared if the payment goes through later. |
| is_in_grace_period | Boolean | :heavy_plus_sign: | :heavy_minus_sign: | Shows whether the subscription is in a [grace period](https://developer.apple.com/news/?id=09122019c) (only for auto-renewable subscriptions). |
| cancellation_reason | String | :heavy_plus_sign: | :heavy_plus_sign: | Reason for cancellation, with options like: `voluntarily_cancelled`, `billing_error`, `price_increase`, `product_was_not_available`, `refund`, `upgraded`, `unknown`. |
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@



The request failed because the access level defined in the request was not found. Review that your request does not contain typos in the `access_level_id` and that it belongs to the correct app.
The request failed because the access level in the request couldn’t be found. Double-check that there are no typos in the `access_level_id` and that it matches the correct app.

###### Parameters

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: Descriptive name of the error. </li></ul> |
| error_code | String | Short error name. Possible value: `paid_access_level_does_not_exist` |
| status_code | Integer | HTTP status. Always `404` |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Possible value: `paid_access_level_does_not_exist`. |
| status_code | Integer | HTTP status. Always `404`. |

###### Response example

The access level is not found
The access level was not found.

```json
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!--- AccessLevelNoProfileAccessLevel.md --->

The request failed because the profile defined in the request does not have the defined profile. Recheck that you entered correct profile in the header and access level in the body, make sure their IDs do not have typos.
The request failed because the profile in the request doesn’t match the specified access level. Double-check that the profile ID in the header and the access level ID in the body are correct, and make sure there are no typos.

###### Body

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: Descriptive name of the error</li></ul> |
| error_code | String | Short error name. Always `profile_paid_access_level_does_not_exist` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always `profile_paid_access_level_does_not_exist`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<p> </p>

The request failed because the profile defined in the request header was not found. Review that your request does not contain typos in `profile_id` or `customer_user_id`you enetered in the reuqest header and that it belongs to the correct app.
The request failed because the profile in the request header wasn’t found. Double-check that there are no typos in the `profile_id` or `customer_user_id` you entered in the request header, and make sure it’s for the correct app.

###### Parameters

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: Descriptive name of the error. </li></ul> |
| error_code | String | Short error name. Possible value: `profile_does_not_exist` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `non_field_errors`</li><li> **errors**: A description of the error. </li></ul> |
| error_code | String | Short error name. Possible value: `profile_does_not_exist`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--- BillingIssueDetectedDate --->

The billing issue is something that happened during a subscription renewal attempt. Therefore, it always happens after the transaction date (`purchased_at`).
A billing issue happens when there’s a problem during a subscription renewal attempt, so it always occurs after the transaction date (`purchased_at`).

To fix the issue, make sure the date of the billing issue `billing_issue_detected_at` is later than the transaction date (`purchased_at`).
To resolve this, make sure the billing issue date (`billing_issue_detected_at`) is later than the transaction date (`purchased_at`).

###### Body

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `billing_issue_detected_at`</li><li> **errors**: Descriptive name of the error</li></ul> |
| error_code | String | Short error name. Always `billing_issue_detected_at_date_comparison_error` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `billing_issue_detected_at`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always `billing_issue_detected_at_date_comparison_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--- ExpiresDate --->

The user cannot buy a subscription that has already expired. Therefore, the `expires_at` - the time of the subscription expiration is always later than the `purchased_at` - the time of the transaction purchase.
A user can’t buy a subscription that has already expired. So, the `expires_at` date (when the subscription expires) should always be later than the `purchased_at` date (when the transaction occurred).

To fix the issue, review these dates and make sure the `expires_at` is later than the `purchased_at`.
To fix this, check these dates and ensure that `expires_at` is after `purchased_at`.

###### Body

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `expires_at`</li><li> **errors**: Descriptive name of the error</li></ul> |
| error_code | String | Short error name. Always `expires_date_error` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `expires_at`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always `expires_date_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--- FamilySharePrice.md --->

The request failed because the request contains an `is_family_shared` parameter set to `true` which means the access level is shared by a family member for free and yet the `value` parameter of the [Price](server-side-api-objects#price) object is not equal to zero.
The request failed because the `is_family_shared` parameter is set to `true`, meaning the access level is shared with a family member for free. However, the `value` parameter of the [Price](server-side-api-objects#price) object isn’t set to zero.

Make sure the `is_family_shared` parameter should be set to `true`. If yes, set the `value` parameter of the [Price](server-side-api-objects#price) object to `0`.
If `is_family_shared` should be `true`, make sure to set the `value` parameter of the [Price](server-side-api-objects#price) object to `0`.

###### Parameters

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `is_family_shared`</li><li> **errors**: Descriptive name of the error. </li></ul> |
| error_code | String | Short error name. Always: `family_share_price_error` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `is_family_shared`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always: `family_share_price_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--- FreeTrialPrice.md --->

The request failed because the request contains an `offer_type` parameter with the value `free_trial` and yet the `value` parameter of the [Price](server-side-api-objects#price) object is not equal to zero.
The request failed because the `offer_type` parameter is set to `free_trial`, but the `value` parameter of the [Price](server-side-api-objects#price) object isn’t set to zero.

Another possible reason is that you added the `offer_id` parameter and left it `null` which it is not nullable. In this case, either add the `offer_id` value or remove the parameter.
Another possible reason is that the `offer_id` parameter was included but left `null`, even though it can’t be null. In this case, either provide a value for `offer_id` or remove the parameter entirely.

###### Parameters

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `offer.type`</li><li> **errors**: Descriptive name of the error. </li></ul> |
| error_code | String | Short error name. Always: `free_trial_price_error` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `offer.type`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always: `free_trial_price_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--- GracePeriodBilling --->

The start of a grace period is considered to be a billing issue. So if it is started (and that is defined by the filled out `grace_period_expires_at` parameter), the date of its start should be recorded to the `billing_issue_detected_at` parameter.
The start of a grace period counts as a billing issue. So, if the grace period has started (indicated by the `grace_period_expires_at` parameter being filled in), its start date should be recorded in the `billing_issue_detected_at` parameter.

To fix the issue, set the start of the grace period to the `billing_issue_detected_at` parameter or, if the grace period is not yet started, remove the `grace_period_expires_at` parameter.
To fix this, either set the start of the grace period in `billing_issue_detected_at` or, if the grace period hasn’t started yet, remove the `grace_period_expires_at` parameter.

###### Body

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `grace_period_billing_error`</li><li> **errors**: Descriptive name of the error</li></ul> |
| error_code | String | Short error name. Always `grace_period_billing_error` |
| status_code | Integer | HTTP status. Always `400` |
| errors | Object | <ul><li> **source**: (string) Always `grace_period_billing_error`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always `grace_period_billing_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

Expand Down
33 changes: 33 additions & 0 deletions src/components/reusable/GracePeriodExpiresDate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--- GracePeriodExpiresDate --->

A grace period is extra time you can give customers to extend their subscription if they couldn’t renew it on time—for instance, if their credit card didn’t go through. This helps keep their settings intact while they resolve any issues. Offering a grace period is optional.

If you do offer a grace period, the expiration date for it (`grace_period_expires_at`) should be later than the subscription expiration date (`expires_at`). If not, the grace period expiration time will match the subscription expiration time. In any case, the grace period expiration can’t be earlier than the subscription expiration.

To fix this, make sure the grace period expiration date (`grace_period_expires_at`) is later than the subscription expiration date (`expires_at`).

###### Body

| Parameter | Type | Description |
| ----------- | ------- | ------------------------------------------------------------ |
| errors | Object | <ul><li> **source**: (string) Always `grace_period_expires_at`</li><li> **errors**: A description of the error.</li></ul> |
| error_code | String | Short error name. Always `grace_period_expires_date_error`. |
| status_code | Integer | HTTP status. Always `400`. |

###### Response example

```json
{
"errors": [
{
"source": "grace_period_expires_at",
"errors": [
"grace_period_expires_at must be later or equal to expires_at."
]
}
],
"error_code": "grace_period_expires_date_error",
"status_code": 400
}
```

Loading

0 comments on commit 9029c42

Please sign in to comment.