From 63e24922ad5f3ececc1bbc724b29b64fbfb36508 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 12 Jun 2026 23:57:22 +0800 Subject: [PATCH] eee --- base/Subject.php | 6 +++--- base/Template.php | 6 +++--- common/Multiprogramming.php | 6 +++--- common/Result.php | 6 +++--- composer.json | 2 +- qq/Redhat.php | 12 ++++++------ qq/pay/Cash_Bonus.php | 6 +++--- qq/pay/Enterprise_payment.php | 6 +++--- wx/V3/WxV3AppPayment.php | 2 +- wx/V3/WxV3NativePayment.php | 2 +- wx/V3/WxV3Payment.php | 4 ++-- wx/V3/WxV3PaymentTait.php | 2 +- wx/V3/WxV3Transfer.php | 6 +++--- wx/V3/WxV3Withdrawal.php | 8 ++++---- wx/V3/WxVirtualPayment.php | 4 ++-- 15 files changed, 39 insertions(+), 39 deletions(-) diff --git a/base/Subject.php b/base/Subject.php index 3f2bf2e..c4a05a4 100644 --- a/base/Subject.php +++ b/base/Subject.php @@ -172,10 +172,10 @@ abstract class Subject extends Multiprogramming $client->post($this->getUrl() . '?access_token=' . $access_token, $params); $client->close(); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $body = json_decode($client->getBody(), true); + $body = json_decode($client->body, true); if (isset($body['errcode']) && $body['errcode'] != 0) { return new Result(code: $body['errcode'], message: $body['errmsg']); } else { diff --git a/base/Template.php b/base/Template.php index 0d895e7..1869c5a 100644 --- a/base/Template.php +++ b/base/Template.php @@ -143,10 +143,10 @@ abstract class Template extends Multiprogramming $client->post($this->getUrl() . '?access_token=' . $access_token, $params); $client->close(); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $body = json_decode($client->getBody(), true); + $body = json_decode($client->body, true); if (isset($body['errcode']) && $body['errcode'] != 0) { return new Result(code: $body['errcode'], message: $body['errmsg']); } diff --git a/common/Multiprogramming.php b/common/Multiprogramming.php index 8722fe1..e8757ac 100644 --- a/common/Multiprogramming.php +++ b/common/Multiprogramming.php @@ -147,10 +147,10 @@ abstract class Multiprogramming implements Progaram $client->get($requestUrl, $body); } $client->close(); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $body = json_decode($client->getBody(), true); + $body = json_decode($client->body, true); if (is_null($body) || (isset($body['errcode']) && $body['errcode'] != 0)) { return new Result(code: $body['errcode'], message: $body['errmsg']); } else { diff --git a/common/Result.php b/common/Result.php index 0caa81f..047a30b 100644 --- a/common/Result.php +++ b/common/Result.php @@ -56,10 +56,10 @@ class Result */ public static function init(Client $client): static { - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $body = json_decode($client->getBody(), true); + $body = json_decode($client->body, true); if (isset($body['errcode']) && $body['errcode'] != 0) { return new Result(code: $body['errcode'], message: $body['errmsg']); } else { diff --git a/composer.json b/composer.json index bd9583c..22f86e5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ] }, "require": { - "php": ">= 8.4", + "php": ">= 8.5", "game-worker/kiri-client": "^v2.5", "psr/container": "*", "ext-openssl": "*" diff --git a/qq/Redhat.php b/qq/Redhat.php index 4965a7d..5ac270c 100644 --- a/qq/Redhat.php +++ b/qq/Redhat.php @@ -309,10 +309,10 @@ class Redhat extends SmallProgram } $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: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $json = json_decode($client->getBody(), true); + $json = json_decode($client->body, true); if (isset($json['return_code']) && $json['return_code'] != 'SUCCESS') { return new Result(code: 500, message: $json['return_msg'] ?? $json['retmsg']); } @@ -347,10 +347,10 @@ class Redhat extends SmallProgram $client->withHeader(['Content-Type' => 'application/json']); $client->post($this->searchUrl, $requestParam); $client->close(); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $json = json_decode($client->getBody(), true); + $json = json_decode($client->body, true); if (isset($json['result']) && $json['result'] != 'SUCCESS') { return new Result(code: 500, message: $response['res_info'] ?? '订单查询失败!'); } else { diff --git a/qq/pay/Cash_Bonus.php b/qq/pay/Cash_Bonus.php index 9aa010d..9d11e36 100644 --- a/qq/pay/Cash_Bonus.php +++ b/qq/pay/Cash_Bonus.php @@ -84,10 +84,10 @@ class Cash_Bonus extends SmallProgram public function mch_send(string $mch_billno, string $openId, float $price): Result { $client = $this->createClient($this->_cash, $this->orderConfig($mch_billno, $openId, $price)); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $json = json_decode($client->getBody(), true); + $json = json_decode($client->body, true); if (isset($json['return_code']) && $json['return_code'] != 'SUCCESS') { return new Result(code: 500, message: $json['return_msg'] ?? $json['retmsg']); diff --git a/qq/pay/Enterprise_payment.php b/qq/pay/Enterprise_payment.php index d687f0c..c122042 100644 --- a/qq/pay/Enterprise_payment.php +++ b/qq/pay/Enterprise_payment.php @@ -70,10 +70,10 @@ class Enterprise_payment extends SmallProgram public function mch_send(string $mch_billno, string $openId, float $price): Result { $client = $this->createClient($this->_cash, $this->orderConfig($mch_billno, $openId, $price)); - if (!in_array($client->getStatusCode(), [101, 200, 201])) { - return new Result(code: 505, message: $client->getBody()); + if (!in_array($client->statusCode, [101, 200, 201])) { + return new Result(code: 505, message: $client->body); } - $json = json_decode($client->getBody(), true); + $json = json_decode($client->body, true); if (isset($json['return_code']) && $json['return_code'] != 'SUCCESS') { return new Result(code: 500, data: $json['return_msg'] ?? $json['retmsg']); } else if ($json['result_code'] != 'SUCCESS') { diff --git a/wx/V3/WxV3AppPayment.php b/wx/V3/WxV3AppPayment.php index e2706af..dbb1cbb 100644 --- a/wx/V3/WxV3AppPayment.php +++ b/wx/V3/WxV3AppPayment.php @@ -32,7 +32,7 @@ class WxV3AppPayment extends SmallProgram $client->post('/v3/pay/transactions/components'); $client->close(); - $json = json_decode($client->getBody(), TRUE); + $json = json_decode($client->body, TRUE); if (!isset($json['prepay_id'])) { throw new Exception('微信支付调用失败'); } diff --git a/wx/V3/WxV3NativePayment.php b/wx/V3/WxV3NativePayment.php index 2850462..ebe785b 100644 --- a/wx/V3/WxV3NativePayment.php +++ b/wx/V3/WxV3NativePayment.php @@ -32,7 +32,7 @@ class WxV3NativePayment extends SmallProgram $client->post('/v3/pay/transactions/native'); $client->close(); - $json = json_decode($client->getBody(), TRUE); + $json = json_decode($client->body, TRUE); if (!isset($json['code_url'])) { throw new Exception('微信支付调用失败'); } diff --git a/wx/V3/WxV3Payment.php b/wx/V3/WxV3Payment.php index 890ba8d..9a10454 100644 --- a/wx/V3/WxV3Payment.php +++ b/wx/V3/WxV3Payment.php @@ -32,9 +32,9 @@ class WxV3Payment extends SmallProgram $client->post('/v3/pay/transactions/jsapi'); $client->close(); - $json = json_decode($client->getBody(), TRUE); + $json = json_decode($client->body, TRUE); if (!isset($json['prepay_id'])) { - throw new Exception('微信支付调用失败: ' . $client->getBody()); + throw new Exception('微信支付调用失败: ' . $client->body); } return $this->createResponse($json, $body); diff --git a/wx/V3/WxV3PaymentTait.php b/wx/V3/WxV3PaymentTait.php index 037ee91..fcd839a 100644 --- a/wx/V3/WxV3PaymentTait.php +++ b/wx/V3/WxV3PaymentTait.php @@ -102,7 +102,7 @@ trait WxV3PaymentTait $client->get($parseUrl, ['mchid' => $config->pay->wx->mchId]); $client->close(); - return json_decode($client->getBody(), TRUE); + return json_decode($client->body, TRUE); } diff --git a/wx/V3/WxV3Transfer.php b/wx/V3/WxV3Transfer.php index ab8878e..6310708 100644 --- a/wx/V3/WxV3Transfer.php +++ b/wx/V3/WxV3Transfer.php @@ -33,10 +33,10 @@ class WxV3Transfer extends SmallProgram $client->post('/v3/fund-app/mch-transfer/transfer-bills'); $client->close(); - Kiri::getLogger()->println($client->getBody()); + Kiri::getLogger()->println($client->body); - if ($client->getStatusCode() == 200) { - return json_decode($client->getBody(), TRUE); + if ($client->statusCode == 200) { + return json_decode($client->body, TRUE); } throw new Exception('转账申请发起失败'); } diff --git a/wx/V3/WxV3Withdrawal.php b/wx/V3/WxV3Withdrawal.php index c85bd80..188c592 100644 --- a/wx/V3/WxV3Withdrawal.php +++ b/wx/V3/WxV3Withdrawal.php @@ -32,7 +32,7 @@ class WxV3Withdrawal extends SmallProgram $client->post('/v3/pay/transactions/batches'); $client->close(); - $json = json_decode($client->getBody(), TRUE); + $json = json_decode($client->body, TRUE); if (!isset($json['prepay_id'])) { throw new Exception('微信支付调用失败'); } @@ -88,10 +88,10 @@ class WxV3Withdrawal extends SmallProgram $client->post('/v3/fund-app/mch-transfer/transfer-bills'); $client->close(); - Kiri::getLogger()->println($client->getBody()); + Kiri::getLogger()->println($client->body); - if ($client->getStatusCode() == 200) { - return json_decode($client->getBody(), TRUE); + if ($client->statusCode == 200) { + return json_decode($client->body, TRUE); } throw new Exception('转账申请发起失败'); } diff --git a/wx/V3/WxVirtualPayment.php b/wx/V3/WxVirtualPayment.php index cfbb350..7ffd697 100644 --- a/wx/V3/WxVirtualPayment.php +++ b/wx/V3/WxVirtualPayment.php @@ -76,7 +76,7 @@ class WxVirtualPayment extends SmallProgram $client = new Client('api.weixin.qq.com', 443, true); $client->post('/xpay/query_order?access_token=' . $this->payConfig->getAccessToken() . '&pay_sig=' . $this->paySign('/xpay/query_order', $data), $data); - $resp = $client->getBody(); + $resp = $client->body; $client->close(); @@ -94,7 +94,7 @@ class WxVirtualPayment extends SmallProgram $client = new Client('api.weixin.qq.com', 443, true); $client->post('/xpay/notify_provide_goods?access_token=' . $this->payConfig->getAccessToken() . '&pay_sig=' . $this->paySign('/xpay/notify_provide_goods', $data), $data); - $resp = $client->getBody(); + $resp = $client->body; $client->close(); return json_decode($resp, true);