def send_money(self): # Send Another User Some Money menu_text = "CON You can only send 1 shilling.\n" menu_text += " Enter a valid phonenumber (like 0722122122)\n" # Update sessions to level 11 update_session(self.session_id, SessionLevel, 11) # Print the response onto the page so that our gateway can read it return respond(menu_text)
def deposit(self): # as how much and Launch teh Mpesa Checkout to the user menu_text = "CON How much are you depositing?\n" menu_text += " 1. 1 Shilling.\n" menu_text += " 2. 2 Shillings.\n" menu_text += " 3. 3 Shillings.\n" # Update sessions to level 9 update_session(self.session_id, SessionLevel, 9) # print the response on to the page so that our gateway can read it return respond(menu_text)
def withdraw(self): # Ask how much and Launch B2C to the user menu_text = "CON How much are you withdrawing?\n" menu_text += " 1. 1 Shilling.\n" menu_text += " 2. 2 Shillings.\n" menu_text += " 3. 3 Shillings.\n" # Update sessions to level 10 update_session(self.session_id, SessionLevel, 10) # Print the response onto the page so that our gateway can read it return respond(menu_text)
def login(): if robin_2FA != "": robinOTP = pyotp.TOTP(robin_2FA).now() login_ticket = rs.login(username=robin_user, password=robin_pass, expiresIn=86400, mfa_code=robinOTP) else: login_ticket = rs.login(username=robin_user, password=robin_pass, expiresIn=86400, by_sms=True) #End else logging.debug(f'Login ticket is \n {login_ticket}') utils.update_session( 'Authorization', '{0} {1}'.format(login_ticket['token_type'], login_ticket['access_token']))