Após enviar a requisição curl com um pagamento de cartão, o meu cmd responde como esperado, mas o nodemon do payfast dá um erro de HTTP, conforme segue (usei a versão do restify do curso):
1) Requisição e Retorno no cmd: C:\Users\Pantufa\payfast>curl http://localhost:3000/pagamentos/pagamento -X POST -v -H "Content-type: application/json" -d @pagamento.json Note: Unnecessary use of -X or --request, POST is already inferred.
- Trying ::1...
- TCP_NODELAY set
- Connected to localhost (::1) port 3000 (#0)
POST /pagamentos/pagamento HTTP/1.1 Host: localhost:3000 User-Agent: curl/7.63.0 Accept: / Content-type: application/json Content-Length: 298
- upload completely sent off: 298 out of 298 bytes < HTTP/1.1 201 Created < X-Powered-By: Express < Content-Type: application/json; charset=utf-8 < Content-Length: 101 < ETag: W/"65-ww47io0UpeCwAJjWx4HATdU9utw" < Date: Sat, 29 Dec 2018 00:49:30 GMT < Connection: keep-alive < {"numero":1234123412341234,"bandeira":"visa","ano_de_expiracao":2016,"mes_de_exp iracao":12,"cvv":123}* Connection #0 to host localhost left intact
3) erro no nodemon: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the cli ent at ServerResponse.setHeader (httpoutgoing.js:470:11) at ServerResponse.header (C:\Users\Pantufa\payfast\node_modules\express\libresponse.js:767:10) at ServerResponse.location (C:\Users\Pantufa\payfast\node_modules\express\li b\response.js:884:15) at C:\Users\Pantufa\payfast\controllers\pagamentos.js:124:19 at parseResponse (C:\Users\Pantufa\payfast\node_modules\restify\lib\c lients\string_client.js:165:13) at Object.onceWrapper (events.js:273:13) at IncomingMessage.emit (events.js:187:15) at endReadableNT (streamreadable.js:1094:12) at process.tickCallback (internal/process/nexttick.js:63:19) [nodemon] app crashed - waiting for file changes before starting...
`