Make sure ff does not create accounts when balance is said to be 0.

This commit is contained in:
James Cole 2016-11-25 16:26:03 +01:00
parent 6eeb60db5c
commit 7852b8a785

View File

@ -78,14 +78,16 @@ class NewUserController extends Controller
$this->createAssetAccount($request, $repository);
// create savings account
if (strlen($request->get('savings_balance')) > 0) {
$savingBalance = strval($request->get('savings_balance')) === '' ? '0' : strval($request->get('savings_balance'));
if (bccomp($savingBalance, '0') !== 0) {
$this->createSavingsAccount($request, $repository);
$count++;
}
// create credit card.
if (strlen($request->get('credit_card_limit')) > 0) {
$limit = strval($request->get('credit_card_limit')) === '' ? '0' : strval($request->get('credit_card_limit'));
if (bccomp($limit, '0') !== 0) {
$this->storeCreditCard($request, $repository);
$count++;
}