Name = $name; // create database handle $this->Database = new \Config\Database('imagingx_docassyst'); try { $this->DatabaseConnection = $this->Database->getConnection(); } catch (Exception $e) { throw $e; } // read config $statement = $this->DatabaseConnection->prepare( "SELECT config FROM broker WHERE name = '$this->Name'" ); $statement->execute(); $results = $statement->fetchAll(\PDO::FETCH_ASSOC); if(count($results) == 0) { throw new \Exception("BraintreeBroker init failed"); } else { $this->Config = json_decode($results[0]['config']); } $this->init(); } /** * */ abstract protected function init(); /** * */ abstract public function getToken($User); /** * */ abstract public function submit($User, $token, $amount); }