bSecureCheckout /
bsecure-payments-php
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace bSecure\Payments\Models; |
||||
| 4 | |||||
| 5 | use bSecure\Payments\Helpers\Helper; |
||||
| 6 | use Illuminate\Database\Eloquent\Model; |
||||
|
0 ignored issues
–
show
|
|||||
| 7 | |||||
| 8 | class Merchant extends Model |
||||
| 9 | { |
||||
| 10 | /** |
||||
| 11 | * Author: Sara Hasan |
||||
| 12 | * Date: 10-November-2020 |
||||
| 13 | */ |
||||
| 14 | public static function getMerchantAccessToken() |
||||
| 15 | { |
||||
| 16 | $merchantClientId = config('bSecurePayments.client_id'); |
||||
|
0 ignored issues
–
show
The function
config 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
Loading history...
|
|||||
| 17 | $merchantClientSecret = config('bSecurePayments.client_secret'); |
||||
| 18 | |||||
| 19 | $merchantAppCredentials = ClientApp::verifyAppCredentials($merchantClientId, $merchantClientSecret); |
||||
| 20 | $merchantAppCredentials['store_id'] = config('bSecurePayments.store_slug'); |
||||
| 21 | |||||
| 22 | if (empty($merchantAppCredentials)) { |
||||
| 23 | return ['error' => true, 'message' => trans('bSecurePayments::messages.client.invalid')]; |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 24 | } else { |
||||
| 25 | if (!empty($merchantAppCredentials['client_id'])) { |
||||
| 26 | // Get Merchant Access Token |
||||
| 27 | $merchantToken = Helper::getAccessToken($merchantAppCredentials); |
||||
| 28 | |||||
| 29 | if ($merchantToken['error']) { |
||||
| 30 | return ['error' => true, 'message' => $merchantToken['message']]; |
||||
| 31 | } else { |
||||
| 32 | return ['error' => false, 'body' => $merchantToken['accessToken']]; |
||||
| 33 | } |
||||
| 34 | |||||
| 35 | } else if ($merchantAppCredentials['error']) { |
||||
| 36 | return $merchantAppCredentials; |
||||
| 37 | } else { |
||||
| 38 | return ['error' => true, 'message' => trans('bSecurePayments::messages.general.failed')]; |
||||
| 39 | } |
||||
| 40 | } |
||||
| 41 | } |
||||
| 42 | } |
||||
| 43 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths