5 use Omnipay\Tests\GatewayTestCase;
14 $this->gateway =
new ProGateway($this->getHttpClient(), $this->getHttpRequest());
16 $this->options = array(
19 'firstName' =>
'Example',
21 'number' =>
'4111111111111111',
22 'expiryMonth' =>
'12',
23 'expiryYear' =>
'2017',
31 $this->setMockHttpResponse(
'ProPurchaseSuccess.txt');
33 $response = $this->gateway->authorize($this->options)->send();
35 $this->assertTrue($response->isSuccessful());
36 $this->assertEquals(
'96U93778BD657313D', $response->getTransactionReference());
37 $this->assertNull($response->getMessage());
42 $this->setMockHttpResponse(
'ProPurchaseSuccess.txt');
44 $response = $this->gateway->purchase($this->options)->send();
46 $this->assertTrue($response->isSuccessful());
47 $this->assertEquals(
'96U93778BD657313D', $response->getTransactionReference());
48 $this->assertNull($response->getMessage());
53 $request = $this->gateway->fetchTransaction(array(
'transactionReference' =>
'abc123'));
55 $this->assertInstanceOf(
'\Omnipay\PayPal\Message\FetchTransactionRequest', $request);
56 $this->assertSame(
'abc123', $request->getTransactionReference());