2021-05-17 06:02:43 +02:00
|
|
|
<?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://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2021-05-17 10:56:14 +02:00
|
|
|
use App\Jobs\Util\ImportStripeCustomers;
|
2021-05-17 06:02:43 +02:00
|
|
|
use App\Jobs\Util\StripeUpdatePaymentMethods;
|
|
|
|
|
|
|
|
class StripeController extends BaseController
|
|
|
|
{
|
|
|
|
|
|
|
|
public function update()
|
|
|
|
{
|
|
|
|
if(auth()->user()->isAdmin())
|
|
|
|
{
|
|
|
|
|
|
|
|
StripeUpdatePaymentMethods::dispatch(auth()->user()->getCompany());
|
|
|
|
|
|
|
|
return response()->json(['message' => 'Processing'], 403);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-17 10:56:14 +02:00
|
|
|
return response()->json(['message' => 'Unauthorized'], 403);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function import()
|
|
|
|
{
|
|
|
|
|
|
|
|
if(auth()->user()->isAdmin())
|
|
|
|
{
|
|
|
|
|
|
|
|
ImportStripeCustomers::dispatch(auth()->user()->getCompany());
|
|
|
|
|
|
|
|
return response()->json(['message' => 'Processing'], 403);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-17 06:02:43 +02:00
|
|
|
return response()->json(['message' => 'Unauthorized'], 403);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|