mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Bank integration
This commit is contained in:
parent
67494e691b
commit
5a2a2cce4a
@ -154,7 +154,6 @@ class Yodlee
|
||||
$at = new AccountTransformer();
|
||||
nlog($response->object());
|
||||
return $at->transform($response->object());
|
||||
// return $response->object();
|
||||
}
|
||||
|
||||
if($response->failed())
|
||||
|
@ -66,4 +66,18 @@ class YodleeController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function refreshAccounts(YodleeAdminRequest $request)
|
||||
{
|
||||
|
||||
$token = auth()->user()->account->bank_integration_account_id;
|
||||
|
||||
if(!$token)
|
||||
return response()->json(['message' => 'No bank integrations are present. Please add a bank account. '],400);
|
||||
|
||||
$yodlee = new Yodlee($token);
|
||||
$yodlee->setTestMode();
|
||||
|
||||
$yodlee->getAccounts();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,23 +40,23 @@ class BankIntegrationTransformer extends EntityTransformer
|
||||
];
|
||||
|
||||
/**
|
||||
* @param Account $bank_integration
|
||||
*
|
||||
*
|
||||
* @param BankIntegration $bank_integration
|
||||
* @return array
|
||||
*/
|
||||
public function transform(BankIntegration $bank_integration)
|
||||
{
|
||||
return [
|
||||
'id' => (string) $this->encodePrimaryKey($bank_integration->id),
|
||||
'provider_bank_name' => $bank_integration->provider_bank_name ?: '',
|
||||
'bank_account_id' => $bank_integration->bank_account_id ?: '',
|
||||
'bank_account_name' => $bank_integration->bank_account_name ?: '',
|
||||
'bank_account_number' => $bank_integration->bank_account_number ?: '',
|
||||
'bank_account_status' => $bank_integration->bank_account_status ?: '',
|
||||
'bank_account_type' => $bank_integration->bank_account_type ?: '',
|
||||
'provider_bank_name' => (string)$bank_integration->provider_bank_name ?: '',
|
||||
'provider_id' => (int) $bank_integration->provider_id ?: 0,
|
||||
'bank_account_id' => (int) $bank_integration->bank_account_id ?: 0,
|
||||
'bank_account_name' => (string) $bank_integration->bank_account_name ?: '',
|
||||
'bank_account_number' => (string) $bank_integration->bank_account_number ?: '',
|
||||
'bank_account_status' => (string)$bank_integration->bank_account_status ?: '',
|
||||
'bank_account_type' => (string)$bank_integration->bank_account_type ?: '',
|
||||
'balance' => (float)$bank_integration->balance ?: 0,
|
||||
'currency' => $bank_integration->currency ?: '',
|
||||
'currency' => (string)$bank_integration->currency ?: '',
|
||||
'nickname' => (string)$bank_integration->nickname ?: '',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -21,13 +21,17 @@ return new class extends Migration
|
||||
$table->unsignedInteger('user_id');
|
||||
|
||||
$table->text('provider_bank_name'); //providerName ie Chase
|
||||
$table->bigInteger('bank_account_id'); //id
|
||||
$table->bigUnsignedInteger('provider_id'); //id of the bank
|
||||
$table->bigUnsignedInteger('bank_account_id'); //id
|
||||
$table->text('bank_account_name')->nullable(); //accountName
|
||||
$table->text('bank_account_number')->nullable(); //accountNumber
|
||||
$table->text('bank_account_status')->nullable(); //accountStatus
|
||||
$table->text('bank_account_type')->nullable(); //CONTAINER
|
||||
$table->decimal('balance', 20, 6)->default(0); //currentBalance.amount
|
||||
$table->text('currency')->nullable(); //currentBalance.currency
|
||||
$table->text('nickname')->default(''); //accountName
|
||||
|
||||
$table->boolean('is_deleted')->default(0);
|
||||
|
||||
$table->timestamps(6);
|
||||
$table->softDeletes('deleted_at', 6);
|
||||
|
Loading…
Reference in New Issue
Block a user