The following sample transfers funds from a parent account to one of its child accounts. The transferMoney method can also transfer funds from a child account to its parent account. For the sample below, it is assumed that the following already exist:
•a parent account which is active and has money already allocated to it, where the record's unique key is a String equal to parentUniqueKey
•a child account for the parent which is active, where the record's unique key is a String equal to childUniqueKey
protected AccountRepository accountRepository;
//the third parameter is the monetary amount to transfer between the parent and child account; the fourth parameter is a String description of the transfer transaction
accountRepository.transferMoney(parentUniqueKey, childUniqueKey, new BigDecimal("3333.00"), "money transferred through Web Services");