Some fixes for #1378

This commit is contained in:
James Cole
2018-04-25 16:01:51 +02:00
parent 2e1a777811
commit 490c817fc1
3 changed files with 12 additions and 2 deletions

View File

@@ -798,6 +798,7 @@ class BunqRoutine implements RoutineInterface
$mapping = $config['accounts-mapped'];
$token = new SessionToken($config['session_token']);
$count = 0;
$all = [];
if (0 === $user->getId()) {
$user = new UserCompany($config['user_company']);
Log::debug(sprintf('Will try to get transactions for company #%d', $user->getId()));
@@ -826,7 +827,7 @@ class BunqRoutine implements RoutineInterface
'import_id' => $importId,
'payments' => $payments,
];
$count += count($payments);
$count += \count($payments);
}
Log::debug(sprintf('Total number of payments: %d', $count));
$this->addStep();

View File

@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Bunq\Request;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Services\Bunq\Id\InstallationId;
use FireflyIII\Services\Bunq\Object\ServerPublicKey;
use FireflyIII\Services\Bunq\Token\InstallationToken;
@@ -96,12 +97,19 @@ class InstallationTokenRequest extends BunqRequest
* @param array $response
*
* @return InstallationId
* @throws FireflyException
*/
private function extractInstallationId(array $response): InstallationId
{
$installationId = new InstallationId;
$data = $this->getKeyFromResponse('Id', $response);
$installationId->setId((int)$data['id']);
if (!isset($data['id'])) {
Log::error('No installation token in bunq response.', $response);
throw new FireflyException('There is no installation token in the bunq response. Sorry, I cannot continue.');
}
$installationId->setId($data['id']);
return $installationId;
}

View File

@@ -583,6 +583,7 @@ return [
'converted_to_Deposit' => 'The transaction has been converted to a deposit',
'converted_to_Transfer' => 'The transaction has been converted to a transfer',
'invalid_convert_selection' => 'The account you have selected is already used in this transaction or does not exist.',
'source_or_dest_invalid' => 'Cannot find the correct transaction details. Conversion is not possible.',
// create new stuff:
'create_new_withdrawal' => 'Create new withdrawal',