public function testDeleteCardFailure() { $httpResponse = $this->getMockHttpResponse('DeleteCardFailure.txt'); $response = new Response($this->getMockRequest(), $httpResponse->json()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getCardReference()); $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage()); }
public function testPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); $response = new Response($this->getMockRequest(), $httpResponse->json()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('ch_1IUAZQWFYrPooM', $response->getTransactionReference()); $this->assertNull($response->getCardReference()); $this->assertSame('Your card was declined', $response->getMessage()); }