1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Show previously selected credit cards

This commit is contained in:
aggepagge 2014-06-30 00:11:31 +02:00
parent 92fdf49c10
commit df89ed41a8

View File

@ -102,11 +102,13 @@ class AccountController extends \BaseController {
$accountGateway = null;
$config = null;
$configFields = null;
$selectedCards = 0;
if (count($account->account_gateways) > 0)
{
$accountGateway = $account->account_gateways[0];
$config = $accountGateway->config;
$selectedCards = $accountGateway->accepted_credit_cards;
$configFields = json_decode($config);
@ -137,8 +139,14 @@ class AccountController extends \BaseController {
$creditCards = [];
foreach($creditCardsArray as $card => $name)
{
$creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card'])];
if($selectedCards > 0 && ($selectedCards & $card) == $card)
$creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card']), 'checked' => 'checked'];
else
$creditCards[$name['text']] = ['value' => $card, 'data-imageUrl' => asset($name['card'])];
}
//var_dump($creditCards);
// exit;
$otherItem = array(
'value' => 1000000,