Skip to content

Commit b99b25a

Browse files
sudiptpaStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 37e0c5a commit b99b25a

10 files changed

+73
-72
lines changed

index.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/vendor/autoload.php';
3+
require __DIR__.'/vendor/autoload.php';
44

55
use Omnipay\Common\CreditCard;
66
use Omnipay\Omnipay;
@@ -13,19 +13,19 @@
1313
$gateway->setTestMode(true);
1414

1515
$card = new CreditCard([
16-
'firstName' => 'Sujip',
17-
'lastName' => 'Thapa',
18-
'number' => '4444333322221111',
16+
'firstName' => 'Sujip',
17+
'lastName' => 'Thapa',
18+
'number' => '4444333322221111',
1919
'expiryMonth' => '12',
20-
'expiryYear' => date('Y'),
21-
'cvv' => '123',
20+
'expiryYear' => date('Y'),
21+
'cvv' => '123',
2222
]);
2323

2424
$response = $gateway->purchase([
25-
'amount' => '12.00',
25+
'amount' => '12.00',
2626
'transactionId' => 'ORDER-ZYX8789',
27-
'currency' => 'AUD',
28-
'card' => $card,
27+
'currency' => 'AUD',
28+
'card' => $card,
2929
])->send();
3030

3131
$message = sprintf(

src/DirectPostGateway.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
/**
88
* NABTransact Direct Post Gateway.
9+
*
910
* @link https://demo.transact.nab.com.au/nabtransact/downloadDocs.nab?nav=3-4
1011
*/
1112
class DirectPostGateway extends AbstractGateway
1213
{
1314
/**
14-
* @var boolean
15+
* @var bool
1516
*/
1617
public $transparentRedirect = true;
1718

@@ -23,9 +24,9 @@ public function getName()
2324
public function getDefaultParameters()
2425
{
2526
return [
26-
'merchantId' => '',
27+
'merchantId' => '',
2728
'transactionPassword' => '',
28-
'testMode' => false,
29+
'testMode' => false,
2930
];
3031
}
3132

src/Message/DirectPostCompletePurchaseResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class DirectPostCompletePurchaseResponse extends AbstractResponse
1111
{
1212
/**
13-
* @return boolean
13+
* @return bool
1414
*/
1515
public function isSuccessful()
1616
{

src/Message/UnionPayPurchaseRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getData()
3333
*/
3434
public function sendData($data)
3535
{
36-
$redirectUrl = $this->getEndpoint() . '?' . http_build_query($data);
36+
$redirectUrl = $this->getEndpoint().'?'.http_build_query($data);
3737

3838
return $this->response = new UnionPayPurchaseResponse($this, $data, $redirectUrl);
3939
}

src/SecureXMLGateway.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public function getName()
1717
public function getDefaultParameters()
1818
{
1919
return [
20-
'merchantId' => '',
20+
'merchantId' => '',
2121
'transactionPassword' => '',
22-
'testMode' => false,
22+
'testMode' => false,
2323
];
2424
}
2525

tests/Message/DirectPostAuthorizeRequestTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ public function setUp()
1111
$this->request = new DirectPostAuthorizeRequest($this->getHttpClient(), $this->getHttpRequest());
1212

1313
$this->request->initialize([
14-
'merchantId' => 'XYZ0010',
14+
'merchantId' => 'XYZ0010',
1515
'transactionPassword' => 'abcd1234',
16-
'amount' => '12.00',
17-
'returnUrl' => 'https://www.abc.com/return',
18-
'card' => [
19-
'number' => '4444333322221111',
16+
'amount' => '12.00',
17+
'returnUrl' => 'https://www.abc.com/return',
18+
'card' => [
19+
'number' => '4444333322221111',
2020
'expiryMonth' => '6',
21-
'expiryYear' => '2030',
22-
'cvv' => '123',
21+
'expiryYear' => '2030',
22+
'cvv' => '123',
2323
],
2424
]);
2525
}

tests/Message/DirectPostCompletePurchaseRequestTest.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public function setUp()
1414
public function testGenerateResponseFingerprint()
1515
{
1616
$this->request->initialize([
17-
'amount' => '465.18',
17+
'amount' => '465.18',
1818
'transactionPassword' => 'abcd1234',
1919
]);
2020

2121
$data = [
22-
'timestamp' => '20190215173250',
23-
'merchant' => 'XYZ0010',
24-
'refid' => '222',
22+
'timestamp' => '20190215173250',
23+
'merchant' => 'XYZ0010',
24+
'refid' => '222',
2525
'summarycode' => '2',
2626
];
2727

@@ -34,24 +34,24 @@ public function testGenerateResponseFingerprint()
3434
public function testSuccess()
3535
{
3636
$this->request->initialize([
37-
'amount' => '12.00',
37+
'amount' => '12.00',
3838
'transactionPassword' => 'abcd1234',
39-
'transactionId' => 'ORDER-ZYX8',
39+
'transactionId' => 'ORDER-ZYX8',
4040
]);
4141

4242
$this->getHttpRequest()->query->replace([
43-
'timestamp' => '20190215173250',
43+
'timestamp' => '20190215173250',
4444
'callback_status_code' => '-1',
45-
'fingerprint' => 'd319e8852e94972f8ef3f330884a0f5db85c6341fd367d6823a99e9b93d917c0',
46-
'txnid' => '271337',
47-
'merchant' => 'XYZ0010',
48-
'restext' => 'Approved',
49-
'rescode' => '00',
50-
'expirydate' => '20190215',
51-
'settdate' => '20190215',
52-
'refid' => 'ORDER-ZYX8',
53-
'pan' => '444433...111',
54-
'summarycode' => '1',
45+
'fingerprint' => 'd319e8852e94972f8ef3f330884a0f5db85c6341fd367d6823a99e9b93d917c0',
46+
'txnid' => '271337',
47+
'merchant' => 'XYZ0010',
48+
'restext' => 'Approved',
49+
'rescode' => '00',
50+
'expirydate' => '20190215',
51+
'settdate' => '20190215',
52+
'refid' => 'ORDER-ZYX8',
53+
'pan' => '444433...111',
54+
'summarycode' => '1',
5555
]);
5656

5757
$response = $this->request->send();
@@ -68,23 +68,23 @@ public function testSuccess()
6868
public function testFailure()
6969
{
7070
$this->request->initialize([
71-
'amount' => '465.18',
71+
'amount' => '465.18',
7272
'transactionPassword' => 'abcd1234',
7373
]);
7474

7575
$this->getHttpRequest()->query->replace([
76-
'timestamp' => '20190215173250',
76+
'timestamp' => '20190215173250',
7777
'callback_status_code' => '404',
78-
'fingerprint' => 'af490d2635a7ebe8e97313fbea61924a51f4b4d095e2cf7a2a81f8fc3f5ca919',
79-
'txnid' => '274279',
80-
'merchant' => 'XYZ0010',
81-
'restext' => 'Customer Dispute',
82-
'rescode' => '18',
83-
'expirydate' => '102030',
84-
'settdate' => '20190215',
85-
'refid' => 'ORDER-ZYX8',
86-
'pan' => '444433...111',
87-
'summarycode' => '2',
78+
'fingerprint' => 'af490d2635a7ebe8e97313fbea61924a51f4b4d095e2cf7a2a81f8fc3f5ca919',
79+
'txnid' => '274279',
80+
'merchant' => 'XYZ0010',
81+
'restext' => 'Customer Dispute',
82+
'rescode' => '18',
83+
'expirydate' => '102030',
84+
'settdate' => '20190215',
85+
'refid' => 'ORDER-ZYX8',
86+
'pan' => '444433...111',
87+
'summarycode' => '2',
8888
]);
8989

9090
$response = $this->request->send();

tests/Message/DirectPostPurchaseRequestTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ public function setUp()
1111
$this->request = new DirectPostPurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
1212

1313
$this->request->initialize([
14-
'merchantId' => 'XYZ0010',
14+
'merchantId' => 'XYZ0010',
1515
'transactionPassword' => 'abcd1234',
16-
'amount' => '12.00',
17-
'returnUrl' => 'https://www.example.com/return',
18-
'card' => [
19-
'number' => '4444333322221111',
16+
'amount' => '12.00',
17+
'returnUrl' => 'https://www.example.com/return',
18+
'card' => [
19+
'number' => '4444333322221111',
2020
'expiryMonth' => '06',
21-
'expiryYear' => '2020',
22-
'cvv' => '123',
21+
'expiryYear' => '2020',
22+
'cvv' => '123',
2323
],
2424
]);
2525
}

tests/Message/SecureXMLAuthorizeRequestTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ public function setUp()
1111
$this->request = new SecureXMLAuthorizeRequest($this->getHttpClient(), $this->getHttpRequest());
1212

1313
$this->request->initialize([
14-
'merchantId' => 'XYZ0010',
14+
'merchantId' => 'XYZ0010',
1515
'transactionPassword' => 'abcd1234',
16-
'testMode' => true,
17-
'amount' => '12.00',
18-
'transactionId' => '1234',
19-
'card' => [
20-
'number' => '4444333322221111',
21-
'expiryMonth' => '10',
22-
'expiryYear' => '2030',
23-
'cvv' => '123',
16+
'testMode' => true,
17+
'amount' => '12.00',
18+
'transactionId' => '1234',
19+
'card' => [
20+
'number' => '4444333322221111',
21+
'expiryMonth' => '10',
22+
'expiryYear' => '2030',
23+
'cvv' => '123',
2424
'cardHolderName' => 'Sujip Thapa',
2525
],
2626
]);

tests/Message/UnionPayPurchaseRequestTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ public function setUp()
1111
$this->request = new UnionPayPurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
1212

1313
$this->request->initialize([
14-
'merchantId' => 'XYZ0010',
14+
'merchantId' => 'XYZ0010',
1515
'transactionPassword' => 'abcd1234',
16-
'amount' => '12.00',
17-
'returnUrl' => 'https://www.example.com/return',
18-
'transactionId' => 'GHJGG76756556',
16+
'amount' => '12.00',
17+
'returnUrl' => 'https://www.example.com/return',
18+
'transactionId' => 'GHJGG76756556',
1919
]);
2020
}
2121

0 commit comments

Comments
 (0)