Previous Topic: SetCurrentCardByIndex()Next Topic: AddCurrentCardToWallet()


SetCurrentWalletFromEncoding()

Sets the current wallet to be the wallet passed in as a string parameter. This function is typically called before calling AddCurrentCardToWallet() during a roaming download.

Note: This is a deprecated function use ImportArcotID() instead.

Syntax

boolean SetCurrentWalletFromEncoding(walletEncoding)

Parameters

The following are the parameters of this method:

Parameter

Type

Description

walletEncoding

string

A base-64 encoded string of the wallet you wish to set.

Returns

If the method is successful, then it returns TRUE. If the method is unsuccessful, then it returns FALSE.

Example

var arcotClient = new ArcotClient();
var walletnameString = "GuestUser";
var b64walletString  = "MII0yAIBAAwHY3Rnb29kMTCCNDcwgjQzAgEBDAR
                        jYXJkoIHFMB8GCmCGSAGG+UYJAQEwEQQAAgEBAg
                        ILAgICAegCAgMYBIGhMIGeAgEAMA4GCmCGSA GG+
                   UYJAgAFAASBiDCBhQJBAMzNUdGcaBZsiAt/88Dk9... ";

// Wallet will be saved to either hard disk or USB
arcotClient.SetAttribute("WalletInMemory", false);

// Set the current wallet
arcotClient.SetCurrentWalletFromEncoding(b64walletString);

// Set the card at index 0 as the current (and only) card in the wallet
var returnValue = arcotClient.SetCurrentCardByIndex(0);
if (returnValue)
{
    if (arcotClient.AddCurrentCardToWallet(walletnameString))
    {
        document.write("<P>Card added to wallet successfully</P>");
    }
    else
    {
        document.write("<P>Failed to add card to wallet</P>");
    }
}