1. Go to this page and download the library: Download femitz/c6bank-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
femitz / c6bank-php example snippets
use Femitz\C6BankPhp\Client;
use Femitz\C6BankPhp\Config;
use Femitz\C6BankPhp\Environment;
use Femitz\C6BankPhp\PartnerSoftware;
use Femitz\C6BankPhp\Auth\Certificate;
use Femitz\C6BankPhp\Auth\Credentials;
$config = new Config(
credentials: new Credentials(
clientId: 'seu-client-id',
clientSecret: 'seu-client-secret',
),
certificate: new Certificate(
certPath: '/caminho/para/certificado.crt',
keyPath: '/caminho/para/chave.key',
// certPassword: 'opcional',
// keyPassword: 'opcional',
),
partnerSoftware: new PartnerSoftware(
name: 'Nome do seu software',
version: '1.0.0',
),
environment: Environment::Sandbox, // ou Environment::Production
);
$client = new Client($config);
$token = $client->getAccessToken(); // reaproveitado em memória até expirar
echo $token->authorizationHeader(); // "Bearer eyJ..."
use Femitz\C6BankPhp\Bolepix\Address;
use Femitz\C6BankPhp\Bolepix\CreateBolepixRequest;
use Femitz\C6BankPhp\Bolepix\Fees;
use Femitz\C6BankPhp\Bolepix\Payer;
use Femitz\C6BankPhp\Bolepix\PaymentMethod;
use Femitz\C6BankPhp\Bolepix\PixOptions;
$request = new CreateBolepixRequest(
externalReferenceId: 'seu-id-de-referencia',
amount: 150.00,
dueDate: '2026-12-30', // ou uma instância de DateTimeInterface
payer: new Payer(
name: 'José da Silva',
taxId: '12345678910',
address: new Address(
address: 'Av. Nove de Julho, 3186',
neighborhood: 'Jardim Paulista',
city: 'São Paulo',
state: 'SP',
zipCode: '01406000',
),
email: '[email protected]',
),
description: 'Mensalidade referente a Junho/2026',
daysAfterDueDate: 10,
fees: new Fees(
fineValue: 10,
fineDeadline: 1,
fineType: 'FIXED_VALUE',
interestValue: 0.33,
interestDeadline: 1,
interestType: 'VALUE_PER_DAY',
),
paymentMethod: new PaymentMethod(
pix: new PixOptions(
key: '123e4567-e89b-12d3-a456-426614174000',
type: 'EVP',
),
),
);
$bolepix = $client->bolepix()->create($request);
echo $bolepix->bankSlip?->digitableLine;
echo $bolepix->pix?->qrCode;