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
+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') {