mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for Stripe Connect
This commit is contained in:
parent
300cc9fb9e
commit
90d786211c
@ -32,7 +32,8 @@ class StripeConnectController extends BaseController
|
|||||||
// Should we check if company has set country in the ap? Otherwise this will fail.
|
// Should we check if company has set country in the ap? Otherwise this will fail.
|
||||||
|
|
||||||
if(!is_array($request->getTokenContent()))
|
if(!is_array($request->getTokenContent()))
|
||||||
throw new \Exception('Invalid token');
|
abort(400, 'Invalid token');
|
||||||
|
|
||||||
|
|
||||||
MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
|
MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ class StripeConnectController extends BaseController
|
|||||||
|
|
||||||
$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()->id);
|
||||||
|
|
||||||
$company_gateway->fill([
|
$company_gateway->fill([
|
||||||
'gateway_key' => 'd14dd26a47cecc30fdd65700bfb67b34',
|
'gateway_key' => 'd14dd26a47cecc30fdd65700bfb67b34',
|
||||||
|
@ -14,6 +14,7 @@ namespace App\Http\Requests\StripeConnect;
|
|||||||
|
|
||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ class InitializeStripeConnectRequest extends FormRequest
|
|||||||
|
|
||||||
public function getContact()
|
public function getContact()
|
||||||
{
|
{
|
||||||
return ClientContact::findOrFail($this->getTokenContent()['user_id']);
|
return User::findOrFail($this->getTokenContent()['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany()
|
public function getCompany()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user