mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
payment webhooks wip
This commit is contained in:
parent
0103251534
commit
1b06fb99b1
28
app/Http/Controllers/PaymentWebhookController.php
Normal file
28
app/Http/Controllers/PaymentWebhookController.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
||||
|
||||
class PaymentWebhookController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function __invoke(PaymentWebhookRequest $request, string $company_key, string $gateway_key)
|
||||
{
|
||||
return response([], 200);
|
||||
}
|
||||
}
|
39
app/Http/Requests/Payments/PaymentWebhookRequest.php
Normal file
39
app/Http/Requests/Payments/PaymentWebhookRequest.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Payments;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanyGateway;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PaymentWebhookRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return Company::query()
|
||||
->where('company_key', $this->company_key)
|
||||
->firstOrFail();
|
||||
}
|
||||
|
||||
public function companyGateway()
|
||||
{
|
||||
$company = $this->company();
|
||||
|
||||
return CompanyGateway::query()
|
||||
->where('gateway_key', $this->gateway_key)
|
||||
->where('company_id', $company->id)
|
||||
->firstOrFail();
|
||||
}
|
||||
}
|
@ -157,5 +157,6 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
|
||||
Route::post('support/messages/send', 'Support\Messages\SendingController');
|
||||
});
|
||||
|
||||
Route::match(['get', 'post'], 'payment_webhook/{company_key}/{gateway_key}', 'PaymentWebhookController');
|
||||
|
||||
Route::fallback('BaseController@notFound');
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* Signup Routes
|
||||
*/
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/', 'BaseController@flutterRoute')->middleware('guest');
|
||||
Route::get('setup', 'SetupController@index')->middleware('guest');
|
||||
@ -9,10 +8,6 @@ Route::post('setup/check_db', 'SetupController@checkDB')->middleware('guest');
|
||||
Route::post('setup/check_mail', 'SetupController@checkMail')->middleware('guest');
|
||||
Route::post('setup', 'SetupController@doSetup')->middleware('guest');
|
||||
|
||||
/*
|
||||
* Password Reset Routes...
|
||||
*/
|
||||
|
||||
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
||||
|
Loading…
x
Reference in New Issue
Block a user