/** * Request a PagSeguro Cancel * * @param $config * @return \PagSeguro\Parsers\Cancel\Response * @throws \Exception */ private function requestCancel($config) { \PagSeguro\Configuration\Configure::setEnvironment($this->_library->getEnvironment()); try { return \PagSeguro\Services\Transactions\Cancel::create($this->_library->getPagSeguroCredentials(), $config->pagseguro_id); } catch (\Exception $exception) { throw $exception; } }
/** * Set the environment configured in the PagSeguro module */ public function setEnvironment() { \PagSeguro\Configuration\Configure::setEnvironment($this->_scopeConfig->getValue('payment/pagseguro/environment')); }