Ops...
Na verdade, deu outro erro.
Quando envio tento enviar o seguinte JSON para o banco:
{
"pay_method":"payfast",
"value":"10.98",
"currency":"BRL",
"description":"criando um pagamento"
}
Recebo o status 200. Porém, nada é gravado no banco e no console da aplicação é exibida esta mensagem:
`
D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\protocol\Parser.js:80
throw err; // Rethrow non-MySQL errors
^
TypeError: "value" argument must not be a number
at Function.Buffer.from (buffer.js:186:11)
at Object.Auth.token (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\protocol\Auth.js:29:29)
at Handshake.sendCredentials (D:\Practice\NodeJS-practice\Alura\payfast\nodemodules\mysql\lib\protocol\sequences\Handshake.js:99:14)
at Handshake.HandshakeInitializationPacket (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\protocol\sequences\Handshake.js:81:10)
at Protocol.parsePacket (D:\Practice\NodeJS-practice\Alura\payfast\nodemodules\mysql\lib\protocol\Protocol.js:278:23)
at Parser.write (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\protocol\Parser.js:76:12)
at Protocol.write (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\protocol\Protocol.js:38:16)
at Socket. (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\Connection.js:91:28)
at Socket. (D:\Practice\NodeJS-practice\Alura\payfast\node_modules\mysql\lib\Connection.js:502:10)
at emitOne (events.js:116:13)
[nodemon] app crashed - waiting for file changes before starting...
`