mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
store organisation_id as part of settings
This commit is contained in:
parent
a7d086a4a5
commit
758e6d92f0
@ -77,6 +77,8 @@ class GoCardlessOAuthController extends Controller
|
|||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
return view('auth.gocardless_connect.access_denied');
|
return view('auth.gocardless_connect.access_denied');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$response = $response->json();
|
||||||
|
|
||||||
$company_gateway = CompanyGateway::query()
|
$company_gateway = CompanyGateway::query()
|
||||||
->where('gateway_key', 'b9886f9257f0c6ee7c302f1c74475f6c')
|
->where('gateway_key', 'b9886f9257f0c6ee7c302f1c74475f6c')
|
||||||
@ -92,8 +94,6 @@ class GoCardlessOAuthController extends Controller
|
|||||||
$company_gateway->setConfig([]);
|
$company_gateway->setConfig([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = $response->json();
|
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'__current' => $company_gateway->getConfig(),
|
'__current' => $company_gateway->getConfig(),
|
||||||
'account_id' => $response['organisation_id'],
|
'account_id' => $response['organisation_id'],
|
||||||
@ -105,6 +105,11 @@ class GoCardlessOAuthController extends Controller
|
|||||||
'oauth2' => true,
|
'oauth2' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$settings = new \stdClass();
|
||||||
|
$settings->organisation_id = $response['organisation_id'];
|
||||||
|
|
||||||
|
$company_gateway->setSettings($settings);
|
||||||
|
|
||||||
$company_gateway->setConfig($payload);
|
$company_gateway->setConfig($payload);
|
||||||
$company_gateway->save();
|
$company_gateway->save();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user