https://github.com/jonatanrdsantos/elixir-inter-sdk
This is a simple wrapper around the Banco Inter's API - a Brazilian digital banking.
https://github.com/jonatanrdsantos/elixir-inter-sdk
banco-inter banco-inter-elixir-sdk elixir inter-elixir inter-sdk
Last synced: about 1 year ago
JSON representation
This is a simple wrapper around the Banco Inter's API - a Brazilian digital banking.
- Host: GitHub
- URL: https://github.com/jonatanrdsantos/elixir-inter-sdk
- Owner: jonatanrdsantos
- Created: 2023-10-14T22:37:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T23:01:00.000Z (over 1 year ago)
- Last Synced: 2025-04-10T07:02:15.604Z (about 1 year ago)
- Topics: banco-inter, banco-inter-elixir-sdk, elixir, inter-elixir, inter-sdk
- Language: Elixir
- Homepage:
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Inter
This is a simple wrapper around the Banco Inter's API - a Brazilian digital banking.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `inter` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:inter, "~> 0.1.1"}
]
end
```
Usage:
```elixir
api_key = "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQ8Z4ZQ8Z4ZQ8Z\n-----END PRIVATE KEY-----\n"
api_cert = "-----BEGIN CERTIFICATE-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQ8Z4ZQ8Z4ZQ8Z\n-----END CERTIFICATE-----\n"
grant_type = "client_credentials"
scope = "pix.write pix.read webhook.read webhook.write cob.write pagamento-pix.write"
client_secret = "secret"
client_id = "client_id"
pix_charge_request = %Inter.Pix.Charge.Request{
calendario: %Inter.Pix.Charge.Request.Calendario{
expiracao: 3600
},
devedor: %Inter.Pix.Charge.Request.Devedor{
cpf: "40894943030",
nome: "Jhon Doe"
},
valor: %Inter.Pix.Charge.Request.Valor{
original: "5.00",
modalidadeAlteracao: 1
},
infoAdicionais: [
%Inter.Pix.Charge.Request.InfoAdicional{
nome: "meu campo adicional",
valor: "algum valor 🤩"
},
%Inter.Pix.Charge.Request.InfoAdicional{
nome: "meu campo adicional",
valor: "algum valor 🤩"
},
%Inter.Pix.Charge.Request.InfoAdicional{
nome: "meu campo adicional",
valor: "algum valor 🤩"
},
],
chave: "46650032907724"
}
Inter.Client.new(client_id, client_secret, scope, grant_type, api_cert, api_key)
|> Inter.pix_charge(pix_charge_request)
```
**How to run locally?**
- `docker compose run --rm app bash`
- `mix deps.get` to install the dependencies
- `iex -S mix` to open the elixir REPL
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at .