コード例 #1
0
 public static function init()
 {
     if (self::$resources == null) {
         self::$resources = new PagSeguroResources();
     }
     return self::$resources;
 }
 private function __construct()
 {
     self::$path = dirname(__FILE__);
     PagSeguroAutoloader::init();
     self::$resources = PagSeguroResources::init();
     self::$config = PagSeguroConfig::init();
     self::$log = LogPagSeguro::init();
 }
コード例 #3
0
 private function __construct()
 {
     self::$path = dirname(__FILE__);
     if (function_exists('spl_autoload_register')) {
         require_once "loader" . DIRECTORY_SEPARATOR . "PagSeguroAutoLoader.class.php";
         PagSeguroAutoloader::init();
     } else {
         require_once "loader" . DIRECTORY_SEPARATOR . "PagSeguroAutoLoader.php";
     }
     self::$resources = PagSeguroResources::init();
     self::$config = PagSeguroConfig::init();
     self::$log = LogPagSeguro::init();
 }
コード例 #4
0
 public function __construct()
 {
     if (self::verifyDependencies()) {
         if (self::$library == null) {
             self::$path = dirname(__FILE__);
             PagSeguroAutoloader::init();
             self::$resources = PagSeguroResources::init();
             self::$config = PagSeguroConfig::init();
             self::$log = LogPagSeguro::init();
             self::$library = $this;
         }
     }
     return self::$library;
 }
コード例 #5
0
 public function __construct(Credentials $credentials, $serviceName)
 {
     $this->credentials = $credentials;
     $this->serviceName = $serviceName;
     $this->setEnvironment(PagSeguroConfig::getEnvironment());
     $this->setWebserviceUrl(PagSeguroResources::getWebserviceUrl($this->getEnvironment()));
     $this->setCharset(PagSeguroConfig::getApplicationCharset());
     $this->resources = PagSeguroResources::getData($this->serviceName);
     if (isset($this->resources['servicePath'])) {
         $this->setServicePath($this->resources['servicePath']);
     }
     if (isset($this->resources['serviceTimeout'])) {
         $this->setServiceTimeout($this->resources['serviceTimeout']);
     }
 }
コード例 #6
0
 public static function getStaticUrl()
 {
     return PagSeguroResources::getStaticUrl(self::$data['environment']);
 }
コード例 #7
0
 public function __construct(PagSeguroCredentials $credentials, $serviceName)
 {
     $this->credentials = $credentials;
     $this->serviceName = $serviceName;
     try {
         $this->setEnvironment(PagSeguroConfig::getEnvironment());
         $this->setWebserviceUrl(PagSeguroResources::getWebserviceUrl($this->getEnvironment()));
         $this->setPaymentUrl(PagSeguroResources::getPaymentUrl($this->getEnvironment()));
         $this->setBaseUrl(PagSeguroResources::getBaseUrl($this->getEnvironment()));
         $this->setInstallmentUrl(PagSeguroResources::getInstallmentUrl());
         $this->setAuthorizationUrl(PagSeguroResources::getAuthorizationUrl());
         $this->setSessionUrl(PagSeguroResources::getSessionUrl());
         $this->setCharset(PagSeguroConfig::getApplicationCharset());
         $this->resources = PagSeguroResources::getData($this->serviceName);
         if (isset($this->resources['servicePath'])) {
             $this->setServicePath($this->resources['servicePath']);
         }
         if (isset($this->resources['serviceTimeout'])) {
             $this->setServiceTimeout($this->resources['serviceTimeout']);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }