StoreTransaction

Inherits: RefCounted < Object

Represents a successful purchase transaction.

Description

This class contains details about a purchase, such as the product ID, purchase date, and expiration date (for subscriptions).

When you receive a transaction update, you must call the finish() method on the transaction once you have made sure

that you have delivered the content to the user.

Properties

float

expiration_date

0.0

bool

is_upgraded

false

int

original_id

0

String

ownership_type

"unknown"

String

product_id

""

float

purchase_date

0.0

float

revocation_date

0.0

int

transaction_id

0

Methods

void

finish()


Property Descriptions

float expiration_date = 0.0 🔗

  • float get_expiration_date()

The date when the subscription expires, as a Unix timestamp. Returns 0 if not applicable.


bool is_upgraded = false 🔗

  • bool get_is_upgraded()

Whether this transaction is an upgrade of another transaction.


int original_id = 0 🔗

  • int get_original_id()

The transaction identifier of the original purchase.


String ownership_type = "unknown" 🔗

  • String get_ownership_type()

The type of ownership (e.g., “purchased”, “familyShared”, “unknown”).


String product_id = "" 🔗

  • String get_product_id()

The unique identifier of the purchased product.


float purchase_date = 0.0 🔗

  • float get_purchase_date()

The date when the purchase was made, as a Unix timestamp.


float revocation_date = 0.0 🔗

  • float get_revocation_date()

The date when the transaction was revoked, as a Unix timestamp. Returns 0 if not revoked.


int transaction_id = 0 🔗

  • int get_transaction_id()

The unique identifier of the transaction.


Method Descriptions

void finish() 🔗

The finish method notifies the App Store that the app has successfully provided the purchased content or

activated the purchased service, allowing the transaction to be completed.

Call finish() only after your app has delivered the content or enabled the service. If the purchase

includes on-demand resources, wait to finish the transaction until the download is complete or the

resources have otherwise been fully delivered.