"string"])] public function request(string $orderNo, int $total, string $openId): array { $body['appid'] = $this->getConfig()->getAppid(); $body['out_trade_no'] = $orderNo; $body["batch_name"] = $this->getConfig()->getBody(); $body["batch_remark"] = $this->getConfig()->getBody(); $body["total_amount"] = $total; $body["total_num"] = 1; $body["transfer_detail_list"] = [ [ "out_detail_no" => $orderNo, "transfer_amount" => $total, "transfer_remark" => $this->getConfig()->getBody(), "openid" => $openId, ] ]; $sign = $this->signature('POST', '/v3/transfer/batches', $json = json_encode($body, JSON_UNESCAPED_UNICODE)); $client = new Client('api.mch.weixin.qq.com', 443, TRUE); $client->withAddedHeader('Authorization', $sign)->withContentType('application/json') ->withAgent('application/json')->withBody($json) ->post('/v3/transfer/batches'); $client->close(); return json_decode($client->getBody(), TRUE); } }