function wa_payment_complete($id)
 {
     require_once WA_PLUGIN_DIR . '/includes/class-wa-db.php';
     $db = new WA_Db();
     $params = array("tableName" => "wa_product_orders", "arrItems" => array("order_id" => $id, "date" => date('Y/m/d H:i:s'), "status" => 0));
     $db->insert($params);
     echo "success.";
 }
Example #2
0
 function wa_save_price_bid_product()
 {
     extract($_POST);
     $check_price = $this->wa_check_bid_product($product_id, $price);
     $result_arr = array();
     do_action('after_wa_bid');
     if ($check_price == false) {
         $next_price = $this->wa_next_price_bid_product(false);
         $highest_price = $this->wa_get_highest_bid_by_productid($product_id);
         $result_arr['st'] = 'fail';
         $result_arr['ico'] = '<i class="ion-ios-close" style="color: red"></i>';
         $result_arr['mess'] = 'Bid fail.';
         $result_arr['next_price'] = $next_price;
         $result_arr['highest_price'] = WA_Helper::currency($highest_price[0]['price']);
     } else {
         global $user_ID;
         require_once WA_PLUGIN_DIR . '/includes/class-wa-db.php';
         $db = new WA_Db();
         $arr_query = array("tableName" => "wa_product_bids", "arrItems" => array("product_id" => $product_id, "user_id" => $user_ID, "date" => date('Y-m-d H:i:s'), "price" => $price, "status" => 1));
         $rowID = $db->insert($arr_query);
         $result_arr['st'] = 'success';
         $result_arr['ico'] = '<i class="ion-ios-checkmark" style="color: green"></i>';
         $result_arr['mess'] = 'Bid success, thank you!';
     }
     do_action('before_wa_bid');
     echo json_encode(apply_filters('before_wa_result_bid_data', $result_arr));
     exit;
 }