I had been using remix IDE for a long time but recently switched to using Truffle. Everything else was fine until I had to build a function for payment. In remix IDE, there is a box provided, labelled "value" that takes values in wei and is used to transfer ether from one to another address. I don't understand how can I do the same using msg.value when there is no way to get that value for the function. Below is the code I am using:
function payment(address payable _ID) external payable {
_ID.transfer(msg.value);
}
I just want to know, when using truffle, how can I pass required amount in msg.value. If it isn't possible, is there any other way to transfer an amount that can be assigned dynamically in place of msg.value? like this (Solidity 0.5):
function payment(address payable _ID, uint _amount) external payable {
_ID.transfer(_amount);
}