Skip to content

Commit 302d2bf

Browse files
Implemented isCancelled in Response class.
1 parent 1361da7 commit 302d2bf

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Changelog
22

33
Tất cả lịch sử tiến trình phát triển thư viện
4+
5+
## 1.0.1
6+
7+
- Implement phương thức `isCancelled` ở lớp `\Omnipay\OnePay\Message\Response`.

src/Message/Concerns/RequestEndpoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait RequestEndpoint
2424
protected $testEndpoint;
2525

2626
/**
27-
* Trả về url kết nối MoMo.
27+
* Trả về url kết nối OnePay.
2828
*
2929
* @return string
3030
*/

src/Message/Concerns/ResponseSignatureValidation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
trait ResponseSignatureValidation
1818
{
1919
/**
20-
* Kiểm tra tính hợp lệ của dữ liệu do MoMo phản hồi.
20+
* Kiểm tra tính hợp lệ của dữ liệu do OnePay phản hồi.
2121
*
2222
* @throws InvalidResponseException
2323
*/

src/Message/Response.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Response extends AbstractResponse
2020
use Concerns\ResponseProperties;
2121

2222
/**
23-
* Trả về trạng thái do MoMo phản hồi.
23+
* Trả về trạng thái thành công hay không do OnePay phản hồi.
2424
*
2525
* @return bool
2626
*/
@@ -30,7 +30,17 @@ public function isSuccessful(): bool
3030
}
3131

3232
/**
33-
* Trả về thông báo từ MoMo.
33+
* Trả về trạng thái có bị khách hủy đơn hay không do OnePay phản hồi.
34+
*
35+
* @return bool
36+
*/
37+
public function isCancelled(): bool
38+
{
39+
return '99' === $this->getCode();
40+
}
41+
42+
/**
43+
* Trả về thông báo từ OnePay.
3444
*
3545
* @return null|string
3646
*/

0 commit comments

Comments
 (0)