WxPay.Config.php 1.3 KB

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