public function testServerPurchaseWithToken() { $httpResponse = $this->getMockHttpResponse('ServerPurchaseWithToken.txt'); $response = new ServerAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); $this->assertFalse($response->isSuccessful()); $this->assertTrue($response->isRedirect()); $this->assertSame('{ABCDEFGH-ABCD-ABCD-ABCD-ABCDEFGHIJKL}', $response->getToken()); }
public function testServerPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('ServerPurchaseFailure.txt'); $response = new ServerAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertSame('The Description field should be between 1 and 100 characters long.', $response->getMessage()); }
public function testServerPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('ServerPurchaseFailure.txt'); $response = new ServerAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('{"VendorTxCode":"123456"}', $response->getTransactionReference()); $this->assertSame('3082 : The Description value is too long.', $response->getMessage()); }