1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Http/Controllers/PaymentNotificationWebhookController.php

36 lines
1.0 KiB
PHP
Raw Normal View History

2021-07-05 00:59:52 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
2021-07-05 00:59:52 +02:00
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Http\Controllers;
use App\Http\Requests\Payments\PaymentNotificationWebhookRequest;
use App\Models\Client;
use App\Models\CompanyGateway;
2021-07-05 02:26:00 +02:00
use App\Utils\Traits\MakesHash;
2021-07-05 00:59:52 +02:00
class PaymentNotificationWebhookController extends Controller
{
2021-07-05 02:26:00 +02:00
use MakesHash;
2021-07-05 00:59:52 +02:00
public function __invoke(PaymentNotificationWebhookRequest $request, string $company_key, string $company_gateway_id, string $client_hash)
{
2023-08-04 09:12:21 +02:00
/** @var \App\Models\CompanyGateway $company_gateway */
2021-07-05 00:59:52 +02:00
$company_gateway = CompanyGateway::find($this->decodePrimaryKey($company_gateway_id));
$client = Client::find($this->decodePrimaryKey($client_hash));
return $company_gateway
->driver($client)
->processWebhookRequest($request);
}
}