X-Git-Url: https://git.ucc.asn.au/?p=uccvend-vendserver.git;a=blobdiff_plain;f=VendServer%2FDispenseInterface.py;fp=VendServer%2FDispenseInterface.py;h=94b23674d5f186906736b8b194bb220d8c929308;hp=7af3653f2b1f90901062453070f6d1f810d44568;hb=a0c785ac1d572b82cb214a61e62d8443b3927e7c;hpb=408301a90eee6116aefdd39ead7d9365a22f4a2d diff --git a/VendServer/DispenseInterface.py b/VendServer/DispenseInterface.py index 7af3653..94b2367 100644 --- a/VendServer/DispenseInterface.py +++ b/VendServer/DispenseInterface.py @@ -10,67 +10,82 @@ class DispenseInterface(object): """ Create a new dispense object. + @param username The username to connect to dispense with + @param secret The secret to use for Auth """ - def __init__(self, username=None, loggedIn=False, disabled=False): + def __init__(self, username=None, secret=None): pass """ Create a new dispense interface as the supplied user. + @param username The userid of the person authing to dispense + @param pin Thier pin """ - @staticmethod - def authUsernamePin(username, pin): + def authUsernamePin(self, userId, pin): pass """ Create a new dispense interface as the supplied user. + @param cardId The card that someone is connecting to Dispense with """ - @staticmethod - def authMifare(cardId): + def authMifare(self, cardId): pass """ Add a MIFARE card for this user + @param cardId Card to add to a user account + @return 1 if added successfully, anything else otherwise """ def addCard(self, cardId): pass """ Check if creating the user worked correctly. + @return True if currently logged in as a user, false otherwise """ def isLoggedIn(self): pass """ - Get the users username. + Get the current users username. + @return The username of the current user. An empty string if not currently logged in. """ - def getUsername(self, user): + def getUsername(self): pass """ - Get the users current balance. + Get the current users balance. + @return the users balance. None if not logged in. """ - def getBalance(self, user): + def getBalance(self): pass """ Get the name and price of an item. - itemId is the number entered into the vending machine + @param itemId The number entered into the vending machine + @return (itemname, price) """ - @staticmethod def getItemInfo(itemId): pass """ Check if the user is disabled. + @return True if the user is disabled """ def isDisabled(self): pass """ Dispense an item for the current user. - itemId is the number entered into the vending machine + @param itemId The number entered into the vending machine """ def dispenseItem(self, itemId): pass + """ + Log the current user out + """ + def logOut(self): + pass +