1
I am working with Pagseguro in Laravel 5.3, the problem is the Class Pagseguroconfigwrapper that I need to generate to make the authentication, i do all the steps described in the documentation and it works only if I use the authentication after the Pagseguropaymentrequest class instance.
Take the example:
Works
new PagSeguroPaymentRequest();
$credentials = PagSeguroConfig::getAccountCredentials();
$transaction = PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);
It Doesn’t Work, Error: Credentials not set
$credentials = PagSeguroConfig::getAccountCredentials();
$transaction = PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);
Apparently you are using https://github.com/pagseguro/php3. I also had the same problem with the configuration, the solution as ugly as it is is to create the Wrapper class there on vendor/pagseguro/php3/source/Configuration. There’s even an example file in this directory. Edit: I also had to call the
PagSeguro\Library::initialize();
before using any other lib method.– Matheus Ferreira machado