Added logic in charge and webhook for environment