Pagseguro and Pagseguroconfigwrapper

Asked

Viewed 179 times

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);
  • 1

    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.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.