BTCPrivate / btcp-widget

JS widget for online shop payments
5 stars 2 forks source link

Bitcoin URI not pointing to req handling server? #40

Open mattpass opened 6 years ago

mattpass commented 6 years ago

When we have a bitcoin URI such as: bitcoin:b1BpgPewXjPLLSVh8Rh2gAJniAfp7PgXjKg?amount=0.1&message=Pepperoni%20Pizza&r=http://filestore.net ...and use within Electrum, it complains about the address not being valid (which is understandable), but if that is resolved, the other error it complains about is: Electrum error re URL passed in URI invoice error: payment URL not pointing to a payment request handling server

mattpass commented 6 years ago

Think this needs more looking into and the 'r' querystring param is not a 'referrer' but 'request' server, so removing from v1 usage and to look more into in v2 onwards.

mattpass commented 6 years ago

Old version for reference, now removed 'r' key/value from URI:

btcpWidget.btcpURI = 'bitcoin:'+encodeURI(btcpWidget.data.wallet)+
          '?amount='+encodeURI(btcpWidget.data.amount)+
          '&message='+encodeURI(btcpWidget.data.description)+
          '&r='+encodeURI(btcpWidget.getLocation(window.location).origin);