Beispiel #1
0
    def deposit(self, amount, name="self"):

        target_name = name if name != "self" else self.logged_user

        original_balance = pymysql_lib.get_balance(target_name)[0]['balance']
        bal = int(original_balance) + amount

        pymysql_lib.alter_balance(target_name, bal)
        pymysql_lib.transaction_log(name, amount, 'none', 1)
        print("Deposit Successfull...!")
Beispiel #2
0
    def withdraw(self, amount, name="self", comment="none", should_log=True):

        target_name = name if name != "self" else self.logged_user

        original_balance = pymysql_lib.get_balance(target_name)[0]['balance']
        bal = int(original_balance) - amount

        pymysql_lib.alter_balance(target_name, bal)

        if should_log:
            pymysql_lib.create_log(target_name,
                                   target_name,
                                   amount,
                                   comment,
                                   type='withdrawal')

        print("withdrawal Successfull...!")
Beispiel #3
0
    def deposit(self, amount, name="self", comment='none', should_log=True):

        target_name = name if name != "self" else self.logged_user

        original_balance = pymysql_lib.get_balance(target_name)[0]['balance']
        bal = int(original_balance) + amount

        pymysql_lib.alter_balance(target_name, bal)

        if should_log:

            pymysql_lib.create_log(target_name,
                                   target_name,
                                   amount,
                                   comment,
                                   type='deposit')

        print("Deposit Successfull...!")