@@ -27,19 +27,19 @@ discard block |
||
27 | 27 | { |
28 | 28 | try { |
29 | 29 | |
30 | - $validationErrors = $this->_checkForValidationRule( $order_ref ); |
|
30 | + $validationErrors = $this->_checkForValidationRule($order_ref); |
|
31 | 31 | |
32 | - if( count( $validationErrors ) > 0 ) |
|
32 | + if (count($validationErrors) > 0) |
|
33 | 33 | { |
34 | - return ApiResponseHandler::validationError( $validationErrors ); |
|
34 | + return ApiResponseHandler::validationError($validationErrors); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $orderResponse = Order::getOrderStatus($order_ref); |
38 | 38 | |
39 | - if($orderResponse['error']) |
|
39 | + if ($orderResponse['error']) |
|
40 | 40 | { |
41 | 41 | return ApiResponseHandler::failure($orderResponse['message']); |
42 | - }else{ |
|
42 | + } else { |
|
43 | 43 | $response = $orderResponse['body']; |
44 | 44 | |
45 | 45 | return ApiResponseHandler::success($response, trans('bSecure::messages.order.status.success')); |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - private function _checkForValidationRule($order_ref ) |
|
52 | + private function _checkForValidationRule($order_ref) |
|
53 | 53 | { |
54 | 54 | $errors = []; |
55 | 55 | |
56 | 56 | |
57 | - if( empty($order_ref) ) |
|
57 | + if (empty($order_ref)) |
|
58 | 58 | { |
59 | 59 | $errors[] = trans('bSecure::messages.validation.order_ref.required'); |
60 | 60 | } |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | public function verifyCustomer($auth_code) |
24 | 24 | { |
25 | 25 | try { |
26 | - $validationErrors = $this->_checkForValidationRule( $auth_code ); |
|
26 | + $validationErrors = $this->_checkForValidationRule($auth_code); |
|
27 | 27 | |
28 | - if( count( $validationErrors ) > 0 ) |
|
28 | + if (count($validationErrors) > 0) |
|
29 | 29 | { |
30 | - return ApiResponseHandler::validationError( $validationErrors ); |
|
30 | + return ApiResponseHandler::validationError($validationErrors); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $ssoCustomerProfile = $this->createSSOProfileStructure($auth_code); |
34 | 34 | |
35 | 35 | $ssoResponse = Helper::customerProfile($ssoCustomerProfile); |
36 | 36 | |
37 | - if($ssoResponse['error']) |
|
37 | + if ($ssoResponse['error']) |
|
38 | 38 | { |
39 | 39 | return ApiResponseHandler::failure($ssoResponse['message']); |
40 | - }else{ |
|
40 | + } else { |
|
41 | 41 | $response = $ssoResponse['body']; |
42 | 42 | return ApiResponseHandler::success($response, trans('bSecure::messages.customer.verification.success')); |
43 | 43 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $errors = []; |
58 | 58 | |
59 | - if( empty($auth_code) ) |
|
59 | + if (empty($auth_code)) |
|
60 | 60 | { |
61 | 61 | $errors[] = trans('bSecure::messages.validation.auth_code.required'); |
62 | 62 | } |
@@ -21,21 +21,21 @@ discard block |
||
21 | 21 | * Author: Sara Hasan |
22 | 22 | * Date: 26-November-2020 |
23 | 23 | */ |
24 | - public function verifyClient($state,$appType) |
|
24 | + public function verifyClient($state, $appType) |
|
25 | 25 | { |
26 | 26 | try { |
27 | 27 | |
28 | - $validationErrors = $this->_checkForValidationRule( $state ); |
|
28 | + $validationErrors = $this->_checkForValidationRule($state); |
|
29 | 29 | |
30 | - if( count( $validationErrors ) > 0 ) |
|
30 | + if (count($validationErrors) > 0) |
|
31 | 31 | { |
32 | - return ApiResponseHandler::validationError( $validationErrors ); |
|
32 | + return ApiResponseHandler::validationError($validationErrors); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
36 | 36 | $ssoPayload = $this->createSSODataStructure($state); |
37 | 37 | |
38 | - if($appType == Constant::APP_TYPE['checkout']) |
|
38 | + if ($appType == Constant::APP_TYPE['checkout']) |
|
39 | 39 | { |
40 | 40 | $auth_url = $this->_createAuthenticationURL($ssoPayload); |
41 | 41 | $response = [ |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | else if ($appType == Constant::APP_TYPE['sdk']) |
47 | 47 | { |
48 | 48 | $ssoResponse = Helper::verifyClient($ssoPayload); |
49 | - if($ssoResponse['error']) |
|
49 | + if ($ssoResponse['error']) |
|
50 | 50 | { |
51 | 51 | return ApiResponseHandler::failure($ssoResponse['message']); |
52 | - }else{ |
|
52 | + } else { |
|
53 | 53 | $response = $ssoResponse['body']; |
54 | 54 | return ApiResponseHandler::success($response, trans('bSecure::messages.sso_sco.success')); |
55 | 55 | } |
56 | - }else{ |
|
56 | + } else { |
|
57 | 57 | return ApiResponseHandler::failure('Invalid application type', []); |
58 | 58 | } |
59 | 59 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $response_type = $sso_client['response_type']; |
92 | 92 | $state = $sso_client['state']; |
93 | 93 | |
94 | - return $login_app_url.'?scope='.$scope.'&response_type='.$response_type.'&client_id='.$client_id.'&state='.$state; |
|
94 | + return $login_app_url . '?scope=' . $scope . '&response_type=' . $response_type . '&client_id=' . $client_id . '&state=' . $state; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | * Author: Sara Hasan |
100 | 100 | * Date: 27-November-2020 |
101 | 101 | */ |
102 | - private function _checkForValidationRule($state ) |
|
102 | + private function _checkForValidationRule($state) |
|
103 | 103 | { |
104 | 104 | $errors = []; |
105 | 105 | |
106 | 106 | |
107 | - if( empty($state) ) |
|
107 | + if (empty($state)) |
|
108 | 108 | { |
109 | 109 | $errors[] = trans('bSecure::messages.validation.state.required'); |
110 | 110 | } |