WebhookController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace SanderVanHooft\PayableRedirect\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\Controller;
7
use SanderVanHooft\PayableRedirect\Payment;
8
9
class WebhookController extends Controller
10
{
11
12
    public function handle(Request $request)
13
    {
14
        $payment = Payment::where('gateway_payment_reference', $request->id)->firstOrFail();
15
        $paymentGateway = new $payment->gateway_name;
16
        $paymentGateway->fetchUpdateFor($payment);
17
        return response()->json(null, 200);
18
    }
19
}
20