I am currently learning solidity and I have created a smart contract that can handle transfer of ERC-20 token from one address to another. But I have encountered a problem wherein the token is being transferred to the contract address instead of the wallet address.
Please see code below
require(msg.value >= transactionDetails.converted_amount);
transactionDetails.token.transfer(payable(wallet_address), transactionDetails.converted_amount);
transactions[transactionID] = transactionDetails;
transaction_list.push(transactionID);