-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathOrderTransaction.php
More file actions
34 lines (26 loc) · 1.02 KB
/
OrderTransaction.php
File metadata and controls
34 lines (26 loc) · 1.02 KB
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
<?php
class OrderTransaction {
public function getRecordQuery($tran_id)
{
$sql = "select * from orders WHERE transaction_id='" . $tran_id . "'";
return $sql;
}
public function saveTransactionQuery($post_data)
{
$name = $post_data['cus_name'];
$email = $post_data['cus_email'];
$phone = $post_data['cus_phone'];
$transaction_amount = $post_data['total_amount'];
$address = $post_data['cus_add1'];
$transaction_id = $post_data['tran_id'];
$currency = $post_data['currency'];
$sql = "INSERT INTO orders (name, email, phone, amount, address, status, transaction_id,currency)
VALUES ('$name', '$email', '$phone','$transaction_amount','$address','Pending', '$transaction_id','$currency')";
return $sql;
}
public function updateTransactionQuery($tran_id, $type = 'Success')
{
$sql = "UPDATE orders SET status='$type' WHERE transaction_id='$tran_id'";
return $sql;
}
}