Developers Forum for XinFin XDC Network

Discussion on: Unable to call payable function from Remix, XDCPay and send funds

Collapse
ruslan_wing profile image
ruslan wing

Can you please share your contract or the buyTokens function code over here to understand more about your issue

Collapse
ayyalu profile image
Ayyalusamy Ramadoss Author

function buyTokens(address beneficiary) public payable {
uint256 tokens = msg.value * 10;
_token.transferFrom(_wallet, beneficiary, tokens);
emit TokensPurchased(_msgSender(), beneficiary, msg.value, tokens);
_forwardFunds();
}