7 use Omnipay\Tests\TestCase;
9 class RestAuthorizeResponseTest
extends TestCase
13 $httpResponse = $this->getMockHttpResponse(
'RestPurchaseWithoutCardSuccess.txt');
14 $data = json_decode($httpResponse->getBody()->getContents(),
true);
16 $response =
new RestAuthorizeResponse($this->getMockRequest(), $data, $httpResponse->getStatusCode());
18 $this->assertTrue($response->isSuccessful());
19 $this->assertSame(
'PAY-3TJ47806DA028052TKTQGVYI', $response->getTransactionReference());
20 $this->assertNull($response->getMessage());
22 $this->assertNull($response->getRedirectData());
23 $this->assertSame(
'GET', $response->getRedirectMethod());
24 $this->assertSame(
'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-5KV58254GL528393N', $response->getRedirectUrl());