Skip to content

Commit 554471b

Browse files
Merge branch 'master' of https://github.com/phpviet/omnipay-momo
2 parents f07d3ec + be1513c commit 554471b

File tree

11 files changed

+57
-61
lines changed

11 files changed

+57
-61
lines changed

src/AllInOneGateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use Omnipay\MoMo\Message\AllInOne\PurchaseRequest;
1313
use Omnipay\MoMo\Message\AllInOne\QueryRefundRequest;
1414
use Omnipay\MoMo\Message\AllInOne\NotificationRequest;
15-
use Omnipay\MoMo\Message\AllInOne\QueryTransactionRequest;
1615
use Omnipay\MoMo\Message\AllInOne\CompletePurchaseRequest;
16+
use Omnipay\MoMo\Message\AllInOne\QueryTransactionRequest;
1717

1818
/**
1919
* @link https://developers.momo.vn/#/docs/aio/

src/Message/Concerns/ResponseProperties.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __get($name)
2626
} else {
2727
trigger_error(sprintf('Undefined property: %s::%s', __CLASS__, '$'.$name), E_USER_NOTICE);
2828

29-
return null;
29+
return;
3030
}
3131
}
3232

src/Message/Concerns/ResponseSignatureValidation.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ protected function validateSignature(): void
3737
}
3838

3939
if (! $signature->validate($data, $this->data['signature'])) {
40-
4140
throw new InvalidResponseException(sprintf('Data signature response from MoMo is invalid!'));
4241
}
4342
}

src/Message/PayConfirmRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function setRequestType(string $type): void
137137
protected function getSignatureParameters(): array
138138
{
139139
return [
140-
'partnerCode', 'partnerRefId', 'requestType', 'requestId', 'momoTransId'
140+
'partnerCode', 'partnerRefId', 'requestType', 'requestId', 'momoTransId',
141141
];
142142
}
143143
}

src/Support/Arr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Arr
1111
{
1212
/**
13-
* Hổ trợ lấy giá trị trong mảng với định dạng 'a.b.c'
13+
* Hổ trợ lấy giá trị trong mảng với định dạng 'a.b.c'.
1414
*
1515
* @param mixed $element
1616
* @param array $arr

tests/AllInOne/AllInOneGatewayTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
namespace Omnipay\MoMo\Tests\AllInOne;
99

10-
use Omnipay\MoMo\Message\AllInOne\NotificationRequest;
1110
use Omnipay\Omnipay;
1211
use Omnipay\Tests\GatewayTestCase;
1312
use Omnipay\Common\Exception\InvalidRequestException;
13+
use Omnipay\MoMo\Message\AllInOne\NotificationRequest;
1414
use Omnipay\MoMo\Message\AllInOne\CompletePurchaseRequest;
1515

1616
/**
@@ -19,7 +19,6 @@
1919
*/
2020
class AllInOneGatewayTest extends GatewayTestCase
2121
{
22-
2322
protected function setUp()
2423
{
2524
$this->gateway = Omnipay::create('MoMo_AllInOne', $this->getHttpClient(), $this->getHttpRequest());

tests/AllInOne/Message/IncomingResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testResponse()
3333
$response = new IncomingResponse(
3434
$request,
3535
[
36-
'test' => 321
36+
'test' => 321,
3737
]
3838
);
3939

tests/AllInOne/Message/QueryRefundRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace Omnipay\MoMo\Tests\AllInOne\Message;
99

10-
use Omnipay\MoMo\Message\AllInOne\QueryRefundRequest;
1110
use Omnipay\Tests\TestCase;
11+
use Omnipay\MoMo\Message\AllInOne\QueryRefundRequest;
1212

1313
/**
1414
* @author Vuong Minh <vuongxuongminh@gmail.com>

tests/AppInApp/AppInAppGatewayTest.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
use Omnipay\Tests\GatewayTestCase;
77

88
/**
9-
* Class AppInAppGatewayTest
10-
*
11-
* @package Omnipay\MoMo\Tests\AppInApp
9+
* Class AppInAppGatewayTest.
1210
*/
1311
class AppInAppGatewayTest extends GatewayTestCase
1412
{
@@ -64,11 +62,11 @@ public function testPayConfirm()
6462
{
6563
$this->setMockHttpResponse('PayConfirm.txt');
6664
$response = $this->gateway->payConfirm([
67-
"partnerRefId" => "Merchant123556666",
68-
"requestType" => "capture",
69-
"requestId" => "1512529262248",
70-
"momoTransId" => "12436514111",
71-
"customerNumber" => "0963181714",
65+
'partnerRefId' => 'Merchant123556666',
66+
'requestType' => 'capture',
67+
'requestId' => '1512529262248',
68+
'momoTransId' => '12436514111',
69+
'customerNumber' => '0963181714',
7270
])->send();
7371

7472
$this->assertTrue($response->isSuccessful());
@@ -79,11 +77,11 @@ public function testRefund()
7977
{
8078
$this->setMockHttpResponse('Refund.txt');
8179
$response = $this->gateway->refund([
82-
"partnerRefId" => "Merchant123556666",
83-
"requestType" => "capture",
84-
"requestId" => "1512529262248",
85-
"momoTransId" => "12436514111",
86-
"amount" => 30000,
80+
'partnerRefId' => 'Merchant123556666',
81+
'requestType' => 'capture',
82+
'requestId' => '1512529262248',
83+
'momoTransId' => '12436514111',
84+
'amount' => 30000,
8785
])->send();
8886

8987
$this->assertTrue($response->isSuccessful());
@@ -94,9 +92,9 @@ public function testQueryTransaction()
9492
{
9593
$this->setMockHttpResponse('QueryTransaction.txt');
9694
$response = $this->gateway->queryTransaction([
97-
"partnerRefId" => "Merchant123556666",
98-
"requestId" => "1512529262248",
99-
"momoTransId" => "12436514111",
95+
'partnerRefId' => 'Merchant123556666',
96+
'requestId' => '1512529262248',
97+
'momoTransId' => '12436514111',
10098
])->send();
10199

102100
$this->assertTrue($response->isSuccessful());

tests/POS/POSGatewayTest.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function testPurchaseSuccess()
4343
{
4444
$this->setMockHttpResponse('PurchaseSuccess.txt');
4545
$response = $this->gateway->purchase([
46-
"partnerRefId" => "Merchant123556666",
47-
"amount" => 30000,
48-
"paymentCode" => "MM627755248085056826",
49-
"storeId" => "001",
50-
"storeName" => "Cửa hàng 01 của đối tác",
46+
'partnerRefId' => 'Merchant123556666',
47+
'amount' => 30000,
48+
'paymentCode' => 'MM627755248085056826',
49+
'storeId' => '001',
50+
'storeName' => 'Cửa hàng 01 của đối tác',
5151
])->send();
5252

5353
$this->assertTrue($response->isSuccessful());
@@ -58,11 +58,11 @@ public function testPurchaseFailure()
5858
{
5959
$this->setMockHttpResponse('PurchaseFailure.txt');
6060
$response = $this->gateway->purchase([
61-
"partnerRefId" => "Merchant123556666",
62-
"amount" => 30000,
63-
"paymentCode" => "MM627755248085056826",
64-
"storeId" => "001",
65-
"storeName" => "Cửa hàng 01 của đối tác",
61+
'partnerRefId' => 'Merchant123556666',
62+
'amount' => 30000,
63+
'paymentCode' => 'MM627755248085056826',
64+
'storeId' => '001',
65+
'storeName' => 'Cửa hàng 01 của đối tác',
6666
])->send();
6767

6868
$this->assertFalse($response->isSuccessful());
@@ -74,11 +74,11 @@ public function testPayConfirm()
7474
{
7575
$this->setMockHttpResponse('PayConfirm.txt');
7676
$response = $this->gateway->payConfirm([
77-
"partnerRefId" => "Merchant123556666",
78-
"requestType" => "capture",
79-
"requestId" => "1512529262248",
80-
"momoTransId" => "12436514111",
81-
"customerNumber" => "0963181714",
77+
'partnerRefId' => 'Merchant123556666',
78+
'requestType' => 'capture',
79+
'requestId' => '1512529262248',
80+
'momoTransId' => '12436514111',
81+
'customerNumber' => '0963181714',
8282
])->send();
8383

8484
$this->assertTrue($response->isSuccessful());
@@ -89,11 +89,11 @@ public function testRefund()
8989
{
9090
$this->setMockHttpResponse('Refund.txt');
9191
$response = $this->gateway->refund([
92-
"partnerRefId" => "Merchant123556666",
93-
"requestType" => "capture",
94-
"requestId" => "1512529262248",
95-
"momoTransId" => "12436514111",
96-
"amount" => 30000
92+
'partnerRefId' => 'Merchant123556666',
93+
'requestType' => 'capture',
94+
'requestId' => '1512529262248',
95+
'momoTransId' => '12436514111',
96+
'amount' => 30000,
9797
])->send();
9898

9999
$this->assertTrue($response->isSuccessful());
@@ -104,9 +104,9 @@ public function testQueryTransaction()
104104
{
105105
$this->setMockHttpResponse('QueryTransaction.txt');
106106
$response = $this->gateway->queryTransaction([
107-
"partnerRefId" => "Merchant123556666",
108-
"requestId" => "1512529262248",
109-
"momoTransId" => "12436514111",
107+
'partnerRefId' => 'Merchant123556666',
108+
'requestId' => '1512529262248',
109+
'momoTransId' => '12436514111',
110110
])->send();
111111

112112
$this->assertTrue($response->isSuccessful());

0 commit comments

Comments
 (0)