コード例 #1
0
 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());
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 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());
 }