AlipaySystemOauthTokenRequest.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\utils\Alipay\alipaySdk\aop\request;
  8. /**
  9. * ALIPAY API: alipay.system.oauth.token request
  10. *
  11. * @author auto create
  12. * @since 1.0, 2021-10-28 15:06:12
  13. */
  14. class AlipaySystemOauthTokenRequest
  15. {
  16. /**
  17. * 授权码,用户对应用授权后得到。本参数在 grant_type 为 authorization_code 时必填;为 refresh_token 时不填。
  18. **/
  19. private $code;
  20. /**
  21. * 授权方式。支持:
  22. 1.authorization_code,表示换取使用用户授权码code换取授权令牌access_token。
  23. 2.refresh_token,表示使用refresh_token刷新获取新授权令牌。
  24. **/
  25. private $grantType;
  26. /**
  27. * 刷新令牌,上次换取访问令牌时得到。本参数在 grant_type 为 authorization_code 时不填;为 refresh_token 时必填,且该值来源于此接口的返回值 app_refresh_token(即至少需要通过 grant_type=authorization_code 调用此接口一次才能获取)。
  28. **/
  29. private $refreshToken;
  30. private $apiParas = array();
  31. private $terminalType;
  32. private $terminalInfo;
  33. private $prodCode;
  34. private $apiVersion="1.0";
  35. private $notifyUrl;
  36. private $returnUrl;
  37. private $needEncrypt=false;
  38. public function setCode($code)
  39. {
  40. $this->code = $code;
  41. $this->apiParas["code"] = $code;
  42. }
  43. public function getCode()
  44. {
  45. return $this->code;
  46. }
  47. public function setGrantType($grantType)
  48. {
  49. $this->grantType = $grantType;
  50. $this->apiParas["grant_type"] = $grantType;
  51. }
  52. public function getGrantType()
  53. {
  54. return $this->grantType;
  55. }
  56. public function setRefreshToken($refreshToken)
  57. {
  58. $this->refreshToken = $refreshToken;
  59. $this->apiParas["refresh_token"] = $refreshToken;
  60. }
  61. public function getRefreshToken()
  62. {
  63. return $this->refreshToken;
  64. }
  65. public function getApiMethodName()
  66. {
  67. return "alipay.system.oauth.token";
  68. }
  69. public function setNotifyUrl($notifyUrl)
  70. {
  71. $this->notifyUrl=$notifyUrl;
  72. }
  73. public function getNotifyUrl()
  74. {
  75. return $this->notifyUrl;
  76. }
  77. public function setReturnUrl($returnUrl)
  78. {
  79. $this->returnUrl=$returnUrl;
  80. }
  81. public function getReturnUrl()
  82. {
  83. return $this->returnUrl;
  84. }
  85. public function getApiParas()
  86. {
  87. return $this->apiParas;
  88. }
  89. public function getTerminalType()
  90. {
  91. return $this->terminalType;
  92. }
  93. public function setTerminalType($terminalType)
  94. {
  95. $this->terminalType = $terminalType;
  96. }
  97. public function getTerminalInfo()
  98. {
  99. return $this->terminalInfo;
  100. }
  101. public function setTerminalInfo($terminalInfo)
  102. {
  103. $this->terminalInfo = $terminalInfo;
  104. }
  105. public function getProdCode()
  106. {
  107. return $this->prodCode;
  108. }
  109. public function setProdCode($prodCode)
  110. {
  111. $this->prodCode = $prodCode;
  112. }
  113. public function setApiVersion($apiVersion)
  114. {
  115. $this->apiVersion=$apiVersion;
  116. }
  117. public function getApiVersion()
  118. {
  119. return $this->apiVersion;
  120. }
  121. public function setNeedEncrypt($needEncrypt)
  122. {
  123. $this->needEncrypt=$needEncrypt;
  124. }
  125. public function getNeedEncrypt()
  126. {
  127. return $this->needEncrypt;
  128. }
  129. }