public function testPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); $response = new PurchaseResponse($this->getMockRequest(), $httpResponse->json()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('One or more fields is invalid (invalid currency code)', $response->getMessage()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); }
public function testPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); $response = new PurchaseResponse($this->getMockRequest(), $httpResponse->json()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('limitExceeded: Invoice not created due to account limits, please check your approval levels', $response->getMessage()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); }