5 use Omnipay\Tests\TestCase;
14 public function setUp()
23 $startDate =
'2015-01-01';
24 $endDate =
'2016-01-01';
26 $this->request->initialize(array(
29 'startDate' => $startDate,
30 'endDate' => $endDate,
31 'salutation' =>
'Mr.',
32 'firstName' =>
'Jhon',
33 'middleName' =>
'Carter',
34 'lastName' =>
'Macgiver',
36 'email' =>
'test@email.com',
37 'receiver' =>
'Patt Doret',
38 'receiptId' =>
'1111',
39 'transactionId' =>
'XKCD',
40 'invoiceNumber' =>
'123456789',
41 'card' => array(
'number' =>
'376449047333005'),
42 'auctionItemNumber' =>
'321564',
43 'transactionClass' =>
'Received',
44 'status' =>
'Success',
45 'profileId' =>
'00000000000'
48 $data = $this->request->getData();
50 $startDate = new \DateTime($startDate);
51 $endDate = new \DateTime($endDate);
53 $this->assertSame(
'10.00', $data[
'AMT']);
54 $this->assertSame(
'USD', $data[
'CURRENCYCODE']);
55 $this->assertSame($startDate->format(\DateTime::ISO8601), $data[
'STARTDATE']);
56 $this->assertSame($endDate->format(\DateTime::ISO8601), $data[
'ENDDATE']);
57 $this->assertSame(
'Mr.', $data[
'SALUTATION']);
58 $this->assertSame(
'Jhon', $data[
'FIRSTNAME']);
59 $this->assertSame(
'Carter', $data[
'MIDDLENAME']);
60 $this->assertSame(
'Macgiver', $data[
'LASTNAME']);
61 $this->assertSame(
'Jh', $data[
'SUFFIX']);
62 $this->assertSame(
'test@email.com', $data[
'EMAIL']);
63 $this->assertSame(
'XKCD', $data[
'TRANSACTIONID']);
64 $this->assertSame(
'123456789', $data[
'INVNUM']);
65 $this->assertSame(
'376449047333005', $data[
'ACCT']);
66 $this->assertSame(
'321564', $data[
'AUCTIONITEMNUMBER']);
67 $this->assertSame(
'Received', $data[
'TRANSACTIONCLASS']);
68 $this->assertSame(
'Success', $data[
'STATUS']);
69 $this->assertSame(
'00000000000', $data[
'PROFILEID']);
74 $this->request->initialize(array());
76 $this->setExpectedException(
77 '\Omnipay\Common\Exception\InvalidRequestException',
78 'The startDate parameter is required'
81 $this->request->getData();
86 $this->request->setStartDate(
'2015-01-01');
87 $this->request->setAmount(150.00);
89 $this->setExpectedException(
90 '\Omnipay\Common\Exception\InvalidRequestException',
91 'The currency parameter is required'
94 $this->request->getData();