API/Autodoc/Classes/RuStoreGodotBillingClient.en.md


RuStoreGodotBillingClient

class_name RuStoreGodotBillingClient extends Object

The class implements an API for integrating payments into a mobile application.

Public Member Functions

static func get_instance() -> RuStoreGodotBillingClient:
Get an instance of RuStoreGodotBillingClient.
Returns a pointer to a single instance of RuStoreGodotBillingClient (Singleton pattern implementation).
If the instance has not been created yet, it creates one.
func init(consoleApplicationId: String, deeplinkScheme: String, debugLogs: bool = false):
Initializes the singleton URuStoreBillingClient.
Initialization parameters are set by an object of type FURuStoreBillingClientConfig.
◆ consoleApplicationId — Application identifier from the RuStore console.
◆ deeplinkScheme — The deeplink scheme required to return to your application after payment via a third-party application (e.g., SberPay or SBP).
The SDK generates its own host for this scheme.
◆ debugLogs — A flag that controls event logging.
Set it to true if you want events to be logged.
Otherwise, set false.
func set_theme(themeCode: int):
SDK supports dynamic theme switching.
Set the interface theme.
◆ themeCode — New theme specified by a value from the EURuStoreTheme enumeration.
func check_purchases_availability():
Check payment availability.
func get_authorization_status():
Check the user's authorization status.
func is_rustore_installed() -> bool:
Check if RuStore is installed on the user's device.
Returns true if RuStore is installed, otherwise false.
func get_products(productIds: Array):
Get a list of products added to your application via the RuStore console.
◆ productIds — List of product identifiers (set when creating a product in the developer console).
The product list has a limit of 1000 items.
func purchase_product(productId: String, params: Dictionary = {}):
Purchase a product.
◆ productId — Product identifier assigned to the product in the RuStore Console (required parameter).
◆ params — Optional parameters:
- orderId — order identifier, created on the AnyApp side. (optional — if not specified, it is generated automatically);
- quantity — product quantity (optional parameter — if not specified, the value 1 will be used) (optional);
- developerPayload — a string with additional order information that you can set when initializing the purchase process.
func get_purchases():
Get the user's purchase list.
func confirm_purchase(purchase_id: String, developer_payload: String = ""):
Consume (confirm) a purchase.
A request to consume (confirm) a purchase must be accompanied by the delivery of the goods.
◆ purchaseId — Purchase identifier.
◆ developer_payload — A string with additional order information that you can set when initializing the purchase process.
func delete_purchase(purchase_id: String):
Cancel a purchase.
◆ purchase_id — Purchase identifier.
func get_purchase_info(purchase_id: String):
Get purchase information.
◆ purchaseId — Purchase identifier.

Signals

signal on_check_purchases_availability_success
Action performed when the check_purchases_availability operation completes successfully.
signal on_check_purchases_availability_failure
Action performed in case of an error in check_purchases_availability.
signal on_get_authorization_status_success
Action performed when the get_authorization_status operation completes successfully.
signal on_get_authorization_status_failure
Action performed in case of an error in get_authorization_status.
signal on_get_products_success
Action performed when the get_products operation completes successfully.
signal on_get_products_failure
Action performed in case of an error in get_products.
signal on_purchase_product_success
Action performed when the purchase_product operation completes successfully.
signal on_purchase_product_failure
Action performed in case of an error in purchase_product.
signal on_get_purchases_success
Action performed when the get_purchases operation completes successfully.
signal on_get_purchases_failure
Action performed in case of an error in get_purchases.
signal on_confirm_purchase_success
Action performed when the confirm_purchase operation completes successfully.
signal on_confirm_purchase_failure
Action performed in case of an error in confirm_purchase.
signal on_delete_purchase_success
Action performed when the delete_purchase operation completes successfully.
signal on_delete_purchase_failure
Action performed in case of an error in delete_purchase.
signal on_get_purchase_info_success
Action performed when the operation completes successfully.
signal on_get_purchase_info_failure
Action performed in case of an error.
signal on_payment_logger_debug
Logs a debug message.
Used for writing logs that aid in the application debugging process.
signal on_payment_logger_error
Logs an error message.
Used for writing logs that signal errors that require intervention or correction.
signal on_payment_logger_info
Logs an informational message.
Used for writing standard logs that help track the normal execution of the program.
signal on_payment_logger_verbose
Logs a verbose message.
Used for writing detailed logs that are useful for debugging.
signal on_payment_logger_warning
Logs a warning message.
Used for writing logs that signal potential issues that do not prevent program execution but may require attention.