OPSkins / node-opskins-api

JavaScript SDK for OPSkins' HTTP API
https://opskins.com
MIT License
27 stars 13 forks source link

Bad or missing cashout amount #18

Closed Duzbee closed 6 years ago

Duzbee commented 6 years ago

I have ~$1600 cashoutable balance on my account.

opskins[bot].requestPayPalCashout(600, false, function(err, cashoutid, address, priority) { ... }

And I get this error:

{ Error: Bad or missing cashout amount. x x xx socket > at ClientRequest.<anonymous> (/server/socket/node_modules/@opskins/api/index.js:103:13) x x xx socket > at ClientRequest.g (events.js:292:16) x x xx socket > at emitOne (events.js:96:13) x x xx socket > at ClientRequest.emit (events.js:188:7) x x xx socket > at HTTPParser.parserOnIncomingClient (_http_client.js:474:21) x x xx socket > at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23) x x xx socket > at TLSSocket.socketOnData (_http_client.js:363:20) x x xx socket > at emitOne (events.js:96:13) x x xx socket > at TLSSocket.emit (events.js:188:7) x x xx socket > at readableAddChunk (_stream_readable.js:176:18) x x xx socket > httpCode: 200, x x xx socket > code: 3000, x x xx socket > message: 'Bad or missing cashout amount.' }

I tried using parseInt to make sure, I tried changing the priority argument to 0 and even removing it. None of these worked.

Duzbee commented 6 years ago

I just realised that the amount needs to be divisible by 5. I fixed it like this: Math.floor(amountToCashout / 500) * 500