Client.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\extra\douyin;
  3. use yzh52521\EasyHttp\Http;
  4. class Client extends Base
  5. {
  6. /**
  7. * 设置小程序跳转path
  8. * @param string $account
  9. * @return array
  10. */
  11. public function setMiniPath(string $account = "",string $order = ""): array
  12. {
  13. $param = [
  14. "account_id" => $account,
  15. "bind_biz_type" => 0,
  16. "path_data_list" => [
  17. [
  18. "path" => "pages/order/detail",
  19. "path_type" => 1
  20. ],
  21. [
  22. "path" => "pages/order/detail",
  23. "path_type" => 2
  24. ],
  25. [
  26. "path" => "pages/order/detail",
  27. "path_type" => 3
  28. ]
  29. ]
  30. ];
  31. return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/apps/trade/v2/toolkit/update_merchant_path/", $param)->array();
  32. }
  33. /**
  34. * 查下用户订单
  35. * @param string $account
  36. * @param string $openId
  37. * @return array
  38. */
  39. public function queryOrder(string $account = "",string $openId = ""): array
  40. {
  41. $param = [
  42. "account_id" => $account,
  43. "open_id" => $openId,
  44. "biz_type" => 1,
  45. ];
  46. return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/trade/v2/fulfillment/query_user_certificates/", $param)->array();
  47. }
  48. }