From ae01e727769654f08524201aa1f46127e6030755 Mon Sep 17 00:00:00 2001 From: hueso Date: Fri, 2 May 2025 13:43:38 -0300 Subject: [PATCH] mTLS --- README.md | 4 +--- bbpay.py | 10 ++++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cac61bd..52683a5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ ## Variáveis de ambiente necessárias no arquivo `.env`: -- `BB_CLIENT_ID`, -`BB_CLIENT_SECRET`, e -`DEV_APP_KEY`: Fornecidas pelo Bando do Brasil +- `BB_CLIENT_ID`, `BB_CLIENT_SECRET`, e `DEV_APP_KEY`: Fornecidas pelo Banco do Brasil - `PRIVATE_KEY`: Chave privada Ethereum (em formato hexadecimal com prefixo '0x') diff --git a/bbpay.py b/bbpay.py index 4fb9018..3f9ff58 100755 --- a/bbpay.py +++ b/bbpay.py @@ -35,13 +35,14 @@ class BBPay(Resource): self.oauth.fetch_token( token_url='https://oauth.hm.bb.com.br/oauth/token', client_id=getenv("CLIENT_ID"), - client_secret=getenv("CLIENT_SECRET"), scope=scope) + client_secret=getenv("CLIENT_SECRET"), scope=scope, + cert='cert.pem') # Url de homologação com autenticação mTLS. - #self.baseUrl = "https://api-bbpay.hm.bb.com.br/checkout/v2" + self.baseUrl = "https://api-bbpay.hm.bb.com.br/checkout/v2" # Url de homologação sem autenticação mTLS. - self.baseUrl = "https://api.extranet.hm.bb.com.br/checkout/v2" + #self.baseUrl = "https://api.extranet.hm.bb.com.br/checkout/v2" # Url de produção com autenticação mTLS. #self.baseUrl = "https://api-bbpay.bb.com.br/checkout/v2" @@ -70,7 +71,8 @@ class Register(BBPay): self.baseUrl+"/participantes", params=self.params, json=body, - verify=self.verify_ssl) + verify=self.verify_ssl, + cert='cert.pem') return response.json() class Request(BBPay):