AlipayConfig.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?php
  2. namespace alipay\aop;
  3. class AlipayConfig {
  4. /**
  5. * 网关地址
  6. * 线上:https://openapi.alipay.com/gateway.do
  7. * 沙箱:https://openapi.alipaydev.com/gateway.do
  8. */
  9. private $serverUrl;
  10. /**
  11. * 开放平台上创建的应用的ID
  12. */
  13. private $appId;
  14. /**
  15. * 报文格式,推荐:json
  16. */
  17. private $format = "json";
  18. /**
  19. * 字符串编码,推荐:utf-8
  20. */
  21. private $charset = "utf-8";
  22. /**
  23. * 签名算法类型,推荐:RSA2
  24. */
  25. private $signType = "RSA2";
  26. /**
  27. * 商户私钥
  28. */
  29. private $privateKey;
  30. /**
  31. * 支付宝公钥字符串(公钥模式下设置,证书模式下无需设置)
  32. */
  33. private $alipayPublicKey;
  34. /**
  35. * 商户应用公钥证书路径(证书模式下设置,公钥模式下无需设置)
  36. */
  37. private $appCertPath;
  38. /**
  39. * 支付宝公钥证书路径(证书模式下设置,公钥模式下无需设置)
  40. */
  41. private $alipayPublicCertPath;
  42. /**
  43. * 支付宝根证书路径(证书模式下设置,公钥模式下无需设置)
  44. */
  45. private $rootCertPath;
  46. /**
  47. * 指定商户公钥应用证书内容字符串,该字段与appCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
  48. */
  49. private $appCertContent;
  50. /**
  51. * 指定支付宝公钥证书内容字符串,该字段与alipayPublicCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
  52. */
  53. private $alipayPublicCertContent;
  54. /**
  55. * 指定根证书内容字符串,该字段与rootCertPath只需指定一个,优先以该字段的值为准(证书模式下设置,公钥模式下无需设置)
  56. */
  57. private $rootCertContent;
  58. /**
  59. * 敏感信息对称加密算法类型,推荐:AES
  60. */
  61. private $encryptType = "AES";
  62. /**
  63. * 敏感信息对称加密算法密钥
  64. */
  65. private $encryptKey;
  66. public function getServerUrl() {
  67. return $this->serverUrl;
  68. }
  69. public function setServerUrl($serverUrl) {
  70. $this->serverUrl = $serverUrl;
  71. }
  72. public function getAppId(){
  73. return $this->appId;
  74. }
  75. public function setAppId($appId){
  76. $this->appId = $appId;
  77. }
  78. public function getFormat(){
  79. return $this->format;
  80. }
  81. public function setFormat($format){
  82. $this->format = $format;
  83. }
  84. public function getCharset() {
  85. return $this->charset;
  86. }
  87. public function setCharset($charset) {
  88. $this->charset = $charset;
  89. }
  90. public function getSignType() {
  91. return $this->signType;
  92. }
  93. public function setSignType($signType) {
  94. $this->signType = $signType;
  95. }
  96. public function getEncryptKey() {
  97. return $this->encryptKey;
  98. }
  99. public function setEncryptKey($encryptKey) {
  100. $this->encryptKey = $encryptKey;
  101. }
  102. public function getEncryptType() {
  103. return $this->encryptType;
  104. }
  105. public function setEncryptType($encryptType) {
  106. $this->encryptType = $encryptType;
  107. }
  108. public function getPrivateKey() {
  109. return $this->privateKey;
  110. }
  111. public function setPrivateKey($privateKey) {
  112. $this->privateKey = $privateKey;
  113. }
  114. public function getAlipayPublicKey() {
  115. return $this->alipayPublicKey;
  116. }
  117. public function setAlipayPublicKey($alipayPublicKey) {
  118. $this->alipayPublicKey = $alipayPublicKey;
  119. }
  120. public function getAppCertPath() {
  121. return $this->appCertPath;
  122. }
  123. public function setAppCertPath($appCertPath) {
  124. $this->appCertPath = $appCertPath;
  125. }
  126. public function getAlipayPublicCertPath() {
  127. return $this->alipayPublicCertPath;
  128. }
  129. public function setAlipayPublicCertPath($alipayPublicCertPath) {
  130. $this->alipayPublicCertPath = $alipayPublicCertPath;
  131. }
  132. public function getRootCertPath() {
  133. return $this->rootCertPath;
  134. }
  135. public function setRootCertPath($rootCertPath) {
  136. $this->rootCertPath = $rootCertPath;
  137. }
  138. public function getAppCertContent() {
  139. return $this->appCertContent;
  140. }
  141. public function setAppCertContent($appCertContent) {
  142. $this->appCertContent = $appCertContent;
  143. }
  144. public function getAlipayPublicCertContent() {
  145. return $this->alipayPublicCertContent;
  146. }
  147. public function setAlipayPublicCertContent($alipayPublicCertContent) {
  148. $this->alipayPublicCertContent = $alipayPublicCertContent;
  149. }
  150. public function getRootCertContent() {
  151. return $this->rootCertContent;
  152. }
  153. public function setRootCertContent($rootCertContent) {
  154. $this->rootCertContent = $rootCertContent;
  155. }
  156. }