Lib for create and show QRCode to PIX, you can show this code in another applications for payment by final consumer.

Overview

Pix QRCode - Python

Versao: 1.0

Biblioteca para a geração de codigos QR (BRCode como chamados na documentação do BACEN) a fins de facilitar a exibição para pagamentos ao consumidor.

O que é pix

Pix é o meio de pagamento eletrônico instantâneo, gratuito e com segurança, do Brasil. A iniciação de um Pix para uma pessoa física é gratuita. Wikipedia

Isenção de responsabilidade

Os QR codes não foram testados aos bancos, sempre antes de transferir verifique se as informações estão corretas. O autor e contribuidores se isenta de qualquer responsabilidade pela exatidão e integridade das informações divulgada.

Documentação de implementação BACEN - Banco Central do Brasil

Manual BRCode

Especificações técnicas e de negócio do ecossistema de pagamentos instantâneos brasileiro

Github Bacen

NÃO EXISTE NENHUMA INTEGRAÇÃO COM BANCOS


Exemplo basico

Importe a biblioteca do pip pip install pixqrcode

Importe a classe from pixqrcode import PixQrCode e defina os parametros como abaixo

Obrigatorio

  • name = Nome do destinatario
  • mobile (Chave PIX) = Telefone do destinatario Em Breve mais chaves
  • city = Cidade de remetente

Opcional

  • amount = Valor a ser enviado

    Valores serão sempre contados com 3 casas decimais e tem todos os digitos não numericos removidos, exemplos abaixo

    • R$ 1,00 = 100
    • R$ 10,00 = 1000
  • reference_label = Código da transferência. Codigo não obrigatorio mais pode auxiliar em casos como ecommerce e vendas diretas por Pix

    pix = PixQrCode("Fulano De Tal", "(70) 97070-7070", "Brasilia", "100")

Retorno do QRCode e codigo BRCode

seguimos com o objeto de cima definido iremos chamar os metodos e suas funções

Metodos

is_valid()

Verifica se todos os campos inseridos são validos e pode seguir com a geração do QRCode. Retorna um valor boolean

export_base64()

Retorna direto em formato base64 tipo imagem PNG (Portable Network Grapich) para ser renderizado dentro de uma tag img HTML ou ser transportado por uma API e demais usos.

pix.export_base64()

qrcode pagamento

save_qrcode(folder, filename, **kwargs)

pix.save_qrcode("/pixs","pix-fulano")

Caso queira você pode salvar o codigo gerado em uma pasta com um nome especifico para ter o codigo. Não precisa especificar o formato do arquivo sempre será PNG

Pode retornar o valor dentro BufferIO para ser novamente processado.

A geração do QRCode é feita com a biblioteca Pillow então você pode utilizar para deixar seu QRCode ainda mais personalizado passando os parametros por **kwargs

generate_code()

Irá retornar a string com a qual foi gerado o QRCode contendo os valores todos em suas posições como descrito na documentação do BACEN

Exemplos

Contem mais exemplos para facilitar a sua implementação

  1. API Dockerfile - port 8000
  2. Console

Em breve mais...

Toda contribuição é bem vinda!

Owner
João Camargo
Follow me: Twitter: @mostela_ Instagram: @_mostela_
João Camargo
Python wrapper to simplify calls to AncestryDNA API.

AncestryDNA API wrapper Ancestry exposes an undocumented REST API for its DNA features. This Python wrapper inventories the available calls, and expos

Matt 2 Jun 10, 2022
Unfollows Users You're Following

Github-Unfollow-Bot Info It unfollows users you're following, it runs in the background so you can still do what you do without it bothering you. It's

ExT 4 Sep 03, 2022
This script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin.

BOOKING IN BERLINS VACCINATION CENTERS This python script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin. T

17 Jan 13, 2022
A simple anti-ghostping python bot made using diskord.

Anti Ghostping A simple Anti-Ghostping python bot made with ❤ using Diskord Requirements No one will use this but, all you need for this bot is: Pytho

RyZe 2 Sep 12, 2022
Centralized whale instance using github actions, sourcing metadata from bigquery-public-data.

Whale Demo Instance: Bigquery Public Data This is a fully-functioning demo instance of the whale data catalog, actively scraping data from Bigquery's

Hyperquery 17 Dec 14, 2022
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022
Herramienta para transferir eventos de Sucuri WAF hacia Azure Blob Storage.

Transfiere eventos de Sucuri hacia Azure Blob Storage Script para transferir eventos del Sucuri Web Application Firewall (WAF) hacia Azure Blob Storag

CSIRT-RD 1 Dec 22, 2021
a small cli to generate AWS Well Architected Reports on the road

well-architected-review This repo intends to publish some scripts related to Well Architected Reviews. war.py extracts in txt & xlsx files all the WAR

4 Mar 18, 2022
Queen Zellie is a chat bot for Telegram.

🧝‍♀️ 💙 Queen Zellei 💙 🧝‍♀️ Queen Zellie is a chat bot for Telegram. Make it easy and fun to use Telegram. Telegram | Telegram Channel | Whatsapp H

Sinhalaya Official 4 Dec 18, 2021
Huan Xu 1.6k Jan 04, 2023
Github integration with Telegram

The Telegram bot myGit is your GiHub assistant. In your conversations with your team, you can simply insert the information about the projects you are working at.

Alexandru Buzescu 2 Jan 06, 2022
A telegram mirror bot with an integrated RSS feed reader.

About What is this repo? This is a slightly modified fork which includes some extra features & memes added to my liking. How's this different from the

11 May 15, 2022
A python package to easy the integration with Direct Online Pay (Mpesa, TigoPesa, AirtelMoney, Card Payments)

python-dpo A python package to easy the integration with Direct Online Pay (DPO) which easily allow you easily integrate with payment options once wit

NEUROTECH 15 Oct 08, 2022
A repo to automate the booking process for vaccinations

OntarioVaccineFormAutomaker A repo to automate the booking process for vaccinations Requirements Allow ALL sights to be able to know your location (on

Rafid Dewan 7 May 31, 2021
A Discord Token Spammer, multi webhooks compatibility, made in python +3.7. By Ezermoz

DiscordWebhookSpammer A Discord Token Spammer, multi webhooks compatibility, made in python +3.7. By Ezermoz Put you webhook in webhooks.txt if you wa

3 Nov 24, 2021
Python lib for Embedly

embedly-python Python library for interacting with Embedly's API. To get started sign up for a key at embed.ly/signup. Install Install with Pip (recom

Embedly 80 Oct 05, 2022
Best Buy purchase bot

B3 Best-Buy-Bot. Written in Python NOTICE: Don't be a disgrace to society. Don't use this for any mass buying/reselling purposes. About B3 is a bot th

Dogey11 8 Aug 15, 2022
PESU Academy Discord Bot built for PESsants and PESts of PES University

PESU Academy Bot PESU Academy Discord Bot built for PESsants and PESts of PES University You can add the bot to your Discord Server using this link. O

Aditeya Baral 0 Nov 16, 2021
This repository is used to simplify the process of cloning the SSM documents across the AWS regions.

SSM Cloner Introduction This module is created in order to simplify the process of copying the SSM documents from one region to another regions. As an

6 Jun 04, 2022
Async boto3 with Autogenerated Data Classes

awspydk Async boto3 with Autogenerated JIT Data Classes Motivation This library is forked from an internal project that works with a lot of backend AW

1 Dec 05, 2021