PHPackages                             viebig/cobregratis - 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. [API Development](/categories/api)
4. /
5. viebig/cobregratis

ActiveLibrary[API Development](/categories/api)

viebig/cobregratis
==================

PHP Wrapper para a API do Cobre Grátis com suporte a composer

0193PHP

Since Oct 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/viebig/cobregratis-php)[ Packagist](https://packagist.org/packages/viebig/cobregratis)[ RSS](/packages/viebig-cobregratis/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Wrapper para a API do Cobre Grátis (adicionado suporte a composer)
======================================================================

[](#php-wrapper-para-a-api-do-cobre-grátis-adicionado-suporte-a-composer)

Essa biblioteca é um conjunto de classes em PHP para acessar as informações do [Cobre Grátis](http://cobregratis.com.br) através da [API](https://github.com/CobreGratis/cobregratis-api).

Todas as classes são herdadas do PHP ActiveResouce. Veja a documentação do [PHP ActiveResouce](https://github.com/lux/phpactiveresource) para mais informações.

Instalando
----------

[](#instalando)

### Via composer

[](#via-composer)

```
composer require "viebig/cobregratis": "dev-master"

```

### Via git

[](#via-git)

```
git clone https://github.com/CobreGratis/cobregratis-php.git

```

### Configurando seu token

[](#configurando-seu-token)

```
require 'lib/CobreGratis.php';

$bank_billet = new BankBillet();
$bank_billet->user = "seu_token";
$bank_billet->password = "X";
```

Uso
---

[](#uso)

```
# criar um boleto
$bank_billet = new BankBillet(array(
  'amount' => 230.50,
  'expire_at' => '2015-07-22',
  'name' => 'Rafael Lima'
));
$bank_billet->user = "seu_token";
$bank_billet->password = "X";
$bank_billet->save();

# listar todos os boletos
$bank_billet->extra_params = "?page=1";
$bank_billets = $bank_billet->find('all');
if($bank_billets->errno) {
  print "$bank_billets->error\n";
} else {
  foreach($bank_billets as $bank_billet) {
    print "Nosso Número: $bank_billet->our_number\n";
    print "Vencimento: $bank_billet->expire_at\n";
    print "Valor: $bank_billet->amount\n";
    print "Sacado: $bank_billet->name\n";
    print "URL: $bank_billet->external_link\n";
    print "=================================\n";
  }
}
```

Veja os exemplos: [bank\_billet.php](https://github.com/CobreGratis/cobregratis-php/blob/master/examples/bank_billet.php)[customer.php](https://github.com/CobreGratis/cobregratis-php/blob/master/examples/customer.php)[bank\_billet\_subscription.php](https://github.com/CobreGratis/cobregratis-php/blob/master/examples/bank_billet_subscription.php)

Licença
-------

[](#licença)

Esse código é livre para ser usado dentro dos termos da licença [MIT license](http://www.opensource.org/licenses/mit-license.php).

Bugs, Issues, Agradecimentos, etc
---------------------------------

[](#bugs-issues-agradecimentos-etc)

Comentários são bem-vindos. Envie seu feedback através do [issue tracker do GitHub](http://github.com/CobreGratis/cobregratis-php/issues)

Autor
-----

[](#autor)

[**Rafael Lima**](http://github.com/rafaelp) trabalhando na [CobreGratis](http://bielsystems.com.br)

Blog:

Twitter:

Composer
--------

[](#composer)

[**Guilherme Viebig**](http://github.com/viebig) - [BitLoom](http://www.bitloom.net) - [Ponki](http://www.ponki.com.br)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/356510?v=4)[Guilherme Viebig](/maintainers/viebig)[@viebig](https://github.com/viebig)

---

Top Contributors

[![kivanio](https://avatars.githubusercontent.com/u/5107?v=4)](https://github.com/kivanio "kivanio (11 commits)")[![viebig](https://avatars.githubusercontent.com/u/356510?v=4)](https://github.com/viebig "viebig (9 commits)")[![rafaelp](https://avatars.githubusercontent.com/u/19240?v=4)](https://github.com/rafaelp "rafaelp (7 commits)")

### Embed Badge

![Health badge](/badges/viebig-cobregratis/health.svg)

```
[![Health](https://phpackages.com/badges/viebig-cobregratis/health.svg)](https://phpackages.com/packages/viebig-cobregratis)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k12](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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