title: How to store ETH in the Smart Contract?
body: <p>I'm writing a LibraryPortal Smart Contract in which multiple users can rent their books to each other. So, in this contract the <code>msg.value</code> contain the total amount which is a combination of the Security Deposit &amp; the Renting Rate.</p>
  
  <p>What I have to do is transfer the Renting amount to the owner of the book instantly &amp; store the remaining amount in the contract i.e., the Security Deposit.</p>
  
  <p>If the Renter will not return the book with in the time specified then the security amount will be transfered to the Owner of the book, otherwise get returned to the Renter.</p>
  
  <p>Here is my snippet:</p>
  
  <pre><code>function borrowBook(string _bName) payable returns (string){
      if(msg.sender != books[_bName].owner){
          if(books[_bName].available == true){
              if(getBalance()&gt;=(books[_bName].amtSecurity + books[_bName].rate) ){
                  books[_bName].borrower = msg.sender;
                  books[_bName].available = false;
                  books[_bName].owner.transfer(msg.value - books[_bName].amtSecurity);
                  //  Code missing
                  //  For storing
                  //  ETH into the Contact
                  return "Borrowed Succesful";
              }else{
                  return "Insufficient Fund";
              }
          }else{
              return "Currently this Book is Not Available!";
          }
      }else{
          return "You cannot Borrow your own Book";
      }
  }
  </code></pre>