API/Autodoc/Classes/class_name_RuStoreGodotPayClient_extends_Object.en.md


RuStoreGodotPayClient

class_name RuStoreGodotPayClient extends Object

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

Public Member Functions

| | | | | - | - | - | | static func | get_instance() -> RuStoreGodotPayClient: |
Get an instance of RuStoreGodotPayClient.

Returns a pointer to the single instance of RuStoreGodotPayClient (Singleton pattern implementation).
If the instance does not exist yet, creates it.
| | func | get_user_authorization_status(): | Check user authorization status.
| | func | get_purchase_availability(): | Check payment availability.
| | 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[RuStorePayProductId]): | Get a list of products added to your app through the RuStore console.

productIds — List of product IDs (set when creating a product in the developer console).
List of products has a limit of 1000 elements.
| | func | get_purchases(product_type: Variant = null, # ERuStorePayProductType.Item purchase_status: Variant = null # ERuStorePayPurchaseStatusFilter.Item): | Get a list of user purchases.
| | func | get_purchase(purchase_id: RuStorePayPurchaseId): | Get purchase information.

purchaseId — Product ID that was assigned to the product in the RuStore console. | | func | purchase(parameters: RuStorePayProductPurchaseParams, preferred_purchase_type: ERuStorePayPreferredPurchaseType.Item = ERuStorePayPreferredPurchaseType.Item.ONE_STEP, sdk_theme: ERuStorePaySdkTheme.Item = ERuStorePaySdkTheme.Item.LIGHT, enable_purchase_event_listener: bool = false,): | Product purchase.

parameters — Product purchase parameters.
preferred_purchase_type — Preferred purchase type.
sdk_theme — Color theme of the payment sheet.
enable_purchase_event_listener — Additional set of callback functions. | | func | purchase_two_step(parameters: RuStorePayProductPurchaseParams, sdk_theme: ERuStorePaySdkTheme.Item = ERuStorePaySdkTheme.Item.LIGHT, enable_purchase_event_listener: bool = false,): | Product purchase with two-stage payment.

parameters — Product purchase parameters.
sdk_theme — Color theme of the payment sheet.
enable_purchase_event_listener — Additional set of callback functions. | | func | confirm_two_step_purchase(purchase_id: RuStorePayPurchaseId, developer_payload: RuStorePayDeveloperPayload = null): |
Consume (confirm) a purchase.
After calling confirm, the purchase will transition to the CONFIRMED status.
A request to consume (confirm) a purchase must be accompanied by the delivery of the item.

purchase_id — Purchase ID.
developer_payload — A string containing additional order information (optional parameter). | | func | cancel_two_step_purchase(purchase_id: RuStorePayPurchaseId): |
Cancel a purchase.
A request to consume (confirm) a purchase must be accompanied by the delivery of the item.

purchase_id — Purchase ID. |

Signals

| | | | | - | - | - | | signal | on_get_user_authorization_status_success | Action performed upon successful completion of the get_user_authorization_status operation.
| | signal | on_get_user_authorization_status_failure | Action performed in case of get_user_authorization_status error.
| | signal | on_get_purchase_availability_success | Action performed upon successful completion of the get_purchase_availability operation.
| | signal | on_get_purchase_availability_failure | Action performed in case of get_purchase_availability error.
| | signal | on_get_products_success | Action performed upon successful completion of the get_products operation.
| | signal | on_get_products_failure | Action performed in case of get_products error.
| | signal | on_get_purchases_success | Action performed upon successful completion of the get_purchases operation.
| | signal | on_get_purchases_failure | Action performed in case of get_purchases error.
| | signal | on_get_purchase_success | Action performed upon successful completion of the get_purchase operation.
| | signal | on_get_purchase_failure | Action performed in case of get_purchase error.
| | signal | on_purchase_success | Action performed upon successful completion of the purchase operation.
| | signal | on_purchase_failure | Action performed in case of purchase error.
| | signal | on_purchase_two_step_success | Action performed upon successful completion of the purchase_two_step operation.
| | signal | on_purchase_two_step_failure | Action performed in case of purchase_two_step error.
| | signal | on_confirm_two_step_purchase_success | Action performed upon successful completion of the confirm_two_step_purchase operation.
| | signal | on_confirm_two_step_purchase_failure | Action performed in case of confirm_two_step_purchase error.
| | signal | on_cancel_two_step_purchase_success | Action performed upon successful completion of the cancel_two_step_purchas operation.
| | signal | on_cancel_two_step_purchase_failure | Action performed in case of cancel_two_step_purchas error.
| | signal | on_payment_completed | Action performed upon successful completion of the payment.
| | signal | on_payment_failed | Action performed in case of payment error.
| | signal | on_payment_started | Action performed when the payment process starts.
| | signal | on_purchase_cancelled | Action performed when the purchase is cancelled by the user.
| | signal | on_purchase_created | Action performed when the purchase is created.
|

Назад