2020-06-27 15:53:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-06-27 15:53:12 +02:00
|
|
|
*
|
|
|
|
* @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');
|
|
|
|
}
|
|
|
|
|
2020-12-07 14:49:30 +01:00
|
|
|
public function __invoke(PaymentWebhookRequest $request, string $gateway_key, string $company_key)
|
2020-06-27 15:53:12 +02:00
|
|
|
{
|
2020-12-07 14:49:30 +01:00
|
|
|
return $request->getCompanyGateway()
|
|
|
|
->driver($request->getClient())
|
|
|
|
->processWebhookRequest($request, $request->getPayment());
|
2020-06-27 15:53:12 +02:00
|
|
|
}
|
|
|
|
}
|