Create Method



 
The Create method creates an account.


Syntax

    [long=] SiteCafe.Server.Accounts.Create(mode, expiryDate, vDuration,
            eDuration, amount, duration, paid, persistent)
    
Parameters
    mode Long value that specifies the payment mode.
    expiryDate Long value that specifies the expiry date (0 = never).
    vDuration Long value that specifies the number of seconds the account will be valid after the activation (first login).
    eDuration Long value that specifies the expiry duration. When the account is logged out for this contiguous period of time, it expires (0 = never).
    amount Currency value that specifies the amount (mode 1).
    duration Long value that specifies the surftime (mode 3).
    paid Boolean value that specifies whether payment occurred.
    persistent Long value that specifies whether the account is persistent.
Return Value
    Returns a Long value containing the account index.
Remarks
    Dates are specified by the return value of the Date.getVarDate method divided by 1000.
    Durations are a number of seconds.

    Possible payment modes are:

    1 : decrease credit (prepaid)
    3 : decrease remaining time (prepaid)
    4 : increase time (payment after surfing)

    Use the CurrencyFormatter object for currency functionality.
Examples
    The following example creates a new persistent account that decreases credit and does not expire.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    accID = SiteCafe.Server.Accounts.Create(1, 0, 0, 0, 5, 0, true, true);
    </SCRIPT>
    

Applies to
    SiteKiosk v6.2 (and later versions).

Back to top