Open Ort0x36 opened 9 months ago
I faced the same issue. Here's a solution:
The composer.json file contains the following PSR-4 autoloading configuration:
"autoload": {
"psr-4": {
"PagarmeApiSDKLib\\": "src/"
}
},
This means it will load PagarmeApiSDKLib namespace from the src folder.
Inside the folder that contains src, vendor and the composer.json file, you should run:
composer dump-autoload
In your code, you will then be able to add a use statement including PagarmeApiSDKLib\PagarmeApiSDKClientBuilder symbol or just call it using it's fully qualified class name, like in the following sample:
//use PagarmeApiSDKLib\PagarmeApiSDKClientBuilder;
require_once './vendor/autoload.php';
$client = PagarmeApiSDKLib\PagarmeApiSDKClientBuilder::init()
->basicAuthUserName('BasicAuthUserName')
->basicAuthPassword('BasicAuthPassword')
->serviceRefererName('ServiceRefererName')
->build();
I hope this helps.
Fatal error: Uncaught Error: Class 'PagarmeApiSDKClientBuilder' not found in /var/www/html/testing_pagarme_client.php:4 Stack trace: #0 {main} thrown in /var/www/html/testing_pagarme_client.php on line 4