Share via


StoreSku.RequestPurchaseAsync Method

Definition

Overloads

RequestPurchaseAsync()

Requests the purchase of the product SKU and displays the UI that is used to complete the transaction via the Windows Store.

Important

This method must be called on the UI thread.

RequestPurchaseAsync(StorePurchaseProperties)

Requests the purchase of the product SKU and displays the UI that is used to complete the transaction via the Microsoft Store. This method provides the option to specify additional details for a specific offer within a large catalog of products that are represented by a single listing in the Microsoft Store, including the product name to display to the user during the purchase.

Important

This method must be called on the UI thread.

RequestPurchaseAsync()

Requests the purchase of the product SKU and displays the UI that is used to complete the transaction via the Windows Store.

Important

This method must be called on the UI thread.

public:
 virtual IAsyncOperation<StorePurchaseResult ^> ^ RequestPurchaseAsync() = RequestPurchaseAsync;
/// [Windows.Foundation.Metadata.Overload("RequestPurchaseAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync();
[Windows.Foundation.Metadata.Overload("RequestPurchaseAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync();
function requestPurchaseAsync()
Public Function RequestPurchaseAsync () As IAsyncOperation(Of StorePurchaseResult)

Returns

An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.

Attributes

Exceptions

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the <xref href="Windows.Services.Store.StoreContext?text=StoreContext" /> object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

See also

Applies to

RequestPurchaseAsync(StorePurchaseProperties)

Requests the purchase of the product SKU and displays the UI that is used to complete the transaction via the Microsoft Store. This method provides the option to specify additional details for a specific offer within a large catalog of products that are represented by a single listing in the Microsoft Store, including the product name to display to the user during the purchase.

Important

This method must be called on the UI thread.

public:
 virtual IAsyncOperation<StorePurchaseResult ^> ^ RequestPurchaseAsync(StorePurchaseProperties ^ storePurchaseProperties) = RequestPurchaseAsync;
/// [Windows.Foundation.Metadata.Overload("RequestPurchaseWithPurchasePropertiesAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync(StorePurchaseProperties const& storePurchaseProperties);
[Windows.Foundation.Metadata.Overload("RequestPurchaseWithPurchasePropertiesAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StorePurchaseResult> RequestPurchaseAsync(StorePurchaseProperties storePurchaseProperties);
function requestPurchaseAsync(storePurchaseProperties)
Public Function RequestPurchaseAsync (storePurchaseProperties As StorePurchaseProperties) As IAsyncOperation(Of StorePurchaseResult)

Parameters

storePurchaseProperties
StorePurchaseProperties

An object that specifies additional info for the purchase request, including the product name to display to the user during the purchase.

Returns

An asynchronous operation that, on successful completion, returns a StorePurchaseResult object that provides status and error info about the purchase.

Attributes

Exceptions

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the <xref href="Windows.Services.Store.StoreContext?text=StoreContext" /> object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

See also

Applies to