Compare commits
4 Commits
925002c572
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e8792bc5c | ||
|
|
98707fce2b | ||
|
|
b2ee0fe37f | ||
|
|
b16b9d4fb2 |
10
bbpay.py
10
bbpay.py
@@ -54,7 +54,7 @@ class BBPay(Resource):
|
|||||||
|
|
||||||
class Register(BBPay):
|
class Register(BBPay):
|
||||||
def post(self):
|
def post(self):
|
||||||
data = request.get_json()
|
data = request.get_json(force=True)
|
||||||
app.logger.debug(data)
|
app.logger.debug(data)
|
||||||
body = {
|
body = {
|
||||||
'numeroConvenio': getenv("BBPAY_CONVENIO"),
|
'numeroConvenio': getenv("BBPAY_CONVENIO"),
|
||||||
@@ -80,7 +80,7 @@ class Register(BBPay):
|
|||||||
|
|
||||||
class Request(BBPay):
|
class Request(BBPay):
|
||||||
def post(self):
|
def post(self):
|
||||||
data = request.get_json()
|
data = request.get_json(force=True)
|
||||||
app.logger.debug(data)
|
app.logger.debug(data)
|
||||||
body = {
|
body = {
|
||||||
"geral": {
|
"geral": {
|
||||||
@@ -88,7 +88,7 @@ class Request(BBPay):
|
|||||||
"pagamentoUnico": True,
|
"pagamentoUnico": True,
|
||||||
"descricaoSolicitacao": "P2Pix",
|
"descricaoSolicitacao": "P2Pix",
|
||||||
"valorSolicitacao": data['amount'],
|
"valorSolicitacao": data['amount'],
|
||||||
"codigoConciliacaoSolicitacao": data['lockid']
|
#"codigoConciliacaoSolicitacao": data['lockid']
|
||||||
},
|
},
|
||||||
# "devedor": {
|
# "devedor": {
|
||||||
# "tipoDocumento": 1,
|
# "tipoDocumento": 1,
|
||||||
@@ -117,7 +117,7 @@ class Request(BBPay):
|
|||||||
|
|
||||||
class Release(BBPay):
|
class Release(BBPay):
|
||||||
def get(self, numeroSolicitacao):
|
def get(self, numeroSolicitacao):
|
||||||
app.logger.debug(request.get_json())
|
app.logger.debug(request.get_data(as_text=True))
|
||||||
response = self.oauth.get(
|
response = self.oauth.get(
|
||||||
self.baseUrl+f"/solicitacoes/{numeroSolicitacao}",
|
self.baseUrl+f"/solicitacoes/{numeroSolicitacao}",
|
||||||
params=self.params,
|
params=self.params,
|
||||||
@@ -167,7 +167,7 @@ api.add_resource(Release, '/release/<int:numeroSolicitacao>')
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if getenv("DEBUG"):
|
if getenv("DEBUG"):
|
||||||
disable_warnings()
|
disable_warnings()
|
||||||
app.run(host='::1',debug=True)
|
app.run(host='::1', debug=True, port=getenv("PORT",5000))
|
||||||
else:
|
else:
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
serve(app, host=getenv("HOST","::1"), port=getenv("PORT",5000))
|
serve(app, host=getenv("HOST","::1"), port=getenv("PORT",5000))
|
||||||
|
|||||||
Reference in New Issue
Block a user