-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathclass.orderpeer.php
37 lines (33 loc) · 1.08 KB
/
class.orderpeer.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
<?php
class OrderPeer
{
// Singleton object. Leave $me alone.
private static $me;
static function create($user_id, $payment_hash, $days, $amount)
{
$dbInsert = new DBObject("premium_order",
array("user_id", "payment_hash", "days",
"amount", "order_status", "date_created"));
$dbInsert->user_id = $user_id;
$dbInsert->payment_hash = $payment_hash;
$dbInsert->days = $days;
$dbInsert->amount = $amount;
$dbInsert->order_status = 'pending';
$dbInsert->date_created = date("Y-m-d H:i:s", time());
if($dbInsert->insert())
{
return $dbInsert;
}
return false;
}
static function loadByPaymentTracker($paymentHash)
{
$orderObj = new Order();
$orderObj->select($paymentHash, 'payment_hash');
if(!$orderObj->ok())
{
return false;
}
return $orderObj;
}
}