Browse Source

Refactor withdrawMoney

remotes/origin/Alpha
fdlt3817 2 years ago
parent
commit
635efaadf2
  1. 9
      src/withdrawMoney.c

9
src/withdrawMoney.c

@ -81,22 +81,21 @@ bool withdraw(int user_id) {
bool withdrawSpecificAmount(int user_id, float amountToWithdraw) {
float remainingAccountBalance;
float availableAccountBalance = getAvailableAccountBalance(user_id);
if (amountToWithdraw > 0) {
if (amountToWithdraw > 0) {
if (amountToWithdraw <= availableAccountBalance) {
remainingAccountBalance = initiateWithdraw(amountToWithdraw, availableAccountBalance);
if(updateAvailableAccountBalance(user_id, remainingAccountBalance)){
if (updateAvailableAccountBalance(user_id, remainingAccountBalance)) {
return true;
}
}
}
return false;
}
// int main(){
// withdraw(1234);
// return 1;
Loading…
Cancel
Save