Add a transfer capability and implante it in bp and boobank

Make a transfer in boobank like that:

>transfer fromaccountid toaccoundid amount

Signed-off-by: Nicolas Duhamel <nicolas@jombi.fr>
Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Nicolas Duhamel 2010-09-24 18:07:06 +02:00 committed by Romain Bignon
commit 81706f23ad
4 changed files with 59 additions and 1 deletions

View file

@ -2,7 +2,7 @@
#
# backend.py
#
# Copyright 2010 nicolas <nicolas@NicolasDesktop>
# Copyright 2010 nicolas <nicolas@jombi.fr>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -52,3 +52,15 @@ class BPBackend(BaseBackend, ICapBank):
for history in self.browser.get_history(account):
yield history
def transfer(self, id_from, id_to, amount):
from_account = self.get_account(id_from)
to_account = self.get_account(id_to)
#TODO: retourner le numero du virement
self.browser.make_transfer(from_account, to_account, amount)