APO-1 Add transfer allowance
This commit is contained in:
parent
37fb598867
commit
5a06fac6a6
@ -82,9 +82,13 @@ def TransferMoney(accountFrom, accountTo, amount):
|
|||||||
if amount > accountFrom.credit:
|
if amount > accountFrom.credit:
|
||||||
print("You dont't have enough money on your account")
|
print("You dont't have enough money on your account")
|
||||||
return 0
|
return 0
|
||||||
accountFrom.subCredit(amount)
|
if accountTo.acceptTransfers:
|
||||||
accountTo.addCredit(amount)
|
accountFrom.subCredit(amount)
|
||||||
return 1
|
accountTo.addCredit(amount)
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
print("Reciever do not allow transfers")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user