PHPackages                             lucastmax/cora-php - 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. lucastmax/cora-php

ActiveLibrary[API Development](/categories/api)

lucastmax/cora-php
==================

Cliente PHP 7 para as APIs da Cora (boletos v2, pagamento em stage e OAuth2 Client Credentials).

05PHP

Since Mar 11Pushed 2mo agoCompare

[ Source](https://github.com/lucastmax/cora-php)[ Packagist](https://packagist.org/packages/lucastmax/cora-php)[ RSS](/packages/lucastmax-cora-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

tmax/cora-php
=============

[](#tmaxcora-php)

Cliente PHP 7 para as APIs da **Cora**, cobrindo:

- Emissão de boleto registrado v2
- Consultar boletos v2
- Consultar detalhes de um boleto v2
- Pagar boleto em **Stage**
- OAuth2 **Client Credentials**

Requisitos
----------

[](#requisitos)

- PHP &gt;= 7.2.5
- ext-json
- Composer

Instalação (via Packagist)
--------------------------

[](#instalação-via-packagist)

```
composer require tmax/cora-php
```

Uso rápido (Client Credentials)
-------------------------------

[](#uso-rápido-client-credentials)

```
use Cora\Config;
use Cora\Auth\ClientCredentialsProvider;
use Cora\CoraClient;

$config = new Config(
    Config::ENV_STAGE,               // ou Config::ENV_PROD
    'CLIENT_ID',
    'CLIENT_SECRET',
    ['offline_access','invoice']     // ajuste escopos
);

$provider = new ClientCredentialsProvider($config);
$client   = new CoraClient($config, $provider);

// 1) Emitir boleto
$payload = [
  "customer" => [
    "name" => "Cliente Exemplo",
    "document" => "12345678909",
    "email" => "cliente@exemplo.com"
  ],
  "services" => [
    ["name" => "Mensalidade", "description" => "Ref. Outubro", "amount" => 10000]
  ],
  "payment_terms" => [
    "due_date" => date('Y-m-d', strtotime('+5 days')),
    "fine"     => ["amount" => 200],
    "interest" => ["amount" => 100]
  ]
];

$res = $client->issueRegisteredBoletoV2($payload);

// 2) Listar boletos
$list = $client->listBoletosV2([
  'start' => date('Y-m-01'),
  'end'   => date('Y-m-d'),
  'state' => 'OPEN',
]);

// 3) Detalhes de um boleto
$details = $client->getBoletoDetailsV2($res['id']);

// 4) Pagar boleto (apenas stage)
$paid = $client->payBankslipStage($res['id']);
```

Ambientes
---------

[](#ambientes)

- **Stage**:
- **Prod**:

Boas práticas
-------------

[](#boas-práticas)

- Use **Idempotency-Key** em POSTs.
- Valores monetários sempre em **centavos**.
- Trate expiração do token (renove próximo de expirar).
- Valide que o escopo correto está habilitado (p.ex. `invoice`).

Licença
-------

[](#licença)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance57

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6486f733b37a06dc299a24630819c6cf1d76081a99d10591f7cd091a373722aa?d=identicon)[lucastmax](/maintainers/lucastmax)

---

Top Contributors

[![lucastmax](https://avatars.githubusercontent.com/u/84201045?v=4)](https://github.com/lucastmax "lucastmax (4 commits)")

### Embed Badge

![Health badge](/badges/lucastmax-cora-php/health.svg)

```
[![Health](https://phpackages.com/badges/lucastmax-cora-php/health.svg)](https://phpackages.com/packages/lucastmax-cora-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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