| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function handle($request, Closure $next, string $gateway) |
||
| 28 | { |
||
| 29 | /** @var AbstractGateway $gateway */ |
||
| 30 | $gateway = app('omnipay')->gateway($gateway); |
||
| 31 | |||
| 32 | if (! $gateway->supportsCompletePurchase()) { |
||
| 33 | throw new \InvalidArgumentException('Gateway configured not support complete purchase method!'); |
||
| 34 | } |
||
| 35 | |||
| 36 | try { |
||
| 37 | $response = $gateway->completePurchase()->send(); |
||
|
|
|||
| 38 | } catch (OmnipayException $e) { |
||
| 39 | throw new BadRequestHttpException($e->getMessage()); |
||
| 40 | } |
||
| 41 | |||
| 42 | $request->attributes->set('completePurchaseResponse', $response); |
||
| 43 | |||
| 44 | return $next($request); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.