1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fixes for stripe connect

This commit is contained in:
David Bomba 2021-04-22 22:56:00 +10:00
parent bbaecb3c06
commit d6bd19e6c0
4 changed files with 5 additions and 8 deletions

View File

@ -20,7 +20,7 @@ class PaymentWebhookController extends Controller
{
public function __invoke(PaymentWebhookRequest $request, string $company_key, string $company_gateway_id)
{
dd('here');
MultiDB::findAndSetDbByCompanyKey($company_key);
$payment = $request->getPayment();

View File

@ -31,6 +31,9 @@ class StripeConnectController extends BaseController
{
// Should we check if company has set country in the ap? Otherwise this will fail.
if(!is_array($request->getTokenContent()))
throw new \Exception('Invalid token');
MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
$data = [

View File

@ -50,12 +50,6 @@ class InitializeStripeConnectRequest extends FormRequest
{
$data = Cache::get($this->token);
abort_if(!$data, 404);
abort_if(!array_key_exists('user_id', $data), 404);
abort_if(!array_key_exists('company_key', $data), 404);
return $data;
}

View File

@ -195,8 +195,8 @@ Route::get('token_hash_router', 'OneTimeTokenController@router');
Route::get('webcron', 'WebCronController@index');
Route::group(['middleware' => ['locale']], function () {
Route::get('stripe_connect/completed', 'StripeConnectController@completed')->name('stripe_connect.return');
Route::get('stripe_connect/{token}', 'StripeConnectController@initialize')->name('stripe_connect.initialization');
Route::get('stripe_connect/completed', 'StripeConnectController@completed')->name('stripe_connect.return');
});
Route::fallback('BaseController@notFound');