/** * tests the creation of a preauth and a transaction. * * The amounts differ from each other so it won't create a standalone transaction */ public function testPreAuthAndCapture() { $this->_paymentProcessor->setPreAuthAmount(1100); $this->assertTrue($this->ProcessPayment()); $this->assertInternalType('string', $this->_paymentProcessor->getPreauthId()); $transactionId = $this->_paymentProcessor->getTransactionId(); $result = $this->_transactionObject->getOne($transactionId); $this->assertInternalType('array', $result); $this->assertEquals('20000', $result['response_code']); $this->assertEquals($transactionId, $result['id']); $this->assertArrayHasKey('preauthorization', $result); $this->assertInternalType('array', $result['preauthorization']); $this->assertArrayHasKey('id', $result['preauthorization']); $this->assertEquals($this->_paymentProcessor->getPreauthId(), $result['preauthorization']['id']); }