forked from NOTAD/apimomoapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapimomo.php
43 lines (40 loc) · 1.15 KB
/
apimomo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* @package NOTAD API MOMO
* @author LÊ HỒNG SƠN : 0387654818
* @copyright Copyright (c) 2021, notad.net
* @link https://notad.net
* @since Version 1.0
* @method Sell Api Lịch sử giao dịch VCB, TCB 0387654818
*/
include ('class.momo.php');
if (isset($_GET['tranid'])) {
$tranid = $_GET['tranid'];
$sql = "SELECT * FROM `api_momo` WHERE `tranId` = '".$tranid."' ";
if ($db->query($sql) == TRUE) {
$sql = "SELECT * FROM `api_momo` WHERE `tranId` = '".$tranid."' ";
$data = $db->query($sql);
foreach ($data as $value) {
$array = [
'tranid' => $value['tranId'],
'sdt' => $value['partnerId'],
'name' => $value['partnerName'],
'amount' => $value['amount'],
'comment' => $value['comment'],
'time' => $value['time']
];
echo json_encode($array);
}
} else {
$array = [
'msg' => 'key hoặc tranid không tồn tại',
];
echo json_encode($array);
}
} else {
$array = [
'msg' => 'lỗi',
];
echo json_encode($array);
}
?>