@@ -8,40 +8,40 @@ discard block |
||
| 8 | 8 | class FoxyCart |
| 9 | 9 | { |
| 10 | 10 | |
| 11 | - private static $keyPrefix = 'dYnm1c'; |
|
| 12 | - |
|
| 13 | - public static function setStoreKey($length = 54, $count = 0){ |
|
| 14 | - $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.strtotime('now'); |
|
| 15 | - $strLength = strlen($charset); |
|
| 16 | - $str = ''; |
|
| 17 | - while($count < $length){ |
|
| 18 | - $str .= $charset[mt_rand(0, $strLength-1)]; |
|
| 19 | - $count++; |
|
| 20 | - } |
|
| 21 | - return self::getKeyPrefix().substr(base64_encode($str),0,$length); |
|
| 22 | - } |
|
| 23 | - |
|
| 24 | - public static function getStoreKey(){ |
|
| 25 | - $config = SiteConfig::current_site_config(); |
|
| 26 | - if($config->StoreKey){ |
|
| 27 | - return $config->StoreKey; |
|
| 28 | - } |
|
| 29 | - return null; |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public static function store_name_warning(){ |
|
| 33 | - $warning = null; |
|
| 34 | - if(self::getFoxyCartStoreName()===null){ |
|
| 35 | - $warning = 'Must define FoxyCart Store Name or Store Remote Domain in your site settings in the cms'; |
|
| 36 | - } |
|
| 37 | - return $warning; |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - public static function getFoxyCartStoreName(){ |
|
| 41 | - $config = SiteConfig::current_site_config(); |
|
| 42 | - if ($config->CustomSSL) { |
|
| 43 | - if ($config->RemoteDomain) { |
|
| 44 | - return $config->RemoteDomain; |
|
| 11 | + private static $keyPrefix = 'dYnm1c'; |
|
| 12 | + |
|
| 13 | + public static function setStoreKey($length = 54, $count = 0){ |
|
| 14 | + $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.strtotime('now'); |
|
| 15 | + $strLength = strlen($charset); |
|
| 16 | + $str = ''; |
|
| 17 | + while($count < $length){ |
|
| 18 | + $str .= $charset[mt_rand(0, $strLength-1)]; |
|
| 19 | + $count++; |
|
| 20 | + } |
|
| 21 | + return self::getKeyPrefix().substr(base64_encode($str),0,$length); |
|
| 22 | + } |
|
| 23 | + |
|
| 24 | + public static function getStoreKey(){ |
|
| 25 | + $config = SiteConfig::current_site_config(); |
|
| 26 | + if($config->StoreKey){ |
|
| 27 | + return $config->StoreKey; |
|
| 28 | + } |
|
| 29 | + return null; |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + public static function store_name_warning(){ |
|
| 33 | + $warning = null; |
|
| 34 | + if(self::getFoxyCartStoreName()===null){ |
|
| 35 | + $warning = 'Must define FoxyCart Store Name or Store Remote Domain in your site settings in the cms'; |
|
| 36 | + } |
|
| 37 | + return $warning; |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + public static function getFoxyCartStoreName(){ |
|
| 41 | + $config = SiteConfig::current_site_config(); |
|
| 42 | + if ($config->CustomSSL) { |
|
| 43 | + if ($config->RemoteDomain) { |
|
| 44 | + return $config->RemoteDomain; |
|
| 45 | 45 | } |
| 46 | 46 | } else { |
| 47 | 47 | if ($config->StoreName){ |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - return null; |
|
| 53 | - } |
|
| 52 | + return null; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - public static function FormActionURL() { |
|
| 55 | + public static function FormActionURL() { |
|
| 56 | 56 | $config = SiteConfig::current_site_config(); |
| 57 | 57 | |
| 58 | 58 | if ($config->CustomSSL) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } else { |
| 61 | 61 | return sprintf('https://%s.foxycart.com/cart', self::getFoxyCartStoreName()); |
| 62 | 62 | } |
| 63 | - } |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * FoxyCart API v1.1 functions |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | return self::getAPIRequest($foxyData); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - public static function getKeyPrefix(){ |
|
| 130 | - return self::$keyPrefix; |
|
| 131 | - } |
|
| 129 | + public static function getKeyPrefix(){ |
|
| 130 | + return self::$keyPrefix; |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | 133 | } |