WxPay.Config.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. class WxPayConfig
  3. {
  4. public function set($appid, $appsecret, $merchantid, $notify, $key, $ssl, $type, $timeout = 600)
  5. {
  6. $this->appid = $appid;
  7. $this->appsecret = $appsecret;
  8. $this->merchantid = $merchantid;
  9. $this->notify = $notify;
  10. $this->key = $key;
  11. $this->ssl = $ssl;
  12. $this->type = $type;
  13. $this->timeout = $timeout;
  14. return $this;
  15. }
  16. public function GetAppId()
  17. {
  18. return $this->appid;
  19. }
  20. public function GetMerchantId()
  21. {
  22. return $this->merchantid;
  23. }
  24. public function GetNotifyUrl()
  25. {
  26. return $this->notify;
  27. }
  28. public function GetSignType()
  29. {
  30. return "HMAC-SHA256";
  31. }
  32. public function GetProxy(&$proxyHost, &$proxyPort)
  33. {
  34. $proxyHost = "0.0.0.0";
  35. $proxyPort = 0;
  36. }
  37. public function GetReportLevenl()
  38. {
  39. return 1;
  40. }
  41. public function GetKey()
  42. {
  43. return $this->key;
  44. }
  45. public function GetAppSecret()
  46. {
  47. return $this->appsecret;
  48. }
  49. public function GetSSLCertPath(&$sslCertPath, &$sslKeyPath)
  50. {
  51. $sslCertPath = $this->ssl['cert'];
  52. $sslKeyPath = $this->ssl['key'];
  53. }
  54. public function GetTimeOut()
  55. {
  56. return $this->timeout;
  57. }
  58. public function GetType()
  59. {
  60. return $this->type;
  61. }
  62. }