title: inpage.js:1 Uncaught Error: invalid address
body: <p>This is my contract</p>
  
  <pre><code>pragma solidity ^0.5.11;
  contract test{
  mapping(string =&gt; address payable) pizzaPlace;
  address contractOwner;
  address payable userWallet;
  constructor() public{
      contractOwner=msg.sender;
      pizzaPlace["piaazOne"]=0xd806F6b4888ff997dB4A073fD9EdD40ab92BCbD4;
  }
  function paymentHandlerer() public payable returns(bool){
          userWallet = pizzaPlace["pizzaOne"];
          userWallet.transfer(msg.value);
          return true;
  }
  function showMessage() public view returns(string memory){
      return "Hello Solidity";
  }
  </code></pre>
  
  <p>I have been learning solidity for a while but this is something I seem not to tackle.
  The above contract was written in remix and I am using Ganache on my local machine to deploy contracts.</p>
  
  <p>Following is my code for function call:</p>
  
  <pre><code>const contractAddress = '0xEe1C4287b37de1ADFE2aD78C7B7c96D7694093cb';
  const contractAbi=[...];
  var contract = web3.eth.contract(contractAbi).at(contractAddress);
  contract.showMessage(function (error, message) {
      $("#targetText").html(message);
  });
  const btn = document.querySelector("#sendEtherBtn");
  btn.addEventListener("click", function () {
  contract.paymentHandlerer(
  {"to":contractAddress,
   "from":web3.eth.accounts[0],
   "value":web3.toWei("10.0","ether")
  });
  });
  </code></pre>
  
  <p>When I run this code. The function showMessage() does get called as I see the message "Hello Solidity" on my browser screen. This proves that the contract is running fine. In the second function, I want to transfer some ether from msg.sender to the receiver but the function runs into an error all the time.</p>
  
  <p>The error goes like this:</p>
  
  <pre><code>Uncaught Error: invalid address
  at c (inpage.js:1)
  at inputTransactionFormatter (inpage.js:1)
  at inpage.js:1
  at Array.map (&lt;anonymous&gt;)
  at o.formatInput (inpage.js:1)
  at o.toPayload (inpage.js:1)
  at w.e [as sendTransaction] (inpage.js:1)
  at u.sendTransaction (inpage.js:1)
  at u.execute (inpage.js:1)
  at HTMLButtonElement.&lt;anonymous&gt; (index.html:101)
  </code></pre>
  
  <p>Can anyone please help me solve it.
  Also, I am not using node js or anything just plain Js and JQuery</p>