This commit is contained in:
2026-06-12 23:57:22 +08:00
parent 0a535c3a89
commit 63e24922ad
15 changed files with 39 additions and 39 deletions
+6 -6
View File
@@ -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 {
+3 -3
View File
@@ -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']);
+3 -3
View File
@@ -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') {