def handler(event, context): amount = json.loads(event['body']) new_balance = DBHelper.update_balance(amount["amount"], credit=True) transaction = DBHelper.deposit(credit=amount["amount"], balance=new_balance) print("Transaction: {0}".format(transaction)) return {"statusCode": 200, "body": json.dumps(transaction)}
def post(self): amount = Deposit.parser.parse_args() new_balance = DBHelper.update_balance(amount["amount"], credit=True) transaction = DBHelper.deposit(credit=amount["amount"], balance=new_balance) return transaction