c6_bank 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.env.example +11 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +15 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +318 -0
- data/Rakefile +12 -0
- data/docs/NEXT_STEPS.md +17 -0
- data/docs/openapi/bolepix.yaml +850 -0
- data/docs/openapi/pix-api.yaml +4446 -0
- data/docs/rails_initializer_example.rb +17 -0
- data/docs/roteiro_mapping.md +31 -0
- data/examples/auth_probe.rb +14 -0
- data/examples/boleto_cases.rb +56 -0
- data/examples/env.rb +22 -0
- data/examples/live_sandbox.rb +90 -0
- data/examples/pix_cases.rb +42 -0
- data/exe/c6_bank +4 -0
- data/lib/c6_bank/boleto/request.rb +163 -0
- data/lib/c6_bank/client.rb +255 -0
- data/lib/c6_bank/configuration.rb +120 -0
- data/lib/c6_bank/errors.rb +33 -0
- data/lib/c6_bank/pix/payload.rb +132 -0
- data/lib/c6_bank/pix.rb +16 -0
- data/lib/c6_bank/resources/base.rb +34 -0
- data/lib/c6_bank/resources/boleto.rb +72 -0
- data/lib/c6_bank/resources/dda.rb +40 -0
- data/lib/c6_bank/resources/pix.rb +111 -0
- data/lib/c6_bank/resources.rb +11 -0
- data/lib/c6_bank/version.rb +5 -0
- data/lib/c6_bank.rb +68 -0
- data/sig/c6_bank.rbs +4 -0
- metadata +122 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d85a23a335c256e6eebc98545e7161dafb42806fdff667eaf9731a7515868ff5
|
|
4
|
+
data.tar.gz: 57258199ce71cdf3e11f79f5340bc8d1a1a505f0d48c8fff1e2a59a5fc59892d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 0f813fa0ebfc94866b98fcdd3cf3671ab78eea8ab32cf88ad43f2e05129b9019a1552da55d2eb8a4b40a2a6e5a3a10bf876456226e9ac5e975a9386c4e38f0e0
|
|
7
|
+
data.tar.gz: 1c70fc4cf3586658b4d867cf8c2bc6bbb352e075e04f65d24aa93b7d3cbace626d7c1857a1e8a3d7082a07f5c6a285338d08e650e2ff5df203c0ce03afbda01e
|
data/.env.example
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# C6 Bank credentials (sandbox)
|
|
2
|
+
# Copy to .env and fill in. Never commit .env.
|
|
3
|
+
|
|
4
|
+
C6_ENV=sandbox
|
|
5
|
+
C6_CLIENT_ID=your-client-id
|
|
6
|
+
C6_CLIENT_SECRET=your-client-secret
|
|
7
|
+
C6_PIX_KEY=your-evp-pix-key
|
|
8
|
+
C6_CERT_PATH=docs/certs/c6_sandbox.crt
|
|
9
|
+
C6_KEY_PATH=docs/certs/c6_sandbox.key
|
|
10
|
+
C6_PARTNER_SOFTWARE_NAME=c6_bank-gem
|
|
11
|
+
C6_PARTNER_SOFTWARE_VERSION=0.2.0
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-3.4.7
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## [Unreleased]
|
|
2
|
+
|
|
3
|
+
- Request Bolepix PDFs with `Accept: */*` because sandbox returns 406 for `application/pdf` alone.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-09-18
|
|
6
|
+
|
|
7
|
+
- Wire the client to the official C6 contracts: auth `/v1/auth`, Bolepix `/v2/bank_slips`, Pix `/v2/pix`.
|
|
8
|
+
- Enable Pix automatically on Bolepix charges when `pix_key` is configured (EVP random key).
|
|
9
|
+
- Implement Pix cob/cobv, received Pix, refunds and webhook helpers.
|
|
10
|
+
- Add Bolepix list + patch, authenticated PDF download, and `Client.from_env`.
|
|
11
|
+
- Stop shipping hardcoded credentials in examples and the README.
|
|
12
|
+
|
|
13
|
+
## [0.1.0] - 2026-06-17
|
|
14
|
+
|
|
15
|
+
- Initial release
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
"c6_bank" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
|
|
4
|
+
|
|
5
|
+
* Participants will be tolerant of opposing views.
|
|
6
|
+
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
|
|
7
|
+
* When interpreting the words and actions of others, participants should always assume good intentions.
|
|
8
|
+
* Behaviour which can be reasonably considered harassment will not be tolerated.
|
|
9
|
+
|
|
10
|
+
If you have any concerns about behaviour within this project, please contact us at ["byellokore@users.noreply.github.com"](mailto:"byellokore@users.noreply.github.com").
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gabriel Fontoura Dos Santos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# c6_bank
|
|
2
|
+
|
|
3
|
+
Ruby client for [C6 Bank BaaS](https://developers.c6bank.com.br/get-started). It speaks the three contracts this gem is built around:
|
|
4
|
+
|
|
5
|
+
| Product | What it does | Path |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| **Auth** | OAuth2 client-credentials token over mTLS | `POST /v1/auth` |
|
|
8
|
+
| **Bolepix** | One charge payable as boleto **and** Pix QR | `/v2/bank_slips` |
|
|
9
|
+
| **Pix** | BACEN Pix cob / cobv, received Pix, refunds, webhooks | `/v2/pix` |
|
|
10
|
+
|
|
11
|
+
Hosts:
|
|
12
|
+
|
|
13
|
+
- Sandbox: `https://baas-api-sandbox.c6bank.info`
|
|
14
|
+
- Production: `https://baas-api.c6bank.info`
|
|
15
|
+
|
|
16
|
+
Sandbox is available **Monday–Friday, 07:00–22:00 BRT**. Tokens expire after about **10 minutes of inactivity**.
|
|
17
|
+
|
|
18
|
+
Official portal: [developers.c6bank.com.br](https://developers.c6bank.com.br/get-started)
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- Ruby >= 3.2 (developed on 3.4.7)
|
|
23
|
+
- C6 `client_id` + `client_secret`
|
|
24
|
+
- mTLS certificate + private key issued by C6 for this client
|
|
25
|
+
- For Pix / Bolepix QR: an **EVP (random) Pix key** registered on the C6 account
|
|
26
|
+
|
|
27
|
+
Bolepix only generates a QR Code when `payment_method.pix` is sent with `type: "EVP"` and a key C6 already knows. Other key types (CPF, e-mail, phone) are accepted by the standalone Pix API, not by Bolepix.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
# Gemfile
|
|
33
|
+
gem "c6_bank"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bundle install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Until this gem is published, point Bundler at the repo:
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
gem "c6_bank", path: "../se_six_ruby"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Configure with environment variables
|
|
47
|
+
|
|
48
|
+
Copy `.env.example` to `.env` (gitignored) and fill in values from the C6 portal. **Never commit secrets or certificates.**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
C6_ENV=sandbox
|
|
52
|
+
C6_CLIENT_ID=...
|
|
53
|
+
C6_CLIENT_SECRET=...
|
|
54
|
+
C6_PIX_KEY=... # EVP random key, required for Pix QR
|
|
55
|
+
C6_CERT_PATH=/secure/path/c6.crt
|
|
56
|
+
C6_KEY_PATH=/secure/path/c6.key
|
|
57
|
+
C6_PARTNER_SOFTWARE_NAME=MyERP
|
|
58
|
+
C6_PARTNER_SOFTWARE_VERSION=1.0.0
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```ruby
|
|
62
|
+
require "c6_bank"
|
|
63
|
+
|
|
64
|
+
client = C6Bank::Client.from_env
|
|
65
|
+
client.authenticate!
|
|
66
|
+
puts client.scope
|
|
67
|
+
# e.g. "bankslip.write webhook.read pix.read webhook.write pix.write bankslip.read"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or configure explicitly:
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
C6Bank.configure do |c|
|
|
74
|
+
c.client_id = ENV.fetch("C6_CLIENT_ID")
|
|
75
|
+
c.client_secret = ENV.fetch("C6_CLIENT_SECRET")
|
|
76
|
+
c.pix_key = ENV.fetch("C6_PIX_KEY")
|
|
77
|
+
c.certificate_path = ENV.fetch("C6_CERT_PATH")
|
|
78
|
+
c.private_key_path = ENV.fetch("C6_KEY_PATH")
|
|
79
|
+
c.environment = :sandbox # or :production
|
|
80
|
+
c.partner_software_name = "MyERP"
|
|
81
|
+
c.partner_software_version = "1.0.0"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
C6Bank.boletos.create(...)
|
|
85
|
+
C6Bank.pix.create_immediate_charge(amount: "10.00")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`environment` selects the host **and** the Bolepix wallet (`billing_scheme`): `"21"` in sandbox, `"15"` in production.
|
|
89
|
+
|
|
90
|
+
## Authentication
|
|
91
|
+
|
|
92
|
+
Every call, including the token request, uses **mutual TLS**. The gem:
|
|
93
|
+
|
|
94
|
+
1. Presents your client certificate + key
|
|
95
|
+
2. Posts `application/x-www-form-urlencoded` `grant_type=client_credentials` to `/v1/auth`
|
|
96
|
+
3. Sends `Authorization: Bearer …` on resource calls
|
|
97
|
+
4. Refreshes the token on expiry and retries once on HTTP 401
|
|
98
|
+
|
|
99
|
+
If the certificate `Not After` date is in the past, the gem prints a warning. C6 will typically reject the handshake until you replace the pair.
|
|
100
|
+
|
|
101
|
+
## Bolepix — boleto + Pix in one charge
|
|
102
|
+
|
|
103
|
+
This is the usual receivables flow. When `pix_key` is configured, Pix is attached automatically.
|
|
104
|
+
|
|
105
|
+
```ruby
|
|
106
|
+
req = C6Bank.boleto_request(
|
|
107
|
+
amount: 150.75,
|
|
108
|
+
due_date: "2026-10-20",
|
|
109
|
+
description: "Pedido 42"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
req.payer(
|
|
113
|
+
name: "Fulano de Tal",
|
|
114
|
+
tax_id: "12345678909",
|
|
115
|
+
address: {
|
|
116
|
+
address: "Av. Nove de Julho, 3186",
|
|
117
|
+
neighborhood: "Jardins",
|
|
118
|
+
city: "Sao Paulo",
|
|
119
|
+
state: "SP",
|
|
120
|
+
zip_code: "01406000"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
req.with_fees(
|
|
125
|
+
fine_type: "FIXED_VALUE",
|
|
126
|
+
fine_value: 10,
|
|
127
|
+
fine_deadline: 5,
|
|
128
|
+
interest_type: "VALUE_PER_DAY",
|
|
129
|
+
interest_value: 0.5,
|
|
130
|
+
interest_deadline: 1
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
req.bank_slip(instructions: ["Nao receber apos o vencimento"])
|
|
134
|
+
# req.without_pix # opt out of the QR Code
|
|
135
|
+
|
|
136
|
+
charge = client.boletos.create(req)
|
|
137
|
+
|
|
138
|
+
charge["external_reference_id"]
|
|
139
|
+
charge.dig("payment_method", "bank_slip", "digitable_line")
|
|
140
|
+
charge.dig("payment_method", "pix", "qr_code") # EMV / copia-e-cola
|
|
141
|
+
charge.dig("payment_method", "pix", "image_content") # Base64 PNG
|
|
142
|
+
charge.dig("payment_method", "pix", "reference")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Other Bolepix operations:
|
|
146
|
+
|
|
147
|
+
```ruby
|
|
148
|
+
client.boletos.find(external_reference_id)
|
|
149
|
+
client.boletos.list(due_date_from: "2026-09-01", due_date_to: "2026-09-30", status: "CREATED")
|
|
150
|
+
client.boletos.update(external_reference_id, due_date: "2026-11-01")
|
|
151
|
+
pdf = client.boletos.pdf(external_reference_id)
|
|
152
|
+
client.boletos.cancel(external_reference_id)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`external_reference_id` is 26 uppercase `A-Z0-9` characters. The gem generates one when you omit it. Sending the same id twice returns the existing charge (idempotent).
|
|
156
|
+
|
|
157
|
+
List requires at least one date range (`payment_date_*`, `due_date_*` or `credit_date_*`), max 60 days.
|
|
158
|
+
|
|
159
|
+
If Pix data is missing on the response, C6 created the boleto but skipped QR generation: the key is not EVP, not registered, or was omitted.
|
|
160
|
+
|
|
161
|
+
## Troubleshooting
|
|
162
|
+
|
|
163
|
+
### `403` `mtls_error`
|
|
164
|
+
|
|
165
|
+
C6 rejected the client certificate. Typical causes:
|
|
166
|
+
|
|
167
|
+
- The `.crt` / `.key` pair expired (C6 sandbox certs are typically valid ~1 year)
|
|
168
|
+
- The pair belongs to a **different** `client_id` than `C6_CLIENT_ID`
|
|
169
|
+
- The files were issued for the other environment (sandbox vs production)
|
|
170
|
+
|
|
171
|
+
Download a fresh pair from the same e-mail / portal message that contained the new `client_id` and `client_secret`, then point `C6_CERT_PATH` and `C6_KEY_PATH` at those files.
|
|
172
|
+
|
|
173
|
+
The certificate currently in `docs/GabrielFDSCT/` expired on **2026-02-21** and will not authenticate.
|
|
174
|
+
|
|
175
|
+
### Sandbox closed
|
|
176
|
+
|
|
177
|
+
Auth and resource calls fail outside Monday–Friday 07:00–22:00 BRT.
|
|
178
|
+
|
|
179
|
+
### Bolepix without QR Code
|
|
180
|
+
|
|
181
|
+
`C6_PIX_KEY` must be an **EVP (random UUID) key** already registered on the C6 account. CPF / e-mail / phone keys work on `/v2/pix` cob charges, not on Bolepix QR generation.
|
|
182
|
+
|
|
183
|
+
## Pix — standalone cob / cobv
|
|
184
|
+
|
|
185
|
+
C6's Pix API follows BACEN Pix v2 (`/v2/pix`). Field names in the HTTP body are the official ones (`chave`, `calendario`, `valor.original`, `pixCopiaECola`). The gem also accepts Ruby-friendly aliases (`amount`, `due_date`, `expiration`, `pix_key`).
|
|
186
|
+
|
|
187
|
+
### Immediate charge (cob)
|
|
188
|
+
|
|
189
|
+
```ruby
|
|
190
|
+
# Bank generates txid
|
|
191
|
+
cob = client.pix.create_immediate_charge(
|
|
192
|
+
amount: "37.00",
|
|
193
|
+
expiration: 3600, # seconds
|
|
194
|
+
devedor: { cpf: "12345678909", nome: "Fulano de Tal" },
|
|
195
|
+
solicitacaoPagador: "Servico prestado"
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
cob["txid"]
|
|
199
|
+
cob["pixCopiaECola"]
|
|
200
|
+
cob["status"] # ATIVA, CONCLUIDA, ...
|
|
201
|
+
|
|
202
|
+
# Or you choose txid (26–35 alphanumeric)
|
|
203
|
+
client.pix.create_immediate_charge(
|
|
204
|
+
txid: C6Bank::Pix.generate_txid,
|
|
205
|
+
amount: "10.50",
|
|
206
|
+
expiration: 1800
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
client.pix.find_immediate(txid)
|
|
210
|
+
client.pix.list_immediate(inicio: "2026-09-01T00:00:00Z", fim: "2026-09-18T23:59:59Z")
|
|
211
|
+
client.pix.revise_immediate(txid, valor: { original: "40.00" })
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Due-date charge (cobv)
|
|
215
|
+
|
|
216
|
+
```ruby
|
|
217
|
+
cobv = client.pix.create_due_charge(
|
|
218
|
+
amount: "250.00",
|
|
219
|
+
due_date: "2026-10-20",
|
|
220
|
+
days_after_due: 30,
|
|
221
|
+
devedor: {
|
|
222
|
+
nome: "Fulano de Tal",
|
|
223
|
+
cpf: "12345678909",
|
|
224
|
+
logradouro: "Alameda Souza, 80",
|
|
225
|
+
cidade: "Recife",
|
|
226
|
+
uf: "PE",
|
|
227
|
+
cep: "70011750"
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
client.pix.find_due(cobv.fetch("txid"))
|
|
232
|
+
client.pix.list_due(inicio: "2026-09-01T00:00:00Z", fim: "2026-09-30T23:59:59Z")
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Received Pix, refunds, webhook
|
|
236
|
+
|
|
237
|
+
```ruby
|
|
238
|
+
client.pix.list_received(inicio: "...", fim: "...")
|
|
239
|
+
client.pix.received(e2eid)
|
|
240
|
+
client.pix.refund(e2eid, refund_id, valor: "10.00")
|
|
241
|
+
|
|
242
|
+
client.pix.configure_webhook(webhook_url: "https://example.com/webhooks/c6/pix")
|
|
243
|
+
client.pix.webhook
|
|
244
|
+
client.pix.delete_webhook
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Webhook `PUT /v2/pix/webhook/{chave}` is called when a Pix **with txid** is received for that DICT key. Use HTTPS.
|
|
248
|
+
|
|
249
|
+
## Rails
|
|
250
|
+
|
|
251
|
+
See `docs/rails_initializer_example.rb`. Put the certificate files outside the git tree (or in an encrypted credential), for example `config/certs/` which you gitignore.
|
|
252
|
+
|
|
253
|
+
```ruby
|
|
254
|
+
# app/models/invoice.rb
|
|
255
|
+
def issue_c6_charge!
|
|
256
|
+
req = C6Bank.boleto_request(
|
|
257
|
+
amount: amount.to_f,
|
|
258
|
+
due_date: due_on.iso8601,
|
|
259
|
+
description: "Fatura #{id}"
|
|
260
|
+
)
|
|
261
|
+
req.payer(name: customer.name, tax_id: customer.tax_id, address: customer.c6_address)
|
|
262
|
+
response = C6Bank.boletos.create(req)
|
|
263
|
+
|
|
264
|
+
update!(
|
|
265
|
+
c6_external_id: response["external_reference_id"],
|
|
266
|
+
linha_digitavel: response.dig("payment_method", "bank_slip", "digitable_line"),
|
|
267
|
+
pix_copia_e_cola: response.dig("payment_method", "pix", "qr_code")
|
|
268
|
+
)
|
|
269
|
+
end
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Errors
|
|
273
|
+
|
|
274
|
+
| Class | When |
|
|
275
|
+
|---|---|
|
|
276
|
+
| `C6Bank::ConfigurationError` | Missing credentials, certs, or Pix key |
|
|
277
|
+
| `C6Bank::AuthenticationError` | Token call failed or HTTP 401 |
|
|
278
|
+
| `C6Bank::NotFoundError` | HTTP 404 |
|
|
279
|
+
| `C6Bank::RateLimitError` | HTTP 429 |
|
|
280
|
+
| `C6Bank::ServerError` | HTTP 5xx |
|
|
281
|
+
| `C6Bank::ApiError` | Other 4xx (`status` and `body` are on the exception) |
|
|
282
|
+
|
|
283
|
+
## Try it against sandbox
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
cp .env.example .env # then edit
|
|
287
|
+
bundle exec ruby examples/live_sandbox.rb
|
|
288
|
+
bundle exec ruby examples/boleto_cases.rb
|
|
289
|
+
bundle exec ruby examples/pix_cases.rb
|
|
290
|
+
bundle exec bin/console
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
OpenAPI dumps used to implement this gem live in `docs/openapi/` (`bolepix.yaml`, `pix-api.yaml`).
|
|
294
|
+
|
|
295
|
+
## Homologation
|
|
296
|
+
|
|
297
|
+
C6 asks partners to run the [Roteiro de Testes](https://developers.c6bank.com.br/get-started) and send evidence to `homologacaoapi@c6bank.com`. `docs/roteiro_mapping.md` maps those cases to gem methods.
|
|
298
|
+
|
|
299
|
+
Production Bolepix wallet is **15**. Sandbox wallet is **21**.
|
|
300
|
+
|
|
301
|
+
## Development
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
bundle install
|
|
305
|
+
bundle exec rspec
|
|
306
|
+
bundle exec rubocop
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Security
|
|
310
|
+
|
|
311
|
+
- Do not commit `.env`, `.crt`, `.key`, or real `client_secret` values.
|
|
312
|
+
- If a secret was pasted into chat, e-mail, or a ticket, rotate it in the C6 portal.
|
|
313
|
+
- Keep the mTLS certificate on disk with tight permissions (`chmod 600`).
|
|
314
|
+
- Prefer Rails credentials / a secret manager in production over raw env files.
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
MIT
|
data/Rakefile
ADDED
data/docs/NEXT_STEPS.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Next steps
|
|
2
|
+
|
|
3
|
+
The gem now targets the published C6 contracts:
|
|
4
|
+
|
|
5
|
+
- Auth `POST /v1/auth`
|
|
6
|
+
- Bolepix `/v2/bank_slips` (Pix QR when `pix_key` is an EVP key)
|
|
7
|
+
- Pix `/v2/pix` (cob, cobv, webhooks)
|
|
8
|
+
|
|
9
|
+
Use `.env` (see `.env.example`) and:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bundle exec ruby examples/live_sandbox.rb
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If authentication fails, the usual cause is an expired or mismatched mTLS certificate — C6 issues a `.crt` + `.key` pair together with `client_id` / `client_secret`. Replace `C6_CERT_PATH` and `C6_KEY_PATH`.
|
|
16
|
+
|
|
17
|
+
Homologation evidence: `docs/roteiro_mapping.md` + e-mail `homologacaoapi@c6bank.com`.
|