WxPayFaceAuthInfo.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: yunzhong
  5. * Date: 2019/10/8
  6. * Time: 16:41
  7. */
  8. namespace app\common\services\wechat\lib;
  9. use app\common\services\wechat\lib\WxPayConfig;
  10. use app\common\services\wechat\lib\WxPayDataBase;
  11. class WxPayFaceAuthInfo extends WxPayDataBase
  12. {
  13. public function __construct(WxPayConfig $config)
  14. {
  15. $this->values['appid'] = $config->GetAppId();
  16. $this->values['sub_appid'] = $config->GetSubAppId();
  17. $this->values["mch_id"] = $config->GetMerchantId();
  18. $this->values["sub_mch_id"] = $config->GetSubMerchantId();
  19. $this->values["version"] = "1";
  20. $this->values["sign_type"] = $config->GetSignType();
  21. }
  22. /**
  23. * 设置随机字符串,不长于32位。推荐随机数生成算法
  24. * @param string $value
  25. **/
  26. public function SetNonce_str($value)
  27. {
  28. $this->values['nonce_str'] = $value;
  29. }
  30. /**
  31. * 获取随机字符串,不长于32位。推荐随机数生成算法的值
  32. * @return 值
  33. **/
  34. public function GetNonce_str()
  35. {
  36. return $this->values['nonce_str'];
  37. }
  38. /**
  39. * 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
  40. * @return true 或 false
  41. **/
  42. public function IsNonce_strSet()
  43. {
  44. return array_key_exists('nonce_str', $this->values);
  45. }
  46. public function SetStoreName($value)
  47. {
  48. $this->values['store_name'] = $value;
  49. }
  50. public function GetStoreName()
  51. {
  52. return $this->values['store_name'];
  53. }
  54. public function IsStoreNameSet()
  55. {
  56. return array_key_exists('store_name', $this->values);
  57. }
  58. public function SetStoreId($value)
  59. {
  60. $this->values['store_id'] = $value;
  61. }
  62. public function GetStoreId()
  63. {
  64. return $this->values['store_id'];
  65. }
  66. public function IsStoreIdSet()
  67. {
  68. return array_key_exists('store_id', $this->values);
  69. }
  70. public function SetDeviceId($value)
  71. {
  72. $this->values['device_id'] = $value;
  73. }
  74. public function GetDeviceId()
  75. {
  76. return $this->values['device_id'];
  77. }
  78. public function IsDeviceIdSet()
  79. {
  80. return array_key_exists('device_id', $this->values);
  81. }
  82. public function SetRawdata($value)
  83. {
  84. $this->values['rawdata'] = $value;
  85. }
  86. public function GetRawdata()
  87. {
  88. return $this->values['rawdata'];
  89. }
  90. public function IsRawdataSet()
  91. {
  92. return array_key_exists('rawdata', $this->values);
  93. }
  94. public function SetNow()
  95. {
  96. $this->values['now'] = time();
  97. }
  98. public function GetNow()
  99. {
  100. return $this->values['now'];
  101. }
  102. public function IsNowSet()
  103. {
  104. return array_key_exists('now', $this->values);
  105. }
  106. public function GetAuthInfo()
  107. {
  108. return $this->values['authinfo'];
  109. }
  110. }