CyberSource / cybersource-rest-client-php

PHP client library for the CyberSource REST API
27 stars 65 forks source link

ApiClient.php does not work when composer's "vendor-dir" is not "vendor" #116

Open vfalendysh opened 1 year ago

vfalendysh commented 1 year ago

File: cybersource/rest-client-php/lib/ApiClient.php Function: getClientId()

This code has hardcoded "vendor" dir name, but composer has the ability to override it with vendor-dir directive, and when it happens, lib will stop working rendering file not found message. Also, what if I do not use composer?

$packages = json_decode(file_get_contents(DIR . "/../../../../vendor/composer/installed.json"), true);

proper code (does not go outside of the "vendor" folder):

$packages = json_decode(file_get_contents(DIR . "/../../../composer/installed.json"), true);