Example #1
0
 public static function Init($publicKey, $privateKey, $productKey, $baseUrl = NULL)
 {
     if (self::$_initialized) {
         throw new AffirmException("Cannot be initialized twice.");
     }
     if ($baseUrl) {
         self::$_baseUrl = $baseUrl;
     }
     if (substr(self::$_baseUrl, -1) == "/") {
         self::$_baseUrl = substr(self::$_baseUrl, 0, -1);
     }
     self::$_publicKey = $publicKey;
     self::$_privateKey = $privateKey;
     self::$_productKey = $productKey;
     self::$_initialized = TRUE;
     Charge::_init();
 }