AlipayConfig.php 4.7 KB

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