/** * test for _buildBasicRequest (BDCODE) */ public function testFetchTransactionInfoForBN() { $response = $this->getGatewayResponseObject(); $this->gatewayMock->expects($this->once())->method('postRequest')->willReturn($response); $this->initStoreMock(); $this->configMock->expects($this->once())->method('getBuildNotationCode')->will($this->returnValue('BNCODE')); $payment = $this->getMock('Magento\\Payment\\Model\\Info', ['setTransactionId', '__wakeup'], [], '', false); $payment->expects($this->once())->method('setTransactionId')->will($this->returnSelf()); $this->payflowpro->fetchTransactionInfo($payment, 'AD49G8N825'); }
/** * test for _buildBasicRequest (BDCODE) */ public function testFetchTransactionInfoForBN() { $storeMock = $this->getMock('Magento\\Store\\Model\\Store', ['getId'], [], '', false); $response = new \Magento\Framework\Object(['result' => '0', 'pnref' => 'V19A3D27B61E', 'respmsg' => 'Approved', 'authcode' => '510PNI', 'hostcode' => 'A', 'request_id' => 'f930d3dc6824c1f7230c5529dc37ae5e', 'result_code' => '0']); $this->gatewayMock->expects($this->once())->method('postRequest')->willReturn($response); $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock); $storeMock->expects($this->once())->method('getId')->willReturn(77); $this->configMock->expects($this->once())->method('getBuildNotationCode')->will($this->returnValue('BNCODE')); $payment = $this->getMock('Magento\\Payment\\Model\\Info', ['setTransactionId', '__wakeup'], [], '', false); $payment->expects($this->once())->method('setTransactionId')->will($this->returnSelf()); $this->payflowpro->fetchTransactionInfo($payment, 'AD49G8N825'); }