Xsolla::Subscriptions::XsollaSubscriptions
Public Functions
| Name | |
|---|---|
| static void | GetSubscriptionPublicPlans
(Action< PlanItems
> onSuccess, Action< Error
> onError, int[] planId =null, string[] planExternalId =null, int limit =50, int offset =0, string locale =null, string country =null) Returns a list of all plans, including plans purchased by the user while promotions are active. |
| static void | GetSubscriptions
(Action< SubscriptionItems
> onSuccess, Action< Error
> onError, int limit =50, int offset =0, string locale =null) Returns a list of active recurrent subscriptions that have the status active, non renewing, and pause. |
| static void | GetSubscriptionDetails
(int subscriptionId, Action< SubscriptionDetails
> onSuccess, Action< Error
> onError, string locale =null) Returns information about a subscription by its ID. Subscription can be have any status. |
| static void | CancelSubscription
(int subscriptionId, Action onSuccess, Action< Error
> onError) Changes a regular subscription status to non_renewing (subscription is automatically canceled after expiration). |
| static void | GetSubscriptionRenewalUrl
(int subscriptionId, Action< PaymentLink
> onSuccess, Action< Error
> onError, PaymentSettings
settings =null, Dictionary< string, object > customParameters =null, string steamUserId =null) Returns the URL of the renewal interface for the selected subscription. |
| static void | GetSubscriptionPurchaseUrl
(string planExternalId, Action< PaymentLink
> onSuccess, Action< Error
> onError, PaymentSettings
settings =null, string country =null, Dictionary< string, object > customParameters =null, int? productId =null, string[] availablePlans =null) Returns Pay Station URL for the subscription purchase. |
| static void | GetSubscriptionManagementUrl
(Action< PaymentLink
> onSuccess, Action< Error
> onError, PaymentSettings
settings =null, string country =null, Dictionary< string, object > customParameters =null, int? productId =null, string[] availablePlans =null, string steamUserId =null) Returns the URL of the management interface for the selected subscription. |
| static void | GetUserAccountUrl
(Action< UserAccountLink
> onSuccess, Action< Error
> onError, string locale =null) Returns the URL to open user account for subscription management. |
| static void | GetSubscriptionPlans
(Action< PlanItems
> onSuccess, Action< Error
> onError, int[] planId =null, string[] planExternalId =null, int limit =50, int offset =0, string locale =null, string country =null) Returns a list of plans available to authorized users, including plans purchased by the user while promotions are active. |
Public Functions Documentation
function GetSubscriptionPublicPlans
- C#
1static void GetSubscriptionPublicPlans(
2 Action< PlanItems > onSuccess,
3 Action< Error > onError,
4 int[] planId =null,
5 string[] planExternalId =null,
6 int limit =50,
7 int offset =0,
8 string locale =null,
9 string country =null
10)
Returns a list of all plans, including plans purchased by the user while promotions are active.
Parameters:
- onSuccess Called after public plans have been successfully received.
- onError Called after the request resulted with an error.
- planId Array of subscription plan IDs. Plan ID can be found in the URL of the subscription details page in Publisher Account (https://publisher.xsolla.com/{merchant_id}/projects/{project_id}/subscriptions/plans/{plan_id} ).
- planExternalId List of subscription plan external IDs (32 characters per ID). Plan external ID can be found in Publisher Account in the Subscriptions > Subscription plans section next to the plan name.
- limit Limit for the number of elements on the page (15 elements are displayed by default).
- offset Number of elements from which the list is generated (the count starts from 0).
- locale Language of the UI. Two-letter lowercase language code . Leave empty to use the default value.
- country User’s country. Affects the choice of locale and currency. Two-letter uppercase country code per ISO 3166-1 alpha-2 . Calculations are based on the user’s IP address if the country is not specified. Check the documentation for detailed information about countries supported by Xsolla .
function GetSubscriptions
- C#
1static void GetSubscriptions(
2 Action< SubscriptionItems > onSuccess,
3 Action< Error > onError,
4 int limit =50,
5 int offset =0,
6 string locale =null
7)
Returns a list of active recurrent subscriptions that have the status active, non renewing, and pause.
Parameters:
- onSuccess Called after the list pf subscriptions has been successfully received.
- onError Called after the request resulted with an error.
- limit Limit for the number of elements on the page (15 elements are displayed by default).
- offset Number of elements from which the list is generated (the count starts from 0).
- locale Language of the UI. Two-letter lowercase language code . Leave empty to use the default value.
function GetSubscriptionDetails
- C#
1static void GetSubscriptionDetails(
2 int subscriptionId,
3 Action< SubscriptionDetails > onSuccess,
4 Action< Error > onError,
5 string locale =null
6)
Returns information about a subscription by its ID. Subscription can be have any status.
Parameters:
- subscriptionId Subscription ID.
- onSuccess Called after subscription data have been successfully received.
- onError Called after the request resulted with an error.
- locale Language of the UI. Two-letter lowercase language code . Leave empty to use the default value.
function CancelSubscription
- C#
1static void CancelSubscription(
2 int subscriptionId,
3 Action onSuccess,
4 Action< Error > onError
5)
Changes a regular subscription status to non_renewing (subscription is automatically canceled after expiration).
Parameters:
- subscriptionId Subscription ID.
- onSuccess Called after successful subscription cancelling.
- onError Called after the request resulted with an error.
function GetSubscriptionRenewalUrl
- C#
1static void GetSubscriptionRenewalUrl(
2 int subscriptionId,
3 Action< PaymentLink > onSuccess,
4 Action< Error > onError,
5 PaymentSettings settings =null,
6 Dictionary< string, object > customParameters =null,
7 string steamUserId =null
8)
Returns the URL of the renewal interface for the selected subscription.
Parameters:
- subscriptionId Subscription ID.
- onSuccess Called after the URL has been successfully received.
- onError Called after the request resulted with an error.
- settings Pay Station UI settings.
- customParameters Project specific parameters represented as a valid JSON set of key-value pairs.
- steamUserId Steam user ID.
function GetSubscriptionPurchaseUrl
- C#
1static void GetSubscriptionPurchaseUrl(
2 string planExternalId,
3 Action< PaymentLink > onSuccess,
4 Action< Error > onError,
5 PaymentSettings settings =null,
6 string country =null,
7 Dictionary< string, object > customParameters =null,
8 int? productId =null,
9 string[] availablePlans =null
10)
Returns Pay Station URL for the subscription purchase.
Parameters:
- planExternalId List of subscription plan external IDs (32 characters per ID). Plan external ID can be found in Publisher Account in the Subscriptions > Subscription plans section next to the plan name.
- onSuccess Called after the URL has been successfully received.
- onError Called after the request resulted with an error.
- settings Pay Station UI settings.
- country User’s country. Affects the choice of locale and currency. Two-letter uppercase country code per ISO 3166-1 alpha-2 . Calculations are based on the user’s IP address if the country is not specified. Check the documentation for detailed information about countries supported by Xsolla .
- customParameters Project specific parameters represented as a valid JSON set of key-value pairs.
- productId ID of the product associated with the plan.
- availablePlans Subscription plans to show in the payment UI.
function GetSubscriptionManagementUrl
- C#
1static void GetSubscriptionManagementUrl(
2 Action< PaymentLink > onSuccess,
3 Action< Error > onError,
4 PaymentSettings settings =null,
5 string country =null,
6 Dictionary< string, object > customParameters =null,
7 int? productId =null,
8 string[] availablePlans =null,
9 string steamUserId =null
10)
Returns the URL of the management interface for the selected subscription.
Parameters:
- onSuccess Called after the URL has been successfully received.
- onError Called after the request resulted with an error.
- settings Settings.
- country User’s country. Affects the choice of locale and currency. Two-letter uppercase country code per ISO 3166-1 alpha-2 . Calculations are based on the user’s IP address if the country is not specified. Check the documentation for detailed information about countries supported by Xsolla .
- customParameters Project specific parameters represented as a valid JSON set of key-value pairs.
- productId ID of the product associated with the plan.
- availablePlans Subscription plans to show in the payment UI.
- steamUserId Steam user ID.
function GetUserAccountUrl
- C#
1static void GetUserAccountUrl(
2 Action< UserAccountLink > onSuccess,
3 Action< Error > onError,
4 string locale =null
5)
Returns the URL to open user account for subscription management.
Parameters:
- onSuccess Called after the URL has been successfully received.
- onError Called after the request resulted with an error.
- locale Language of the UI. Two-letter lowercase language code . Leave empty to use the default (en) value.
The user account is a UI that allows users to view their purchase history and manage their subscriptions (change plans, update payment methods, cancel subscriptions, disable, auto-renewal etc.).
function GetSubscriptionPlans
- C#
1static void GetSubscriptionPlans(
2 Action< PlanItems > onSuccess,
3 Action< Error > onError,
4 int[] planId =null,
5 string[] planExternalId =null,
6 int limit =50,
7 int offset =0,
8 string locale =null,
9 string country =null
10)
Returns a list of plans available to authorized users, including plans purchased by the user while promotions are active.
Parameters:
- onSuccess Called after a list of plans has been successfully received.
- onError Called after the request resulted with an error.
- planId Array of subscription plan IDs. Plan ID can be found in the URL of the subscription details page in Publisher Account (https://publisher.xsolla.com/{merchant_id}/projects/{project_id}/subscriptions/plans/{plan_id} ).
- planExternalId List of subscription plan external IDs (32 characters per ID). Plan external ID can be found in Publisher Account in the Subscriptions > Subscription plans section next to the plan name.
- limit Limit for the number of elements on the page (15 elements are displayed by default).
- offset Number of elements from which the list is generated (the count starts from 0).
- locale Language of the UI. Two-letter lowercase language code . Leave empty to use the default value.
- country User’s country. Affects the choice of locale and currency. Two-letter uppercase country code per ISO 3166-1 alpha-2 . Calculations are based on the user’s IP address if the country is not specified. Check the documentation for detailed information about countries supported by Xsolla .
Found a typo or other text error? Select the text and press Ctrl+Enter.