diff --git a/bbpay.py b/bbpay.py index 07b9041..8a9ae1f 100755 --- a/bbpay.py +++ b/bbpay.py @@ -113,6 +113,8 @@ class Release(BBPay): self.baseUrl+f"/solicitacoes/{numeroSolicitacao}", params=self.params, verify=self.verify_ssl) + if response.status_code != 200: + return 'Upstream error', response.status_code data = response.json() numeroParticipante = data['repasse']['recebedores'][0]['identificadorRecebedor'] pixTimestamp = b85decode(data['informacoesPix']['txId']) @@ -124,6 +126,8 @@ class Release(BBPay): self.baseUrl+f"/participantes/{numeroParticipante}", params=self.params, verify=self.verify_ssl) + if response.status_code != 200: + return 'Upstream error', response.status_code chainID = response.json()['nomeParticipante'] packed = encode_packed(['bytes32','uint80','bytes32'], (f"{chainID}-{numeroParticipante}".encode(), int(valorSolicitacao), pixTimestamp) )