API/Autodoc/Files/RuStorePurchase.gd.md
Source code
# @brief Информация о покупке.
class_name RuStorePurchase extends RefCounted
# @brief Идентификатор покупки.
var purchaseId = null
# @brief Идентификатор продукта, который был присвоен продукту в консоли RuStore.
var productId: String = ""
# @brief Тип продукта.
var productType = null
# @brief Идентификатор счёта.
var invoiceId = null
# @brief Язык, указанный с помощью BCP 47 кодирования.
var language = null
# @brief Время покупки.
var purchaseTime = null
# Максимальная длина 150 символов.
var orderId = null
# @brief Отформатированная цена покупки, включая валютный знак.
var amountLabel = null
# @brief Цена в минимальных единицах валюты (например в копейках).
var amount = null
# @brief Код валюты ISO 4217.
var currency = null
# @brief Количество продукта.
var quantity = null
# @brief Состояние покупки.
var purchaseState = null
# которую вы можете установить при инициализации процесса покупки.
var developerPayload = null
# @brief Токен для валидации покупки на сервере.
var subscriptionToken = null
func _init(json: String = ""):
if json != "":
var obj = JSON.parse_string(json)
if obj.has("purchaseId"): purchaseId = obj["purchaseId"]
productId = obj["productId"]
if obj.has("productType"): productType = ERuStoreProductType.Item.get(obj["productType"])
if obj.has("invoiceId"): invoiceId = obj["invoiceId"]
if obj.has("language"): language = obj["language"]
if obj.has("purchaseTime"): purchaseTime = obj["purchaseTime"]#RuStoreDateTime
if obj.has("orderId"): orderId = obj["orderId"]
if obj.has("amountLabel"): amountLabel = obj["amountLabel"]
if obj.has("amount"): amount = int(obj["amount"])
if obj.has("currency"): currency = obj["currency"]
if obj.has("quantity"): quantity = int(obj["quantity"])
if obj.has("purchaseState"): purchaseState = ERuStorePurchaseState.Item.get(obj["purchaseState"])
if obj.has("developerPayload"): developerPayload = obj["developerPayload"]
if obj.has("subscriptionToken"): subscriptionToken = obj["subscriptionToken"]
- Страницы
- ERuStoreProductStatus.gd.en
- ERuStoreProductStatus.gd
- ERuStoreProductType.gd.en
- ERuStoreProductType.gd
- ERuStorePurchaseState.gd.en
- ERuStorePurchaseState.gd
- ERuStoreTheme.gd.en
- ERuStoreTheme.gd
- RuStoreBillingJsonParser.gd.en
- RuStoreBillingJsonParser.gd
- RuStoreBillingUserAuthorizationStatus.gd.en
- RuStoreBillingUserAuthorizationStatus.gd
- RuStoreError.gd.en
- RuStoreError.gd
- RuStoreFeatureAvailabilityResult.gd.en
- RuStoreFeatureAvailabilityResult.gd
- RuStoreGodotBilling.en
- RuStoreGodotBilling.gd.en
- RuStoreGodotBilling.gd
- RuStoreGodotBilling
- RuStoreGodotCore.en
- RuStoreGodotCore
- RuStorePaymentResult.gd.en
- RuStorePaymentResult.gd
- RuStoreProduct.gd.en
- RuStoreProduct.gd
- RuStoreProductSubscription.gd.en
- RuStoreProductSubscription.gd
- RuStorePurchase.gd.en
- RuStorePurchase.gd
- RuStorePurchaseAvailabilityResult.gd.en
- RuStorePurchaseAvailabilityResult.gd
- RuStoreSubscriptionPeriod.gd.en
- RuStoreSubscriptionPeriod.gd
- addons.en
- addons
- docs.en
- docs
- godot_example.en
- godot_example
- ERuStoreProductStatus.gd.en
- ERuStoreProductStatus.gd
- ERuStoreProductType.gd.en
- ERuStoreProductType.gd
- ERuStorePurchaseState.gd.en
- ERuStorePurchaseState.gd
- ERuStoreTheme.gd.en
- ERuStoreTheme.gd
- RuStoreBillingJsonParser.gd.en
- RuStoreBillingJsonParser.gd
- RuStoreBillingUserAuthorizationStatus.gd.en
- RuStoreBillingUserAuthorizationStatus.gd
- RuStoreError.gd.en
- RuStoreError.gd
- RuStoreFeatureAvailabilityResult.gd.en
- RuStoreFeatureAvailabilityResult.gd
- RuStoreGodotBilling.en
- RuStoreGodotBilling.gd.en
- RuStoreGodotBilling.gd
- RuStoreGodotBilling
- RuStoreGodotCore.en
- RuStoreGodotCore
- RuStorePaymentResult.gd.en
- RuStorePaymentResult.gd
- RuStoreProduct.gd.en
- RuStoreProduct.gd
- RuStoreProductSubscription.gd.en
- RuStoreProductSubscription.gd
- RuStorePurchase.gd.en
- RuStorePurchase.gd
- RuStorePurchaseAvailabilityResult.gd.en
- RuStorePurchaseAvailabilityResult.gd
- RuStoreSubscriptionPeriod.gd.en
- RuStoreSubscriptionPeriod.gd
- addons.en
- addons
- docs.en
- docs
- godot_example.en
- godot_example