AlipaySystemOauthTokenRequest.php 2.8 KB

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