Esempio n. 1
0
 public function testDirectPurchase3dSecure()
 {
     $httpResponse = $this->getMockHttpResponse('DirectPurchase3dSecure.txt');
     $response = new Response($this->getMockRequest(), $httpResponse->getBody());
     $this->getMockRequest()->shouldReceive('getReturnUrl')->once()->andReturn('https://www.example.com/return');
     $this->assertFalse($response->isSuccessful());
     $this->assertTrue($response->isRedirect());
     $this->assertSame('{"VendorTxCode":"123456"}', $response->getTransactionReference());
     $this->assertNull($response->getMessage());
     $this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl());
     $redirectData = $response->getRedirectData();
     $this->assertSame('065379457749061954', $redirectData['MD']);
     $this->assertSame('BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn', $redirectData['PaReq']);
     $this->assertSame('https://www.example.com/return', $redirectData['TermUrl']);
 }