mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 19:14:35 -04:00
wip
This commit is contained in:
parent
255d25d6a6
commit
75da6df4fa
@ -36,19 +36,28 @@ class StripeConnectController extends BaseController
|
|||||||
'country' => $request->getCompany()->country()->iso_3166_2,
|
'country' => $request->getCompany()->country()->iso_3166_2,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$exists = CompanyGateway::query()
|
||||||
|
->where('gateway_key', 'd14dd26a47cecc30fdd65700bfb67b34')
|
||||||
|
->where('company_id', $request->getCompany()->id)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($exists) {
|
||||||
|
return redirect()->route('stripe_connect.return');
|
||||||
|
}
|
||||||
|
|
||||||
$account = Account::create($data);
|
$account = Account::create($data);
|
||||||
|
|
||||||
$link = Account::link($account->id, $token);
|
$link = Account::link($account->id, $token);
|
||||||
|
|
||||||
// $company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->client->user->id);
|
$company_gateway = CompanyGatewayFactory::create($request->getCompany()->id, $request->getContact()->client->user->id);
|
||||||
//
|
|
||||||
// $company_gateway->fill([
|
$company_gateway->fill([
|
||||||
// 'gateway_key' => 'provide-valid-stripe-key-here',
|
'gateway_key' => 'd14dd26a47cecc30fdd65700bfb67b34',
|
||||||
// 'fees_and_limits' => [],
|
'fees_and_limits' => [],
|
||||||
// 'config' => encrypt(json_encode(['account_id' => $account->id]))
|
'config' => encrypt(json_encode(['account_id' => $account->id]))
|
||||||
// ]);
|
]);
|
||||||
//
|
|
||||||
// $company_gateway->save();
|
$company_gateway->save();
|
||||||
|
|
||||||
return redirect($link['url']);
|
return redirect($link['url']);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user