1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00
invoiceninja/app/Http/Controllers/PaymentWebhookController.php

34 lines
872 B
PHP
Raw Normal View History

2020-06-27 15:53:12 +02:00
<?php
/**
* 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');
}
public function __invoke(PaymentWebhookRequest $request, string $company_gateway_id, string $company_key)
2020-06-27 15:53:12 +02:00
{
2020-12-16 15:25:42 +01:00
$payment = $request->getPayment();
$client = is_null($payment) ? $request->getClient() : $payment->client;
2020-12-16 15:25:42 +01:00
return $request->getCompanyGateway()
->driver($client)
2020-12-16 15:25:42 +01:00
->processWebhookRequest($request, $payment);
2020-06-27 15:53:12 +02:00
}
}