Electron-Cash: payment request fails - payment requests are not working at the moment

Payload to send to Electrum:

{'params': {'amount': 0.0021651117760957575, 'expiration': 1212}, 'method': 'addrequest', 'id': 'c6cf406e-0c4b-4eb7-b3d2-1712a4d3a553'}

Data received back from Electrum:

{'error': {'message': 'Invalid parameters: string argument without an encoding', 'code': -32602}, 'result': None, 'id': '2fd03026-d1ba-49c0-b781-dd30ee758c8d'}

This but looks similar to https://github.com/spesmilo/electrum/issues/3411 but it is not that simple, as with that patch electron-cash says:

{'error': {'message': 'Invalid parameters: b\'\\xfc\\\'w|.W\\xeb\\xd5\\xa3u\\x8a\\xc3\\x81v\\x91\\x7f\\x9c"\\xa7\\xd1\' is not JSON serializable', 'code': -32602}, 'result': None, 'id': '9e20dac3-52ac-4ace-b2c2-51f5cf2087b6'}

It looks roots of this issue are much deeper, unfortunately.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 35

Most upvoted comments

Extremely useful as you can keep all memo fields across instances and installations. Server is pretty simple and code is public, electrum uses your MPK to encrypt data before sending to the server.

I did no work. It’s all marcel.

@rt121212121 and @marceloneil thanks for work on this, please contact me on richard@trustless.io re bounty.

I can confirm that PR#786 fixes the problem, thanks 👍

@marceloneil my point is that you need certs configured in order to reproduce this bug.

From a quick search the error string argument without an encoding seems to come from using the bytearray() function incorrectly. In paymentrequest.py all the uses of that function seem to be inside methods dealing with certs and sigs.

I have additionally websockets activated which you don’t have, if it changes anything?

Current master does not work for me, python 3.5, the json library same as yours.

I’d like to offer a 1 BCH bounty, provided the fix can be released by end of coming weekend. Happy to pay in advance. Also looking for paid support to integrate to a Node app next week.

There is an example payment request on here: http://docs.electrum.org/en/latest/merchant.html

Additionally it seems like he’s using JSON-RPC to interact with the daemon, but correct me if I’m wrong @ser

If it gets fixed, I will include electron cash into https://github.com/spesmilo/electrum-merchant