mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 19:04:33 -04:00
Fixes for Stripe Connect
This commit is contained in:
parent
cd694869af
commit
815878be5c
@ -43,19 +43,25 @@ class StripeConnectController extends BaseController
|
|||||||
'country' => $request->getCompany()->country()->iso_3166_2,
|
'country' => $request->getCompany()->country()->iso_3166_2,
|
||||||
];
|
];
|
||||||
|
|
||||||
$exists = CompanyGateway::query()
|
$company_gateway = CompanyGateway::query()
|
||||||
->where('gateway_key', 'd14dd26a47cecc30fdd65700bfb67b34')
|
->where('gateway_key', 'd14dd26a47cecc30fdd65700bfb67b34')
|
||||||
->where('company_id', $request->getCompany()->id)
|
->where('company_id', $request->getCompany()->id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($exists) {
|
if ($company_gateway) {
|
||||||
|
|
||||||
|
$config = decrypt($company_gateway->config);
|
||||||
|
|
||||||
|
if(property_exists($config, 'account_id'))
|
||||||
return render('gateways.stripe.connect.existing');
|
return render('gateways.stripe.connect.existing');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$account = Account::create($data);
|
$account = Account::create($data);
|
||||||
|
|
||||||
$link = Account::link($account->id, $token);
|
$link = Account::link($account->id, $token);
|
||||||
|
|
||||||
|
if(!$company_gateway)
|
||||||
$company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->id);
|
$company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->id);
|
||||||
|
|
||||||
$company_gateway->fill([
|
$company_gateway->fill([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user