added test and implementation for charging and creating a transaction