PHPackages                             f5sistemas/laravel-pagseguro - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. f5sistemas/laravel-pagseguro

ActiveLibrary[Framework](/categories/framework)

f5sistemas/laravel-pagseguro
============================

Biblioteca de integração com o gateway de pagamento PagSeguro.

1.0.4(8y ago)02MITPHPPHP &gt;=5.4.0

Since Dec 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/f5sistemas/laravel-pagseguro)[ Packagist](https://packagist.org/packages/f5sistemas/laravel-pagseguro)[ RSS](/packages/f5sistemas-laravel-pagseguro/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (11)Used By (0)

Laravel PagSeguro - 1.0.4
-------------------------

[](#laravel-pagseguro---104)

[![Build Status](https://camo.githubusercontent.com/4ecfab6065b4681522e0fa49b5dce8b2bda138bf4d0710f40f4191b73b9879d2/68747470733a2f2f7472617669732d63692e6f72672f6d69636861656c646f75676c61732f6c61726176656c2d70616773656775726f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/michaeldouglas/laravel-pagseguro)[![Total Downloads](https://camo.githubusercontent.com/353c676d6b22e2882ade53cc9b4fe727f69e2cbc799a86206d20efbd0049f70b/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c2f6c61726176656c70616773656775726f2f646f776e6c6f616473)](https://packagist.org/packages/michael/laravelpagseguro)[![Latest Unstable Version](https://camo.githubusercontent.com/cb43fa77060261511add7378c02448c5ae57d124af3037bb107148170061ccf0/68747470733a2f2f706f7365722e707567782e6f72672f6c656170686c792f636172742d62756e646c652f762f756e737461626c652e737667)](//packagist.org/packages/michael/laravelpagseguro)[![License](https://camo.githubusercontent.com/3864c0d39439273179ec036bb3fce33aeb169cd758eaa224a261c8490cc1c374/68747470733a2f2f706f7365722e707567782e6f72672f6c656170686c792f636172742d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/michael/laravelpagseguro)[![Code Climate](https://camo.githubusercontent.com/37bf4596ba195d7ae1d93cd7041d36e9c49fa416a053674f2161887cd4fb113e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d69636861656c646f75676c61732f6c61726176656c2d70616773656775726f2f6261646765732f6770612e737667)](https://codeclimate.com/github/michaeldouglas/laravel-pagseguro)[![Codacy Badge](https://camo.githubusercontent.com/97e4b4842e6be60255d54eda74d6d03e5195535c8842c7d056392e7ca96c961e/68747470733a2f2f7777772e636f646163792e636f6d2f70726f6a6563742f62616467652f6133353861353763386434663434353862396439303535333236663561363763)](https://www.codacy.com/app/michaeldouglas010790/laravel-pagseguro)

O laravel-pagseguro consome a API do PagSeguro e prove uma forma simples de gerar o pagamento, e notificar sobre as suas transações.

Criação e configuração do usuário
---------------------------------

[](#criação-e-configuração-do-usuário)

Antes de você utilizar o Laravel PagSeguro é importante você verificar se o seu usuário do PagSeguro está correto para a integração segue URL de configuração do usuário PagSeguro:

Compatibilidade
---------------

[](#compatibilidade)

PHP &gt;= 5.4 Laravel 5.x

Instalação
----------

[](#instalação)

Abra o arquivo `composer.json` e insira a seguinte instrução:

```
"require": {
    "michael/laravelpagseguro": "dev-master"
}

```

**Observação**: Para a versão 5.1 do laravel ou abaixo especifique a versão **0.4.1** ao invés de utilizar **dev-master**

Após inserir no require o `Laravel PagSeguro`, você deverá executar o comando:

```
composer update

```

Ou execute o comando:

```
composer require michael/laravelpagseguro:dev-master

```

Configuração do Service Provider
--------------------------------

[](#configuração-do-service-provider)

Abra o arquivo `config/app.php` e adicione no array `providers` a seguinte instrução:

```
laravel\pagseguro\Platform\Laravel5\ServiceProvider::class
```

Aliases do package
------------------

[](#aliases-do-package)

Em seu arquivo `config/app.php` adicione no array `aliases` a seguinte instrução:

```
'PagSeguro' => laravel\pagseguro\Platform\Laravel5\PagSeguro::class
```

Criação do configurador
-----------------------

[](#criação-do-configurador)

Agora você irá executar o comando:

```
php artisan vendor:publish
```

Se tudo ocorreu bem, a seguinte mensagem sera exibida:

```
Copied File [/vendor/michael/laravelpagseguro/src/laravel/pagseguro/Config/laravelpagseguro.php] To [/config/laravelpagseguro.php]
```

Ajuste da configuração
----------------------

[](#ajuste-da-configuração)

Abra o arquivo `config/laravelpagseguro.php` altere o `token` e também o `e-mail` informando o da sua loja:

```
    'credentials' => array(//SETA AS CREDENCIAIS DE SUA LOJA
        'token' => null,
        'email' => null,
    )
```

Proxy
-----

[](#proxy)

Caso você precise de proxy para utilizar a Laravel PagSeguro descomente e configure a linha de http adapter:

```
'http' => [
    'adapter' => [
        'type' => 'curl',
        'options' => [
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_0,
            // CURLOPT_PROXY => 'http://user:pass@host:port', // PROXY OPTION  [
        [
            'id' => '18',
            'description' => 'Item Um',
            'quantity' => '1',
            'amount' => '1.15',
            'weight' => '45',
            'shippingCost' => '3.5',
            'width' => '50',
            'height' => '45',
            'length' => '60',
        ],
        [
            'id' => '19',
            'description' => 'Item Dois',
            'quantity' => '1',
            'amount' => '3.15',
            'weight' => '50',
            'shippingCost' => '8.5',
            'width' => '40',
            'height' => '50',
            'length' => '80',
        ],
    ],
    'shipping' => [
        'address' => [
            'postalCode' => '06410030',
            'street' => 'Rua Leonardo Arruda',
            'number' => '12',
            'district' => 'Jardim dos Camargos',
            'city' => 'Barueri',
            'state' => 'SP',
            'country' => 'BRA',
        ],
        'type' => 2,
        'cost' => 30.4,
    ],
    'sender' => [
        'email' => 'sender@gmail.com',
        'name' => 'Isaque de Souza Barbosa',
        'documents' => [
            [
                'number' => '01234567890',
                'type' => 'CPF'
            ]
        ],
        'phone' => '11985445522',
        'bornDate' => '1988-03-21',
    ]
];
```

Após ter os dados, utilize o método: `createFromArray` para criar o objeto de checkout:

```
$checkout = PagSeguro::checkout()->createFromArray($data);
```

Para confirmar o envio utilize o método: `send` da seguinte forma:

```
$checkout = PagSeguro::checkout()->createFromArray($data);
$credentials = PagSeguro::credentials()->get();
$information = $checkout->send($credentials); // Retorna um objeto de laravel\pagseguro\Checkout\Information\Information
if ($information) {
    print_r($information->getCode());
    print_r($information->getDate());
    print_r($information->getLink());
}
```

Informando metadados de Recarga de celular:

```
// ....
$data['cellphone_charger'] = '+5511980810000';
$checkout = PagSeguro::checkout()->createFromArray($data);
```

Informando metadados para Dados de viagem:

```
// ....
$data['travel'] = [
  'passengers' => [
      [
          'name' => 'Isaque de Souza',
          'cpf' => '40404040411',
          'passport' => '4564897987'
      ],
      [
          'name' => 'Michael Douglas',
          'cpf' => '80808080822',
      ]
  ],
  'origin' => [
      'city' => 'SAO PAULO - SP',
      'airportCode' => 'CGH', // Congonhas
  ],
  'destination' => [
      'city' => 'RIO DE JANEIRO - RJ',
      'airportCode' => 'SDU', // Santos Dumont
  ]
];
$checkout = PagSeguro::checkout()->createFromArray($data);
```

Informando metadados para Jogos:

```
// ....
$data['game'] = [
    'gameName' => 'PS LEGEND',
    'playerId' => 'BR561546S4',
    'timeInGameDays' => 360,
];
$checkout = PagSeguro::checkout()->createFromArray($data);
```

Credenciais
-----------

[](#credenciais)

Para resgatar as credenciais padrões do arquivo você pode usar:

```
$credentials = PagSeguro::credentials()->get();
```

Ou usar credenciais alternativas

```
$credentials = PagSeguro::credentials()->create($token, $email);
```

Consultando uma Transação manualmente
-------------------------------------

[](#consultando-uma-transação-manualmente)

```
$credentials = PagSeguro::credentials()->get();
$transaction = PagSeguro::transaction()->get($code, $credentials);
$information = $transaction->getInformation();
```

Recebendo Notificações de Transação
-----------------------------------

[](#recebendo-notificações-de-transação)

Crie uma rota POST com o nome "pagseguro.notification" (Esta no config)

```
Route::post('/pagseguro/notification', [
    'uses' => '\laravel\pagseguro\Platform\Laravel5\NotificationController@notification',
    'as' => 'pagseguro.notification',
]);
```

Registre um callback (callable) no seu config laravelpagseguro.php

```
'routes' => [
    'notification' => [
        'callback' => ['MyNotificationClass', 'myMethod'], // Callable
        'credential' => 'default',
        'route-name' => 'pagseguro.notification', // Nome da rota
    ],
],
```

Ou ....

```
'routes' => [
    'notification' => [
        'callback' => function ($information) { // Callable
            \Log::debug(print_r($information, 1));
        },
    ],
],
```

Licença
-------

[](#licença)

O Laravel PagSeguro utiliza a licença MIT, para saber mais leia no link: [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~103 days

Recently: every ~125 days

Total

10

Last Release

3221d ago

Major Versions

0.6.0 → 1.0.02016-03-03

PHP version history (2 changes)0.3.0PHP &gt;=5.3.0

0.4.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e920e49e26471fed9bf56a1aeaa147973b4bf84026c83add40ad400e590f19c?d=identicon)[F5 Software de Gestão](/maintainers/F5%20Software%20de%20Gest%C3%A3o)

---

Top Contributors

[![michaeldouglas](https://avatars.githubusercontent.com/u/2530054?v=4)](https://github.com/michaeldouglas "michaeldouglas (147 commits)")[![isaquesb](https://avatars.githubusercontent.com/u/3066343?v=4)](https://github.com/isaquesb "isaquesb (73 commits)")[![marabesi](https://avatars.githubusercontent.com/u/2129872?v=4)](https://github.com/marabesi "marabesi (25 commits)")[![f5sistemas](https://avatars.githubusercontent.com/u/8289942?v=4)](https://github.com/f5sistemas "f5sistemas (2 commits)")[![kaiocesar](https://avatars.githubusercontent.com/u/2325842?v=4)](https://github.com/kaiocesar "kaiocesar (2 commits)")[![lfserrra](https://avatars.githubusercontent.com/u/10976421?v=4)](https://github.com/lfserrra "lfserrra (1 commits)")

---

Tags

frameworklaravelPagseguroGateway Pagamento

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/f5sistemas-laravel-pagseguro/health.svg)

```
[![Health](https://phpackages.com/badges/f5sistemas-laravel-pagseguro/health.svg)](https://phpackages.com/packages/f5sistemas-laravel-pagseguro)
```

###  Alternatives

[michael/laravelpagseguro

Biblioteca de integração com o gateway de pagamento PagSeguro.

357149.3k1](/packages/michael-laravelpagseguro)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[rahulalam31/laravel-abuse-ip

Block ip address of all spammer's around the world.

27431.5k](/packages/rahulalam31-laravel-abuse-ip)[krzysztofrewak/laravel-oop-validator

Laravel Validator object-oriented wrapper

805.8k](/packages/krzysztofrewak-laravel-oop-validator)[laracord/framework

The Laracord Framework.

455.6k1](/packages/laracord-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
