getConfig())->order->setMockHandler([$mockHandler])->query($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'orderNo', 'payAccount', 'transNo', 'status', 'statusDesc', 'amount', 'tag', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } public function testOrderClose() { $order = new CloseOrder('FD2022080310000055123451223'); $mockHandler = new CloseOrderHandler(true); $response = Factory::common($this->getConfig())->order->setMockHandler([$mockHandler])->close($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'orderNo', 'closeTime', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } public function testOrderRefund() { $order = new RefundOrder('FD2022080310000055123451223', 'FD2022080310000055123451223_12345', 0.01, 'Test Refund'); $mockHandler = new RefundOrderHandler(true); $response = Factory::common($this->getConfig())->order->setMockHandler([$mockHandler])->refund($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'orderNo', 'refundNo', 'refundAmount', 'refundTime', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } public function testOrderConfirmForEx() { $order = new ConfirmOrderForEx('FD2022080310000055123451223', 'ZSD0002974832', 'ow8NuxN_ALO2MzSvzj19hyxWjCVY', '4200067674202302063709953797'); $mockHandler = new ConfirmOrderForExHandler(true); $response = Factory::common($this->getConfig())->order->setMockHandler([$mockHandler])->confirmForEx($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'orderNo', 'hisSerialNo', 'confirmTime', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } }