Skip to content

Commit 21a2ab1

Browse files
Added docs query transaction and refund docs to POS, AppInApp, QRCode gateways.
1 parent 12f879f commit 21a2ab1

File tree

3 files changed

+141
-3
lines changed

3 files changed

+141
-3
lines changed

docs/AppInApp.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,52 @@ if ($response->isSuccessful()) {
6565

6666
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/app_in_app?id=x%c3%a1c-nh%e1%ba%adn-giao-d%e1%bb%8bch).
6767

68+
## Kiểm tra trạng thái giao dịch:
69+
70+
```php
71+
$response = $gateway->queryTransaction([
72+
'partnerRefId' => '123',
73+
'requestId' => '456',
74+
])->send();
75+
76+
if ($response->isSuccessful()) {
77+
// TODO: xử lý kết quả.
78+
print $response->data['amount'];
79+
80+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
81+
82+
} else {
83+
84+
print $response->getMessage();
85+
}
86+
```
87+
88+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/query_status?id=tra-c%e1%bb%a9u-giao-d%e1%bb%8bch).
89+
90+
## Yêu cầu hoàn tiền:
91+
92+
```php
93+
$response = $gateway->refund([
94+
'partnerRefId' => '123',
95+
'requestId' => '999',
96+
'momoTransId' => 321,
97+
'amount' => 50000,
98+
])->send();
99+
100+
if ($response->isSuccessful()) {
101+
// TODO: xử lý kết quả.
102+
print $response->amount;
103+
104+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
105+
106+
} else {
107+
108+
print $response->getMessage();
109+
}
110+
```
111+
112+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/refund?id=ho%c3%a0n-ti%e1%bb%81n-giao-d%e1%bb%8bch).
113+
68114
## Phương thức hổ trợ debug:
69115

70116
Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả về `FALSE`:
@@ -74,4 +120,4 @@ Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả v
74120
print $response->getMessage(); // câu thông báo lỗi do MoMo gửi sang.
75121
```
76122

77-
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/aio/?id=b%e1%ba%a3ng-m%c3%a3-l%e1%bb%97i).
123+
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/error_code?id=c%c3%a1c-m%c3%a3-l%e1%bb%97i-th%c6%b0%e1%bb%9dng-g%e1%ba%b7p).

docs/POS.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,52 @@ if ($response->isSuccessful()) {
6666

6767
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/pos_payment?id=x%c3%a1c-nh%e1%ba%adn-giao-d%e1%bb%8bch).
6868

69+
## Kiểm tra trạng thái giao dịch:
70+
71+
```php
72+
$response = $gateway->queryTransaction([
73+
'partnerRefId' => '123',
74+
'requestId' => '456',
75+
])->send();
76+
77+
if ($response->isSuccessful()) {
78+
// TODO: xử lý kết quả.
79+
print $response->data['amount'];
80+
81+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
82+
83+
} else {
84+
85+
print $response->getMessage();
86+
}
87+
```
88+
89+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/query_status?id=tra-c%e1%bb%a9u-giao-d%e1%bb%8bch).
90+
91+
## Yêu cầu hoàn tiền:
92+
93+
```php
94+
$response = $gateway->refund([
95+
'partnerRefId' => '123',
96+
'requestId' => '999',
97+
'momoTransId' => 321,
98+
'amount' => 50000,
99+
])->send();
100+
101+
if ($response->isSuccessful()) {
102+
// TODO: xử lý kết quả.
103+
print $response->amount;
104+
105+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
106+
107+
} else {
108+
109+
print $response->getMessage();
110+
}
111+
```
112+
113+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/refund?id=ho%c3%a0n-ti%e1%bb%81n-giao-d%e1%bb%8bch).
114+
69115
## Phương thức hổ trợ debug:
70116

71117
Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả về `FALSE`:
@@ -75,4 +121,4 @@ Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả v
75121
print $response->getMessage(); // câu thông báo lỗi do MoMo gửi sang.
76122
```
77123

78-
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/aio/?id=b%e1%ba%a3ng-m%c3%a3-l%e1%bb%97i).
124+
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/error_code?id=c%c3%a1c-m%c3%a3-l%e1%bb%97i-th%c6%b0%e1%bb%9dng-g%e1%ba%b7p).

docs/QRCode.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,52 @@ if ($response->isSuccessful()) {
6161

6262
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/qr_payment?id=x%c3%a1c-nh%e1%ba%adn-giao-d%e1%bb%8bch).
6363

64+
## Kiểm tra trạng thái giao dịch:
65+
66+
```php
67+
$response = $gateway->queryTransaction([
68+
'partnerRefId' => '123',
69+
'requestId' => '456',
70+
])->send();
71+
72+
if ($response->isSuccessful()) {
73+
// TODO: xử lý kết quả.
74+
print $response->data['amount'];
75+
76+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
77+
78+
} else {
79+
80+
print $response->getMessage();
81+
}
82+
```
83+
84+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/query_status?id=tra-c%e1%bb%a9u-giao-d%e1%bb%8bch).
85+
86+
## Yêu cầu hoàn tiền:
87+
88+
```php
89+
$response = $gateway->refund([
90+
'partnerRefId' => '123',
91+
'requestId' => '999',
92+
'momoTransId' => 321,
93+
'amount' => 50000,
94+
])->send();
95+
96+
if ($response->isSuccessful()) {
97+
// TODO: xử lý kết quả.
98+
print $response->amount;
99+
100+
var_dump($response->getData()); // toàn bộ data do MoMo gửi về.
101+
102+
} else {
103+
104+
print $response->getMessage();
105+
}
106+
```
107+
108+
Kham khảo thêm các tham trị khi tạo yêu cầu và MoMo trả về tại [đây](https://developers.momo.vn/#/docs/refund?id=ho%c3%a0n-ti%e1%bb%81n-giao-d%e1%bb%8bch).
109+
64110
## Phương thức hổ trợ debug:
65111

66112
Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả về `FALSE`:
@@ -70,4 +116,4 @@ Một số phương thức chung hổ trợ debug khi `isSuccessful()` trả v
70116
print $response->getMessage(); // câu thông báo lỗi do MoMo gửi sang.
71117
```
72118

73-
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/aio/?id=b%e1%ba%a3ng-m%c3%a3-l%e1%bb%97i).
119+
Kham khảo bảng báo lỗi `getCode()` chi tiết tại [đây](https://developers.momo.vn/#/docs/error_code?id=c%c3%a1c-m%c3%a3-l%e1%bb%97i-th%c6%b0%e1%bb%9dng-g%e1%ba%b7p).

0 commit comments

Comments
 (0)