private function UpdateOfferStatus() { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('orders'); if (isset($_REQUEST['o']) && isset($_REQUEST['s'])) { $order_id = (int) $_REQUEST['o']; $status = (int) $_REQUEST['s']; $order = GetOffer($order_id); if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { echo 0; exit; } #--------------- Baskaran $statuscode = ''; if ($status == '12') { $type = "PRIOR_AUTH_CAPTURE"; $statuscode = $this->PaymentStatus($order_id, $type); } else { $type = "VOID"; $statuscode = $this->PaymentStatus($order_id, $type); } #--------------- if ($statuscode == '1') { if (UpdateOfferStatus($order_id, $status)) { echo 1; } else { echo 0; } } } else { echo 0; } exit; }
private function UpdateOfferStatus() { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('orders'); if (isset($_REQUEST['o']) && isset($_REQUEST['s'])) { $order_id = (int) $_REQUEST['o']; $status = (int) $_REQUEST['s']; $order = GetOffer($order_id); if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { echo 0; exit; } #--------------- Baskaran $statuscode = ''; if ($status == '12') { $type = "PRIOR_AUTH_CAPTURE"; $statuscode = $this->PaymentStatus($order_id, $type); } else { $type = "VOID"; $statuscode = $this->PaymentStatus($order_id, $type); } $query = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * from [|PREFIX|]offers where orderid = '{$order_id}'"); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($query); $cus_email = $row['ordbillemail']; #--------------- require_once ISC_BASE_PATH . "/lib/email.php"; $store_name = GetConfig('StoreName'); if ($statuscode == '1') { if (UpdateOfferStatus($order_id, $status)) { if ($status == '12') { $message = "Your Offer has been approved"; } else { $message = "Your offer has been denied"; } $obj_email = GetEmailClass(); $obj_email->Set('CharSet', GetConfig('CharacterSet')); $obj_email->From(GetConfig('OrderEmail'), $store_name); $obj_email->Set("Subject", "Make an Offer"); $obj_email->AddBody("html", $message); $obj_email->AddRecipient($cus_email, "", "h"); $email_result = $obj_email->Send(); echo 1; } else { $message = "Your offer has been denied"; $obj_email = GetEmailClass(); $obj_email->Set('CharSet', GetConfig('CharacterSet')); $obj_email->From(GetConfig('OrderEmail'), $store_name); $obj_email->Set("Subject", "Make an Offer"); $obj_email->AddBody("html", $message); $obj_email->AddRecipient($cus_email, "", "h"); $email_result = $obj_email->Send(); echo 0; } } } else { echo 0; } exit; }