diff --git a/wchat/common/Config.php b/wchat/common/Config.php index 221de52..1fdbdc9 100644 --- a/wchat/common/Config.php +++ b/wchat/common/Config.php @@ -116,6 +116,10 @@ class Config private string $ssl_ca = ''; private int $port = 443; + + private string $mchCert = ''; + private string $mchKey = ''; + /** * @var string */ @@ -124,6 +128,38 @@ class Config private string $agent = ''; private bool $usrSwoole = false; + /** + * @return string + */ + public function getMchCert(): string + { + return $this->mchCert; + } + + /** + * @param string $mchCert + */ + public function setMchCert(string $mchCert): void + { + $this->mchCert = $mchCert; + } + + /** + * @return string + */ + public function getMchKey(): string + { + return $this->mchKey; + } + + /** + * @param string $mchKey + */ + public function setMchKey(string $mchKey): void + { + $this->mchKey = $mchKey; + } + /** * @return string */ diff --git a/wchat/wx/V3/WxV3PaymentTait.php b/wchat/wx/V3/WxV3PaymentTait.php index 8634964..c64d5d5 100644 --- a/wchat/wx/V3/WxV3PaymentTait.php +++ b/wchat/wx/V3/WxV3PaymentTait.php @@ -56,7 +56,7 @@ trait WxV3PaymentTait */ public function openssl_signature($body): string { - $pem = file_get_contents($this->getConfig()->getSslCert()); + $pem = file_get_contents($this->getConfig()->getMchKey()); $mch_private_key = openssl_get_privatekey($pem);