From 2ff7ceb66b88c2ff173c760fb6bdba9e78324d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 18 Aug 2023 16:57:32 +0800 Subject: [PATCH] Default Changelist --- wchat/qq/Redhat.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wchat/qq/Redhat.php b/wchat/qq/Redhat.php index 79db6a4..7de34e0 100644 --- a/wchat/qq/Redhat.php +++ b/wchat/qq/Redhat.php @@ -432,10 +432,11 @@ class Redhat extends SmallProgram public function redEnvelopes(): Result { $client = new Client('api.qpay.qq.com', 443, true); - $client->withHeader(['Content-Type' => 'application/json']); + $client->withHeader(['Content-Type' => 'application/x-www-form-urlencoded']); $client->withSslKeyFile($this->config->getSslKey()); $client->withSslCertFile($this->config->getSslCert()); - $client->post($this->sendUrl, $this->generate()); + $client->withCa($this->config->getSslCa()); + $client->post($this->sendUrl, http_build_query($this->generate())); $client->close(); if (!in_array($client->getStatusCode(), [101, 200, 201])) { return new Result(code: 505, message: 'network error.');