IOPNController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A orderStatus() 0 15 3
1
<?php
2
3
namespace bSecure\Payments\Controllers\Orders;
4
5
use App\Http\Controllers\Controller;
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
8
//Models
9
use bSecure\Payments\Models\Order;
10
11
//Helper
12
use bSecure\Payments\Helpers\AppException;
0 ignored issues
show
Bug introduced by
The type bSecure\Payments\Helpers\AppException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use bSecure\Payments\Helpers\ApiResponseHandler;
14
15
//Facade
16
use Validator;
0 ignored issues
show
Bug introduced by
The type Validator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
//Instant Order Processing Notification
19
class IOPNController extends Controller
20
{
21
22
    /**
23
     * Author: Sara Hasan
24
     * Date: 26-November-2020
25
     */
26
    public function orderStatus($order_ref)
27
    {
28
        try {
29
            $orderResponse = Order::getOrderStatus($order_ref);
30
31
            if($orderResponse['error'])
32
            {
33
                return ApiResponseHandler::failure($orderResponse['message'],$orderResponse['exception']);
34
            }else{
35
                $response = $orderResponse['body'];
36
37
                return ApiResponseHandler::success($response, trans('bSecurePayments::messages.order.status.success'));
0 ignored issues
show
Bug introduced by
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
                return ApiResponseHandler::success($response, /** @scrutinizer ignore-call */ trans('bSecurePayments::messages.order.status.success'));
Loading history...
38
            }
39
        } catch (\Exception $e) {
40
            return ApiResponseHandler::failure(trans('bSecurePayments::messages.order.status.failure'), $e->getTraceAsString());
41
        }
42
    }
43
}
44