mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Cleanup PaymentWebhookController
This commit is contained in:
parent
a3965c3d65
commit
99d686a845
@ -13,26 +13,14 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Payments\PaymentWebhookRequest;
|
||||
use App\Libraries\MultiDB;
|
||||
use Auth;
|
||||
|
||||
class PaymentWebhookController extends Controller
|
||||
{
|
||||
public function __invoke(PaymentWebhookRequest $request, string $company_key, string $company_gateway_id)
|
||||
public function __invoke(PaymentWebhookRequest $request)
|
||||
{
|
||||
|
||||
$payment = $request->getPayment();
|
||||
|
||||
if(!$payment)
|
||||
return response()->json(['message' => 'Payment record not found.'], 400);
|
||||
|
||||
$client = is_null($payment) ? $request->getClient() : $payment->client;
|
||||
|
||||
if(!$client)
|
||||
return response()->json(['message' => 'Client record not found.'], 400);
|
||||
|
||||
return $request->getCompanyGateway()
|
||||
->driver($client)
|
||||
->processWebhookRequest($request, $payment);
|
||||
return $request
|
||||
->getCompanyGateway()
|
||||
->driver()
|
||||
->processWebhookRequest($request);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user