mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-15 23:52:33 +01:00
53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
*/
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Jobs\Util\ImportStripeCustomers;
|
|
use App\Jobs\Util\StripeUpdatePaymentMethods;
|
|
|
|
class StripeController extends BaseController
|
|
{
|
|
|
|
public function update()
|
|
{
|
|
if(auth()->user()->isAdmin())
|
|
{
|
|
|
|
StripeUpdatePaymentMethods::dispatch(auth()->user()->company());
|
|
|
|
return response()->json(['message' => 'Processing'], 200);
|
|
|
|
}
|
|
|
|
return response()->json(['message' => 'Unauthorized'], 403);
|
|
}
|
|
|
|
public function import()
|
|
{
|
|
|
|
return response()->json(['message' => 'Processing'], 200);
|
|
|
|
|
|
if(auth()->user()->isAdmin())
|
|
{
|
|
|
|
ImportStripeCustomers::dispatch(auth()->user()->company());
|
|
|
|
return response()->json(['message' => 'Processing'], 200);
|
|
|
|
}
|
|
|
|
return response()->json(['message' => 'Unauthorized'], 403);
|
|
}
|
|
|
|
} |