Shansong.php 1010 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace common\components\delivery\platform\shansong;
  3. class Shansong
  4. {
  5. protected $baseUrl;
  6. protected $appSecret;
  7. protected $clientId;
  8. protected $accessToken;
  9. protected $storeId;
  10. public function __construct($accessToken, $storeId)
  11. {
  12. if ( getenv('YII_ENV') == 'production') {
  13. $cfg = [
  14. 'base_url' => 'https://open.ishansong.com',
  15. 'secret' => 'mUa1uLQkybm6cGaUa4AW4krn4i5QROpD',
  16. 'client_id' => 'sswoXlqJvk7Be9GN3', // App-key
  17. ];
  18. } else {
  19. $cfg = [
  20. 'base_url' => 'http://open.s.bingex.com',
  21. 'secret' => 'mUa1uLQkybm6cGaUa4AW4krn4i5QROpD',
  22. 'client_id' => 'sswoXlqJvk7Be9GN3', // App-key
  23. ];
  24. }
  25. $this->baseUrl = $cfg['base_url'];
  26. $this->appSecret = $cfg['secret'];
  27. $this->clientId = $cfg['client_id'];
  28. $this->accessToken = $accessToken;
  29. $this->storeId = $storeId;
  30. }
  31. }