New York-based Soltas Energy Corp. has agreed to pay $330,000 over allegations it caused two Massachusetts towns and two nonprofit organizations to lose thousands of dollars in energy savings when it failed to honor agreements to sell them net metering credits, Attorney General Maura Healey said Thursday.