Example #1
0
    $user = GameUsers::getGameUserById($userId);
    $error = true;
} else {
    $log->logError(LanguageUtils::getText("LANG_API_USER_ID_EMPTY"));
    $result->result = LanguageUtils::getText("LANG_API_USER_ID_EMPTY");
}
$product = new GameFbProducts();
if ($error) {
    $error = false;
    if (!empty($productId)) {
        $product = GameFbProducts::getProductById($productId);
        $error = true;
    } else {
        $log->logError(LanguageUtils::getText("LANG_API_ITEM_ID_EMPTY"));
        $result->result = LanguageUtils::getText("LANG_API_ITEM_ID_EMPTY");
    }
    if ($error) {
        if ($product->type == GameFbProducts::$TYPE_CAMPAIGN) {
            $type = $type . "_campaign";
        }
        $log->logInfo("buyProduct : userId > " . $userId . " productId > " . $productId . " requestId > " . $requestId . " paymentId > " . $paymentId . " status > " . $status . " quantity > " . $quantity . " amount > " . $amount . " currency > " . $currency . " type > " . $type);
        $time = time();
        try {
            $result = FBProductUtils::buyProduct($user, $product, $requestId, $paymentId, $signedReq, $status, $currency, $amount, $quantity, $type, $time);
        } catch (Exception $exc) {
            echo $exc->getMessage();
        }
    }
}
echo json_encode($result);
exit(1);
Example #2
0
        $tag = $_GET["tag"];
        $str = $tag . " " . $orderBy;
        $soldItemList = ItemUtils::getSoldItemList($start, $end, $str);
        if ($orderBy == "DESC") {
            $orderBy = "ASC";
        } else {
            $orderBy = "DESC";
        }
    }
} else {
    $str = "itemId " . $orderBy;
    $soldItemList = ItemUtils::getSoldItemList($start, $end, $str);
}
$total_item = ItemUtils::getSoldItemCount($start, $end);
$paymentList = FBProductUtils::getFBProductLogs($start, $end);
$totalPayment = FBProductUtils::getTotalPayment();
?>
<div class="container">
    Payments
    <hr> 
    <div class="row">
        <div class="offset4 span8" style="height: 40px ;margin-left: 228px;margin-bottom: 10px;">
            <table>
                <tr>
                <form action="payments.php" method="post">
                    <td> 
                    <div id="startDate" class="input-append date" >
                        <label style="float: left; height: 30px; color: #7ba29a; font-weight: bold; margin-top: 3px;" >Start Date :</label>
                        <input type="text" name="txtStartDate" value="<?php 
echo $sdate;
?>