Open Journal Systems  3.3.0
vendor/omnipay/paypal/tests/Message/RestAuthorizeResponseTest.php
1 <?php
2 
3 
4 namespace Omnipay\PayPal\Message;
5 
6 
7 use Omnipay\Tests\TestCase;
8 
9 class RestAuthorizeResponseTest extends TestCase
10 {
12  {
13  $httpResponse = $this->getMockHttpResponse('RestPurchaseWithoutCardSuccess.txt');
14  $data = json_decode($httpResponse->getBody()->getContents(), true);
15 
16  $response = new RestAuthorizeResponse($this->getMockRequest(), $data, $httpResponse->getStatusCode());
17 
18  $this->assertTrue($response->isSuccessful());
19  $this->assertSame('PAY-3TJ47806DA028052TKTQGVYI', $response->getTransactionReference());
20  $this->assertNull($response->getMessage());
21 
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());
25  }
26 }
Omnipay\PayPal\Message\RestAuthorizeResponse
Definition: lib/vendor/omnipay/paypal/src/Message/RestAuthorizeResponse.php:13
Omnipay\PayPal\Message\RestAuthorizeResponseTest\testRestPurchaseWithoutCardSuccess
testRestPurchaseWithoutCardSuccess()
Definition: vendor/omnipay/paypal/tests/Message/RestAuthorizeResponseTest.php:11
Omnipay\PayPal\Message
Definition: lib/vendor/omnipay/paypal/src/Message/AbstractRequest.php:6