mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 04:44:33 -04:00
fixes
This commit is contained in:
parent
fab47bd08c
commit
0593a57e5c
@ -15,13 +15,13 @@ namespace App\Helpers\Bank\Nordigen;
|
|||||||
|
|
||||||
use App\Exceptions\NordigenApiException;
|
use App\Exceptions\NordigenApiException;
|
||||||
use App\Helpers\Bank\Nordigen\Transformer\AccountTransformer;
|
use App\Helpers\Bank\Nordigen\Transformer\AccountTransformer;
|
||||||
use App\Helpers\Bank\Nordigen\Transformer\IncomeTransformer;
|
use App\Helpers\Bank\Nordigen\Transformer\TransactionTransformer;
|
||||||
use Log;
|
use Log;
|
||||||
use Nordigen\NordigenPHP\Exceptions\NordigenExceptions\NordigenException;
|
use Nordigen\NordigenPHP\Exceptions\NordigenExceptions\NordigenException;
|
||||||
|
|
||||||
class Nordigen
|
class Nordigen
|
||||||
{
|
{
|
||||||
public bool $test_mode = config('ninja.nordigen.test_mode'); // https://developer.gocardless.com/bank-account-data/sandbox
|
public bool $test_mode; // https://developer.gocardless.com/bank-account-data/sandbox
|
||||||
|
|
||||||
public string $sandbox_institutionId = "SANDBOXFINANCE_SFIN0000";
|
public string $sandbox_institutionId = "SANDBOXFINANCE_SFIN0000";
|
||||||
|
|
||||||
@ -30,6 +30,8 @@ class Nordigen
|
|||||||
public function __construct(string $secret_id, string $secret_key)
|
public function __construct(string $secret_id, string $secret_key)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$this->test_mode = config('ninja.nordigen.test_mode');
|
||||||
|
|
||||||
$this->client = new \Nordigen\NordigenPHP\API\NordigenClient($secret_id, $secret_key);
|
$this->client = new \Nordigen\NordigenPHP\API\NordigenClient($secret_id, $secret_key);
|
||||||
|
|
||||||
$this->client->createAccessToken(); // access_token is valid 24h -> so we dont have to implement a refresh-cycle
|
$this->client->createAccessToken(); // access_token is valid 24h -> so we dont have to implement a refresh-cycle
|
||||||
@ -101,7 +103,7 @@ class Nordigen
|
|||||||
|
|
||||||
$transactionResponse = $this->client->account($accountId)->getAccountTransactions($dateFrom);
|
$transactionResponse = $this->client->account($accountId)->getAccountTransactions($dateFrom);
|
||||||
|
|
||||||
$it = new IncomeTransformer();
|
$it = new TransactionTransformer();
|
||||||
return $it->transform($transactionResponse);
|
return $it->transform($transactionResponse);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,80 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
|
||||||
*
|
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App\Helpers\Bank\Nordigen\Transformer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
"date": "string",
|
|
||||||
"sourceId": "string",
|
|
||||||
"symbol": "string",
|
|
||||||
"cusipNumber": "string",
|
|
||||||
"highLevelCategoryId": 0,
|
|
||||||
"detailCategoryId": 0,
|
|
||||||
"description": {},
|
|
||||||
"memo": "string",
|
|
||||||
"settleDate": "string",
|
|
||||||
"type": "string",
|
|
||||||
"intermediary": [],
|
|
||||||
"baseType": "CREDIT",
|
|
||||||
"categorySource": "SYSTEM",
|
|
||||||
"principal": {},
|
|
||||||
"lastUpdated": "string",
|
|
||||||
"interest": {},
|
|
||||||
"price": {},
|
|
||||||
"commission": {},
|
|
||||||
"id": 0,
|
|
||||||
"merchantType": "string",
|
|
||||||
"amount": {
|
|
||||||
"amount": 0,
|
|
||||||
"convertedAmount": 0,
|
|
||||||
"currency": "USD",
|
|
||||||
"convertedCurrency": "USD"
|
|
||||||
},
|
|
||||||
"checkNumber": "string",
|
|
||||||
"isPhysical": true,
|
|
||||||
"quantity": 0,
|
|
||||||
"valoren": "string",
|
|
||||||
"isManual": true,
|
|
||||||
"merchant": {
|
|
||||||
"website": "string",
|
|
||||||
"address": {},
|
|
||||||
"contact": {},
|
|
||||||
"categoryLabel": [],
|
|
||||||
"coordinates": {},
|
|
||||||
"name": "string",
|
|
||||||
"id": "string",
|
|
||||||
"source": "YODLEE",
|
|
||||||
"logoURL": "string"
|
|
||||||
},
|
|
||||||
"sedol": "string",
|
|
||||||
"transactionDate": "string",
|
|
||||||
"categoryType": "TRANSFER",
|
|
||||||
"accountId": 0,
|
|
||||||
"createdDate": "string",
|
|
||||||
"sourceType": "AGGREGATED",
|
|
||||||
"CONTAINER": "bank",
|
|
||||||
"postDate": "string",
|
|
||||||
"parentCategoryId": 0,
|
|
||||||
"subType": "OVERDRAFT_CHARGE",
|
|
||||||
"category": "string",
|
|
||||||
"runningBalance": {},
|
|
||||||
"categoryId": 0,
|
|
||||||
"holdingDescription": "string",
|
|
||||||
"isin": "string",
|
|
||||||
"status": "POSTED"
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ExpenseTransformer
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ use Log;
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class IncomeTransformer implements BankRevenueInterface
|
class TransactionTransformer implements BankRevenueInterface
|
||||||
{
|
{
|
||||||
use AppSetup;
|
use AppSetup;
|
||||||
|
|
@ -192,7 +192,7 @@ class NordigenController extends BaseController
|
|||||||
$bank_integration->bank_account_name = $nordigen_account['account_name'];
|
$bank_integration->bank_account_name = $nordigen_account['account_name'];
|
||||||
$bank_integration->bank_account_status = $nordigen_account['account_status'];
|
$bank_integration->bank_account_status = $nordigen_account['account_status'];
|
||||||
$bank_integration->bank_account_number = $nordigen_account['account_number'];
|
$bank_integration->bank_account_number = $nordigen_account['account_number'];
|
||||||
$bank_integration->nordigen_provider_id = $nordigen_account['provider_id'];
|
$bank_integration->nordigen_institution_id = $nordigen_account['provider_id'];
|
||||||
$bank_integration->provider_name = $nordigen_account['provider_name'];
|
$bank_integration->provider_name = $nordigen_account['provider_name'];
|
||||||
$bank_integration->nickname = $nordigen_account['nickname'];
|
$bank_integration->nickname = $nordigen_account['nickname'];
|
||||||
$bank_integration->balance = $nordigen_account['current_balance'];
|
$bank_integration->balance = $nordigen_account['current_balance'];
|
||||||
|
@ -32,7 +32,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property int|null $currency
|
* @property int|null $currency
|
||||||
* @property string $nickname
|
* @property string $nickname
|
||||||
* @property string $nordigen_account_id
|
* @property string $nordigen_account_id
|
||||||
* @property string $nordigen_provider_id
|
* @property string $nordigen_institution_id
|
||||||
* @property string|null $from_date
|
* @property string|null $from_date
|
||||||
* @property bool $is_deleted
|
* @property bool $is_deleted
|
||||||
* @property int|null $created_at
|
* @property int|null $created_at
|
||||||
|
@ -17,7 +17,7 @@ return new class extends Migration {
|
|||||||
Schema::table('bank_integrations', function (Blueprint $table) {
|
Schema::table('bank_integrations', function (Blueprint $table) {
|
||||||
$table->string('integration_type')->nullable();
|
$table->string('integration_type')->nullable();
|
||||||
$table->string('nordigen_account_id')->nullable();
|
$table->string('nordigen_account_id')->nullable();
|
||||||
$table->string('nordigen_provider_id')->nullable();
|
$table->string('nordigen_institution_id')->nullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
// migrate old account to be used with yodlee
|
// migrate old account to be used with yodlee
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
const institutionId = institution.getAttribute('data-institution');
|
const institutionId = institution.getAttribute('data-institution');
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
url.searchParams.set('institution_id', institutionId);
|
url.searchParams.set('institution_id', institutionId);
|
||||||
w.location.href = url.href;
|
window.location.href = url.href;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user