-I am trying to transfer ether from one account to another using smart contract which is deployed on azure.
-when I call receiverAddress.send(amount)
in the function in my contract it returns the transaction receipt/ acknowledgement in json format.
-My account get debited by amount I specified but the receivers account is not credited.
the receipt shows from :myAddress
ie. sender address
and to:contract address
-I don't understand why the to field has a contract address when I am calling receiverAddress.send(amount)
-Is there any thing I am missing or I need to transfer that ether from contact to the receivers account??
-Bellow is the snippet of transaction receipt:-
-function from contract
function sendPayment(address beneficiary,uint amount){
coin-=amount;
if (beneficiary.send(amount))
throw;
}
this is code of contract:
`pragma solidity ^0.4.4;
import "./strings.sol";
contract SDFFinance {
using strings for *;
address addr;
address public driver1;
address public driver2;
address public driver3;
string statusOf;
uint coin;
function SDFFinance(uint balance) {
coin=balance;
driver1=0x1b7207197717fe2114d3d22f38c81d980e74e13a;
driver2=0x1b7207197717fe2114d3d22f38c81d980e74e13a;
driver3=0x1b7207197717fe2114d3d22f38c81d980e74e13a;
statusOf='OPN';
}
function changeShipmentStatus(string shipmentId,string st){
statusOf=st;
processPayment();
}
function processPayment(){
if(statusOf.toSlice().equals('RAP'.toSlice())){
sendPayment(driver1);
}
else if(statusOf.toSlice().equals('DAL'.toSlice())){
sendPayment(driver2);
}
else
if(statusOf.toSlice().equals('ATD'.toSlice())){
sendPayment(driver3);
}
}
function sendPayment(address beneficiary) payable returns(bool success) {
if(msg.value==0) throw;
if(!beneficiary.send(msg.value)) throw;
return true;
}
function getBalance() returns(uint){
return coin;
}
function getStatus() returns(string){
return statusOf;
}
function getAddress() returns(address){
return addr;
}
}`