5 use Omnipay\Tests\GatewayTestCase;
24 public function setUp()
30 $this->options = array(
32 'returnUrl' =>
'https://www.example.com/return',
33 'cancelUrl' =>
'https://www.example.com/cancel',
35 $this->voidOptions = array(
36 'transactionReference' =>
'ASDFASDFASDF',
42 $this->setMockHttpResponse(
'ExpressPurchaseSuccess.txt');
44 $response = $this->gateway->authorize($this->options)->send();
46 $this->assertInstanceOf(
'\Omnipay\PayPal\Message\ExpressInContextAuthorizeResponse', $response);
47 $this->assertFalse($response->isPending());
48 $this->assertFalse($response->isSuccessful());
49 $this->assertTrue($response->isRedirect());
50 $this->assertEquals(
'https://www.paypal.com/checkoutnow?useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
55 $this->setMockHttpResponse(
'ExpressPurchaseSuccess.txt');
57 $response = $this->gateway->purchase($this->options)->send();
59 $this->assertInstanceOf(
'\Omnipay\PayPal\Message\ExpressInContextAuthorizeResponse', $response);
60 $this->assertFalse($response->isPending());
61 $this->assertFalse($response->isSuccessful());
62 $this->assertTrue($response->isRedirect());
63 $this->assertEquals(
'https://www.paypal.com/checkoutnow?useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
68 $this->setMockHttpResponse(
'ExpressOrderSuccess.txt');
70 $response = $this->gateway->order($this->options)->send();
72 $this->assertInstanceOf(
'\Omnipay\PayPal\Message\ExpressInContextAuthorizeResponse', $response);
73 $this->assertFalse($response->isPending());
74 $this->assertFalse($response->isSuccessful());
75 $this->assertTrue($response->isRedirect());
76 $this->assertEquals(
'https://www.paypal.com/checkoutnow?useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());