WalletItemStore WalletItemStore WalletItemStore WalletItemStore Class

Definition

Defines a set of asynchronous actions and operations that manage the wallet items in the wallet database. These can be used to read the existing items, or to add and remove items.

public : sealed class WalletItemStore : IWalletItemStorepublic sealed class WalletItemStore : IWalletItemStorePublic NotInheritable Class WalletItemStore Implements IWalletItemStore// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Call the WalletManager.RequestStoreAsync method to obtain an instance of this class.

Most of the APIs for this class can be seen in example usages in the Quickstart: Using the APIs topic.

Methods

AddAsync(String, WalletItem) AddAsync(String, WalletItem) AddAsync(String, WalletItem) AddAsync(String, WalletItem)

Adds a new wallet item to the wallet.

public : IAsyncAction AddAsync(PlatForm::String id, WalletItem item)public IAsyncAction AddAsync(String id, WalletItem item)Public Function AddAsync(id As String, item As WalletItem) As IAsyncAction// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The identifier of the wallet item. This value must be unique. This sets the initial WalletItem.Id value (the identifier is for the WalletItemStore store, and isn't part of the initialization of a WalletItem object.

item
WalletItem WalletItem WalletItem WalletItem

The wallet item to add to the wallet.

Returns

An asynchronous action. If you use Asynchronous programming, the return type is void.

Remarks

If the id value passed in to this method is not unique, or if the item has already been added to the wallet, an exception is thrown. How to handle errors/exceptions varies by programming language, particularly so when calling asynchronous methods. See Asynchronous programming.

Remember that when you call this method, the item is added to the wallet item store, which is owned by the device not the app. While you're still developing, the store persists across app sessions, and so attempting to add the same item again when running another debug session can throw an exception because the item's already there. Consider adding a call to ClearAsync before you attempt to add any items and you've run your code more than once, at least while you're still developing and testing your code.

See Also

ClearAsync() ClearAsync() ClearAsync() ClearAsync()

Clears all app-owned wallet items from the wallet data store.

public : IAsyncAction ClearAsync()public IAsyncAction ClearAsync()Public Function ClearAsync() As IAsyncAction// You can use this method in JavaScript.
Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

See Also

DeleteAsync(String) DeleteAsync(String) DeleteAsync(String) DeleteAsync(String)

Removes a specific wallet item with the given ID from the wallet data store.

public : IAsyncAction DeleteAsync(PlatForm::String id)public IAsyncAction DeleteAsync(String id)Public Function DeleteAsync(id As String) As IAsyncAction// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The ID of the wallet item to remove from the data store.

Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

See Also

GetItemsAsync() GetItemsAsync() GetItemsAsync() GetItemsAsync()

Returns the collection of all wallet items owned by this app.

public : IAsyncOperation<IVectorView<WalletItem>> GetItemsAsync()public IAsyncOperation<IReadOnlyList<WalletItem>> GetItemsAsync()Public Function GetItemsAsync() As IAsyncOperation( Of IReadOnlyListWalletItem )// You can use this method in JavaScript.
Returns
IAsyncOperation<IVectorView<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>>

An asynchronous operation that, on successful completion, returns the collection of wallet items accessible by this app. If you use Asynchronous programming, the result type is a read-only list/vector of WalletItem items. (You can use APIs of IVectorView; for C++ or JavaScript, APIs of IReadOnlyList for .NET.)

See Also

GetItemsAsync(WalletItemKind) GetItemsAsync(WalletItemKind) GetItemsAsync(WalletItemKind) GetItemsAsync(WalletItemKind)

Returns the collection of wallet items of the given type that are owned by this app.

public : IAsyncOperation<IVectorView<WalletItem>> GetItemsAsync(WalletItemKind kind)public IAsyncOperation<IReadOnlyList<WalletItem>> GetItemsAsync(WalletItemKind kind)Public Function GetItemsAsync(kind As WalletItemKind) As IAsyncOperation( Of IReadOnlyListWalletItem )// You can use this method in JavaScript.
Parameters
kind
WalletItemKind WalletItemKind WalletItemKind WalletItemKind

The type of wallet item to retrieve.

Returns
IAsyncOperation<IVectorView<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>> IAsyncOperation<IReadOnlyList<WalletItem>>

An asynchronous operation that, on successful completion, returns the collection of wallet items of the specified type that are accessible by this app. If you use Asynchronous programming, the result type is a read-only list/vector of WalletItem items. (You can use APIs of IVectorView; for C++ or JavaScript, APIs of IReadOnlyList for .NET.)

See Also

GetWalletItemAsync(String) GetWalletItemAsync(String) GetWalletItemAsync(String) GetWalletItemAsync(String)

Gets an individual wallet item with the given ID from the wallet database. The item requested must be owned by this app.

public : IAsyncOperation<WalletItem> GetWalletItemAsync(PlatForm::String id)public IAsyncOperation<WalletItem> GetWalletItemAsync(String id)Public Function GetWalletItemAsync(id As String) As IAsyncOperation( Of WalletItem )// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The ID of the wallet item.

Returns

An asynchronous operation that, on successful completion, returns the wallet item with the specified ID that is owned by this app. If you use Asynchronous programming, the result type is a single WalletItem. If an item with the specified ID cannot be found for this app in the current WalletItemStore or if the item isn't owned by this app, the result is null.

See Also

ImportItemAsync(IRandomAccessStreamReference) ImportItemAsync(IRandomAccessStreamReference) ImportItemAsync(IRandomAccessStreamReference) ImportItemAsync(IRandomAccessStreamReference)

Imports data from a ".mswallet" XML file into the wallet store.".mswallet" is an XML serialization format for wallet item info. For a guide to the ".mswallet" format (and a link to schema in XSD), see Quickstart: Creating and distributing .mswallet files.

public : IAsyncOperation<WalletItem> ImportItemAsync(IRandomAccessStreamReference stream)public IAsyncOperation<WalletItem> ImportItemAsync(IRandomAccessStreamReference stream)Public Function ImportItemAsync(stream As IRandomAccessStreamReference) As IAsyncOperation( Of WalletItem )// You can use this method in JavaScript.
Parameters
Returns

An asynchronous operation that, on successful completion, returns the wallet item that was imported into the wallet. If you use Asynchronous programming, the result type on successful completion is a single WalletItem.

See Also

ShowAsync() ShowAsync() ShowAsync() ShowAsync()

Displays the Wallet UI.

public : IAsyncAction ShowAsync()public IAsyncAction ShowAsync()Public Function ShowAsync() As IAsyncAction// You can use this method in JavaScript.
Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

See Also

ShowAsync(String) ShowAsync(String) ShowAsync(String) ShowAsync(String)

Displays the item with the given ID in the Wallet UI.

public : IAsyncAction ShowAsync(PlatForm::String id)public IAsyncAction ShowAsync(String id)Public Function ShowAsync(id As String) As IAsyncAction// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The ID of the item to display.

Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

See Also

UpdateAsync(WalletItem) UpdateAsync(WalletItem) UpdateAsync(WalletItem) UpdateAsync(WalletItem)

Updates a wallet item in the shared store, based on the changed values in the WalletItem object provided.

public : IAsyncAction UpdateAsync(WalletItem item)public IAsyncAction UpdateAsync(WalletItem item)Public Function UpdateAsync(item As WalletItem) As IAsyncAction// You can use this method in JavaScript.
Parameters
item
WalletItem WalletItem WalletItem WalletItem

The updated data for the wallet item.

Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

Remarks

An exception is thrown if the item doesn't already exist in the wallet. How to handle errors/exceptions varies by programming language, particularly so when calling asynchronous methods. See Asynchronous programming.

Most of the APIs for this class can be seen in example usages in the Quickstart: Using the APIs topic.

See Also

See Also