PagSeguro and PagSeguroConfigWrapper

1

I'm working with PagSeguro in Laravel 5.3, the problem is the Class PagSeguroConfigWrapper that I need to generate to do the authentication, I do all the steps described in the documentation and it works only if I use the authentication after the instance of the class PagSeguroPaymentRequest. Home See the example:

It works

    new PagSeguroPaymentRequest();
    $credentials = PagSeguroConfig::getAccountCredentials();

    $transaction = PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);


Does not work, error: Credentials not set

    $credentials = PagSeguroConfig::getAccountCredentials();

    $transaction = PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);
    
asked by anonymous 09.11.2016 / 17:04

1 answer

1

Apparently you're using link .

I also had the same problem with the configuration, the ugliest solution is to create the Wrapper class there at vendor / pagseguro / php3 / source / Configuration . It even has a sample file in that directory.

Edit: I also had to call PagSeguro\Library::initialize(); before using any other lib method.

    
10.11.2016 / 14:16