Show / Hide Table of Contents

Class ISN_SKPaymentQueue

A queue of payment transactions to be processed by the App Store.

The payment queue communicates with the App Store and presents a user interface so that the user can authorize payment. The contents of the queue are persistent between launches of your app.

Inheritance
System.Object
ISN_SKPaymentQueue
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: SA.iOS.StoreKit
Assembly: cs.temp.dll.dll
Syntax
public static class ISN_SKPaymentQueue

Properties

AppStoreReceipt

For an application purchased from the App Store, use this property a to get the receipt. This property makes no guarantee about whether there is a file at the URL—only that if a receipt is present, that is its location.

Declaration
public static ISN_SKAppStoreReceipt AppStoreReceipt { get; }
Property Value
Type Description
ISN_SKAppStoreReceipt

The app store receipt.

CanMakePayments

Indicates whether the user is allowed to make payments.

An iPhone can be restricted from accessing the Apple App Store. For example, parents can restrict their children’s ability to purchase additional content. Your application should confirm that the user is allowed to authorize payments before adding a payment to the queue. Your application may also want to alter its behavior or appearance when the user is not allowed to authorize payments.

Declaration
public static bool CanMakePayments { get; }
Property Value
Type Description
System.Boolean

true if can make payments; otherwise, false.

IsReady

Gets a value indicating whether this ISN_SKPaymentQueue is ready. The ISN_SKPaymentQueue is ready once Init is completed successfully

Declaration
public static bool IsReady { get; }
Property Value
Type Description
System.Boolean

true if is ready; otherwise, false.

Products

A list of products, one product for each valid product identifier provided in the original init request. only valid to use when IsReady is true

Declaration
public static List<ISN_SKProduct> Products { get; }
Property Value
Type Description
List<ISN_SKProduct>

Storefront

The current App Store storefront for the payment queue.

Declaration
public static ISN_SKStorefront Storefront { get; }
Property Value
Type Description
ISN_SKStorefront

Methods

AddPayment(ISN_SKPayment)

Adds a payment request to the queue.

An application should always have at least one observer of the payment queue before adding payment requests. The payment request must have a product identifier registered with the Apple App Store.

When a payment request is added to the queue, the payment queue processes that request with the Apple App Store and arranges for payment from the user. When that transaction is complete or if a failure occurs, the payment queue sends the SA.iOS.StoreKit.ISN_SKPaymentTransaction object that encapsulates the request to all transaction observers.

Declaration
public static void AddPayment(ISN_SKPayment payment)
Parameters
Type Name Description
ISN_SKPayment payment

A payment request.

AddPayment(String)

Adds a payment request to the queue.

An application should always have at least one observer of the payment queue before adding payment requests. The payment request must have a product identifier registered with the Apple App Store.

When a payment request is added to the queue, the payment queue processes that request with the Apple App Store and arranges for payment from the user. When that transaction is complete or if a failure occurs, the payment queue sends the SA.iOS.StoreKit.ISN_SKPaymentTransaction object that encapsulates the request to all transaction observers.

Declaration
public static void AddPayment(string productId)
Parameters
Type Name Description
System.String productId

Product identifier.

AddTransactionObserver(ISN_iSKPaymentTransactionObserver)

Adds an observer to the payment queue.

Your application should add an observer to the payment queue during application initialization. If there are no observers attached to the queue, the payment queue does not synchronize its list of pending transactions with the Apple App Store, because there is no observer to respond to updated transactions.

If an application quits when transactions are still being processed, those transactions are not lost. The next time the application launches, the payment queue will resume processing the transactions. Your application should always expect to be notified of completed transactions.

If more than one transaction observer is attached to the payment queue, no guarantees are made as to the order they will be called in. It is safe for multiple observers to call FinishTransaction(ISN_iSKPaymentTransaction), but not recommended. It is recommended that you use a single observer to process and finish the transaction.

Declaration
public static void AddTransactionObserver(ISN_iSKPaymentTransactionObserver observer)
Parameters
Type Name Description
ISN_iSKPaymentTransactionObserver observer

The observer to add to the queue.

FinishTransaction(ISN_iSKPaymentTransaction)

Completes a pending transaction.

Your application should call this method from a transaction observer that received a notification from the payment queue. Calling FinishTransaction(ISN_iSKPaymentTransaction) on a transaction removes it from the queue. Your application should call FinishTransaction(ISN_iSKPaymentTransaction) only after it has successfully processed the transaction and unlocked the functionality purchased by the user.

Calling FinishTransaction(ISN_iSKPaymentTransaction) on a transaction that is in the Purchasing state throws an exception.

Declaration
public static void FinishTransaction(ISN_iSKPaymentTransaction transaction)
Parameters
Type Name Description
ISN_iSKPaymentTransaction transaction

transaction to finish

GetProductById(String)

Gets the product by identifier.

Declaration
public static ISN_SKProduct GetProductById(string productIdentifier)
Parameters
Type Name Description
System.String productIdentifier

Product identifier.

Returns
Type Description
ISN_SKProduct

Init(Action<ISN_SKProductsResponse>)

Declaration
public static void Init(Action<ISN_SKProductsResponse> callback)
Parameters
Type Name Description
Action<ISN_SKProductsResponse> callback

Init(List<ISN_SKProduct>, Action<ISN_SKProductsResponse>)

Initializes the Store Kit with the set of previously defined product Products can be defined under the editor plugin settings: Stan's Assets->IOS Native->Edit Settings Or you can add product's via code using RegisterProduct(ISN_SKProduct)

Declaration
public static void Init(List<ISN_SKProduct> products, Action<ISN_SKProductsResponse> callback)
Parameters
Type Name Description
List<ISN_SKProduct> products

List of the products to initialize the service with.

Action<ISN_SKProductsResponse> callback

Callback with the initialization result.

RegisterProduct(ISN_SKProduct)

Registers the product. You can also define products using editor plugin settings: Stan's Assets->IOS Native->Edit Settings

Declaration
public static void RegisterProduct(ISN_SKProduct product)
Parameters
Type Name Description
ISN_SKProduct product

Product.

RegisterProductId(String)

Simplified product registration by the product identifier. You can also define products using editor plugin settings: Stan's Assets->IOS Native->Edit Settings

Declaration
public static void RegisterProductId(string productId)
Parameters
Type Name Description
System.String productId

Product identifier.

RemoveTransactionObserver(ISN_iSKPaymentTransactionObserver)

Removes an observer from the payment queue.

If there are no observers attached to the queue, the payment queue does not synchronize its list of pending transactions with the Apple App Store, because there is no observer to respond to updated transactions.

Declaration
public static void RemoveTransactionObserver(ISN_iSKPaymentTransactionObserver observer)
Parameters
Type Name Description
ISN_iSKPaymentTransactionObserver observer

The observer to remove.

RestoreCompletedTransactions()

Asks the payment queue to restore previously completed purchases.

our application calls this method to restore transactions that were previously finished so that you can process them again. For example, your application would use this to allow a user to unlock previously purchased content onto a new device.

Declaration
public static void RestoreCompletedTransactions()
In This Article
Back to top Generated by DocFX