Shansong.php 992 B

12345678910111213141516171819202122232425262728293031323334
  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. public function __construct($accessToken)
  10. {
  11. if ( getenv('YII_ENV') == 'production') { // TODO 先变更为测试 --- production / dev
  12. $cfg = [
  13. 'base_url' => 'https://open.ishansong.com',
  14. 'secret' => 'mUa1uLQkybm6cGaUa4AW4krn4i5QROpD',
  15. 'client_id' => 'sswoXlqJvk7Be9GN3', // App-key
  16. ];
  17. } else {
  18. $cfg = [
  19. 'base_url' => 'http://open.s.bingex.com',
  20. 'secret' => 'mUa1uLQkybm6cGaUa4AW4krn4i5QROpD',
  21. 'client_id' => 'sswoXlqJvk7Be9GN3', // App-key
  22. ];
  23. }
  24. $this->baseUrl = $cfg['base_url'];
  25. $this->appSecret = $cfg['secret'];
  26. $this->clientId = $cfg['client_id'];
  27. $this->accessToken = $accessToken;
  28. }
  29. }