X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=VendServer%2FDispenseInterface.py;h=94b23674d5f186906736b8b194bb220d8c929308;hb=416c876713175e18280d86a427b29d941611828e;hp=81a3f06b03d5f92ae5bf9b721da47f8537d555a6;hpb=ed50c28e02f4be810b2a492717904ec8cd5a4970;p=uccvend-vendserver.git diff --git a/VendServer/DispenseInterface.py b/VendServer/DispenseInterface.py index 81a3f06..94b2367 100644 --- a/VendServer/DispenseInterface.py +++ b/VendServer/DispenseInterface.py @@ -10,61 +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 +