LewaimaiAboutLekuaisong.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. class LewaimaiAboutLekuaisong {
  3. //获取访问乐快送接口的请求数组
  4. public static function CreateRequest()
  5. {
  6. $timestamp = time();
  7. $nonce = LewaimaiString::create_noncestr(9);
  8. $apikey = LEKUAISONG_APIKEY;
  9. $secretkey = LEKUAISONG_SECRETKEY;
  10. $params = array($timestamp, $nonce, $apikey, $secretkey);
  11. sort($params, SORT_STRING);
  12. $signature = sha1( implode( $params ) );
  13. $post['sign'] = array(
  14. 'timestamp' => $timestamp,
  15. 'nonce' => $nonce,
  16. 'apikey' => $apikey,
  17. 'signature' => $signature
  18. );
  19. return $post;
  20. }
  21. //获取访问乐快送跑腿接口的请求数组
  22. public static function CreateErrandRequest()
  23. {
  24. $timestamp = time();
  25. $nonce = LewaimaiString::create_noncestr(9);
  26. $apikey = LEKUAISONG_ERRAND_APIKEY;
  27. $secretkey = LEKUAISONG_ERRAND_SECRETKEY;
  28. $params = array($timestamp, $nonce, $apikey, $secretkey);
  29. sort($params, SORT_STRING);
  30. $signature = sha1( implode( $params ) );
  31. $post['sign'] = array(
  32. 'timestamp' => $timestamp,
  33. 'nonce' => $nonce,
  34. 'apikey' => $apikey,
  35. 'signature' => $signature
  36. );
  37. return $post;
  38. }
  39. }