PHPackages                             leandronunes07/c6bank-php-sdk - 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. leandronunes07/c6bank-php-sdk

ActiveLibrary[API Development](/categories/api)

leandronunes07/c6bank-php-sdk
=============================

A PHP SDK for C6 Bank API

v1.0.1(4mo ago)01MITPHPPHP &gt;=8.1CI failing

Since Feb 13Pushed 4mo agoCompare

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

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

C6 Bank PHP SDK 🇧🇷
==================

[](#c6-bank-php-sdk-)

[![PHP Version](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)](https://camo.githubusercontent.com/6518db1335bf20fdff07253dc6d6d0cec955b5fb6a8ef1382ac6d73687ecc07f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)[![Version](https://camo.githubusercontent.com/8799d8eff2c6d6038b1674f5971bc903f93acc1cd1174db033675f834fcc7ea7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d6f72616e6765)](https://camo.githubusercontent.com/8799d8eff2c6d6038b1674f5971bc903f93acc1cd1174db033675f834fcc7ea7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d6f72616e6765)[![Code Style](https://camo.githubusercontent.com/daa7000e27de672defd676d02e29c60e412248aac48d614d1398d8f7764bf49b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5053522d2d31322d626c61636b)](https://camo.githubusercontent.com/daa7000e27de672defd676d02e29c60e412248aac48d614d1398d8f7764bf49b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5053522d2d31322d626c61636b)

**Unofficial PHP SDK for C6 Bank API.**Simplify your integration with C6 Bank's services using a robust, object-oriented, and production-ready library.

---

🌟 Why use this SDK?
-------------------

[](#-why-use-this-sdk)

Integration with banking APIs can be complex (mTLS, OAuth2, cryptic errors). This SDK abstracts all that complexity into a fluent, easy-to-use interface.

- **Fluent Interface**: `$c6->pix()->cob()->create(...)`
- **Strongly Typed**: Input and Output DTOs for IntelliSense and Type Safety.
- **Production Ready**:
    - 🐢 **Auth Cache**: Prevents Rate Limiting by caching tokens (PSR-16).
    - 🕵️ **Logging**: Debug requests and responses (PSR-3).
    - 🔁 **Resilience**: Auto-retry on network failures or 5xx errors.
    - 🛡️ **Validation**: Fail-fast validation for CPFs, CNPJs, and UUIDs.
- **Complete**: Support for Boleto, PIX, Webhooks, Checkout, Schedule, Statement, and C6 Pay.

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require leandronunes07/c6bank-php-sdk
```

### Requirements

[](#requirements)

- PHP &gt;= 8.1
- `ext-json`, `ext-curl`
- `psr/simple-cache`, `psr/log`

---

⚡ Quick Start (Simple)
----------------------

[](#-quick-start-simple)

For development/testing:

```
use LeandroNunes\C6Bank\C6Bank;

$c6 = new C6Bank([
    'client_id' => 'YOUR_CLIENT_ID',
    'client_secret' => 'YOUR_CLIENT_SECRET',
    'certificate' => '/path/to/cert.pem', // Required for Production
    'private_key' => '/path/to/key.pem',   // Required for Production
    'sandbox' => true
]);

// 1. Get Account Balance
try {
    $account = $c6->accounts()->getAccount('account-id');
    echo "Balance: {$account->balance}";
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

---

🏭 Production Setup (Recommended)
--------------------------------

[](#-production-setup-recommended)

For production, you should inject a **Cache** (to store tokens) and a **Logger** (to debug errors).

```
use LeandroNunes\C6Bank\C6Bank;
use Symfony\Component\Cache\Adapter\RedisAdapter;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

// 1. Setup PSR-16 Cache (Example with Symfony Cache)
$cache = new RedisAdapter($redisConnection); // or FilesystemAdapter

// 2. Setup PSR-3 Logger (Example with Monolog)
$logger = new Logger('c6bank');
$logger->pushHandler(new StreamHandler('configs/c6bank.log', Logger::WARNING));

// 3. Initialize SDK
$c6 = new C6Bank([
    'client_id' => $_ENV['C6_CLIENT_ID'],
    'client_secret' => $_ENV['C6_CLIENT_SECRET'],
    'certificate' => '/path/to/cert.pem',
    'private_key' => '/path/to/key.pem',
    'sandbox' => false,

    // Inject Dependencies
    'cache' => $cache,
    'logger' => $logger
]);
```

---

📚 Modules &amp; Examples
------------------------

[](#-modules--examples)

Full documentation for each module can be found in **[EXAMPLES.md](./EXAMPLES.md)**.

ModuleDescriptionResource Access**Authentication**OAuth2 Token ManagementInternal**Accounts**Balance and Account Details`$c6->accounts()`**Bank Slips**Issue, Consult, Cancel Boletos`$c6->bankSlips()`**PIX**Dynamic QRCodes, Cob, CobV`$c6->pix()`**Webhooks**PIX and Banking notifications`$c6->pix()->webhook()`, `$c6->bankingWebhook()`**Checkout**E-commerce Payment Links`$c6->checkout()`**Schedule**Payment Scheduling (DDA/Ted)`$c6->schedule()`**Statement**Account Statements`$c6->statement()`**C6 Pay**POS transactions and receivables`$c6->c6pay()`---

🔒 Security
----------

[](#-security)

- **mTLS Support**: The SDK handles mutual TLS authentication required by C6 Bank.
- **Token Management**: OAuth2 tokens are potentially critical. Use a secure Cache backend (Redis/Memcached) in production.
- **Sensitive Data**: The built-in Logger automatically redacts the `Authorization` header.

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please check [CONTRIBUTING.md](./CONTRIBUTING.md) for details on code standards and testing.

1. Fork the project.
2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
4. Push to the branch (`git push origin feature/AmazingFeature`).
5. Open a Pull Request.

---

📄 License
---------

[](#-license)

Distributed under the MIT License. See `LICENSE` for more information.

---

👨‍💻 Authors
-----------

[](#‍-authors)

Developed with ❤️ by **[Agência Taruga](https://www.agenciataruga.com)** and **Leandro Oliveira Nunes**.

- **Leandro Nunes** - *Lead Developer* - [GitHub](https://github.com/leandronunes07)
- **Agência Taruga** - [Website](https://www.agenciataruga.com)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance74

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

141d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a80ac093a360730a124dcd1459f25efd37ea6d110ed5d7a99e322c5622e080e?d=identicon)[leandronunes07](/maintainers/leandronunes07)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/leandronunes07-c6bank-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/leandronunes07-c6bank-php-sdk/health.svg)](https://phpackages.com/packages/leandronunes07-c6bank-php-sdk)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/packages/algolia-algoliasearch-client-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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