diff --git a/CHANGELOG.md b/CHANGELOG.md index b29b04b..15e880a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v3.2.8 + +### fixed + +- fix: 商家批次单号查询批次单时 query 参数不正确(#690) + ## v3.2.7 ### fixed diff --git a/src/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPlugin.php b/src/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPlugin.php index c0ddbfb..bb1e12c 100644 --- a/src/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPlugin.php +++ b/src/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPlugin.php @@ -35,7 +35,11 @@ class QueryOutBatchNoPlugin extends GeneralPlugin throw new InvalidParamsException(Exception::MISSING_NECESSARY_PARAMS); } - return 'v3/transfer/batches/out-batch-no/'.$payload->get('out_batch_no'). + $outBatchNo = $payload->get('out_batch_no'); + + $payload->forget('out_batch_no'); + + return 'v3/transfer/batches/out-batch-no/'.$outBatchNo. '?'.$payload->query(); } @@ -50,7 +54,11 @@ class QueryOutBatchNoPlugin extends GeneralPlugin throw new InvalidParamsException(Exception::MISSING_NECESSARY_PARAMS); } - return 'v3/partner-transfer/batches/out-batch-no/'.$payload->get('out_batch_no'). + $outBatchNo = $payload->get('out_batch_no'); + + $payload->forget('out_batch_no'); + + return 'v3/partner-transfer/batches/out-batch-no/'.$outBatchNo. '?'.$payload->query(); } } diff --git a/tests/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPluginTest.php b/tests/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPluginTest.php index b6f870b..0a952fe 100644 --- a/tests/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPluginTest.php +++ b/tests/Plugin/Wechat/Fund/Transfer/QueryOutBatchNoPluginTest.php @@ -34,7 +34,7 @@ class QueryOutBatchNoPluginTest extends TestCase $url = $radar->getUri(); self::assertEquals('/v3/transfer/batches/out-batch-no/123', $url->getPath()); - self::assertStringContainsString('need_query_detail=0', $url->getQuery()); + self::assertEquals('need_query_detail=0', $url->getQuery()); self::assertEquals('GET', $radar->getMethod()); } @@ -71,7 +71,7 @@ class QueryOutBatchNoPluginTest extends TestCase $url = $radar->getUri(); self::assertEquals('/v3/partner-transfer/batches/out-batch-no/123', $url->getPath()); - self::assertStringContainsString('need_query_detail=0', $url->getQuery()); + self::assertEquals('need_query_detail=0', $url->getQuery()); self::assertEquals('GET', $radar->getMethod()); }