public function testPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); $response = new Response($this->getMockRequest(), $httpResponse->getBody()); $this->assertFalse($response->isSuccessful()); $this->assertSame('', $response->getTransactionReference()); $this->assertSame('Input variable errors', $response->getMessage()); }
public function testAuthorizeSuccess() { $httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt'); $response = new Response($this->getMockRequest(), $httpResponse->json()); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('MTQ0NjgzMTQ5OArABirnISnF5KCCbyjn', $response->getTransactionReference()); $this->assertNull($response->getCardReference()); $this->assertNull($response->getMessage()); }