function Notify(AbstractPaymentModule $PaymentModule, $status) { global $PaymentModuleFactory; if ($status == PAYMENT_STATUS::SUCCESS) { UI::Redirect("payment_success.php?op=".$_SESSION['wizard']['whois']["operation"]); } else { $smarty = Core::GetSmartyInstance("SmartyExt"); $PaymentForm = $PaymentModule->GetPaymentForm(); $payment_module = $PaymentModuleFactory->GetModuleObjectByName($_SESSION['wizard']['checkout']["gate"]); $fields = $PaymentForm->ListFields(); $smarty_fields = array(); foreach($fields as $field) { $smarty_fields[$field->Title] = array("name" => $field->Name, "required" => $field->IsRequired, "type" => $field->FieldType, "values" => $field->Options); if ($_REQUEST[$field->Name]) $attr[$field->Title] = $_REQUEST[$field->Name]; } $display["errors"] = explode("\n", $PaymentModule->GetFailureReason()); $display["fields"] = $smarty_fields; $display["post"] = $attr; $display['phone_widget'] = Phone::GetInstance()->GetWidget(); $template_name = "paymentgate.tpl"; $smarty->assign($GLOBALS["display"]); $smarty->assign($display); $smarty->display($template_name); } }
} catch (Exception $e) { $err = $e->getMessage(); } } else { $payment_module = $PaymentModuleFactory->GetModuleObjectByName($_REQUEST["gate"]); // If Total = 0 then mark all invoices in order as paid if ($Order->GetTotal() == 0) { $Order->MarkAsPaid($payment_module); $okmsg = _("Payment successfully complete"); UI::Redirect("order_info.php?orderid={$Order->ID}"); } else { $payment_module->AttachObserver(new UIPaymentObserver()); $client_row = $db->GetRow("SELECT * FROM users WHERE id='{$_SESSION["userid"]}'"); if ($_POST && $post_action == "proceed") { $chk = $payment_module->ValidatePaymentFormData($_POST); if ($chk === true) { $reflect = new ReflectionObject($payment_module); if ($reflect->implementsInterface("IPostBackPaymentModule")) $payment_module->RedirectToGateway($Order, array_merge($client_row, $_POST));
/** * Redirect user to gateway payment form, using HTTP 'Location:' header or UI:RedirectPOST($host, $values); * * @param float $amount Purchase amount * @param int $orderid Order ID. Can be used as an unique identifier. * @param string $payment_for Human-readable description of the payment * @param array $post_values Array of fields, posted back by your payment form. Array keys are equal to field names you returned in IPaymentModule::GetPaymentForm() * @return bool True if payment succeed or false if failed. If payment is failed and you return false, $this->GetFailureReason() will also be called. */ public final function RedirectToGateway(Order $order, $post_values = array()) { if (CONTEXTS::$APPCONTEXT == APPCONTEXT::REGISTRANT_CP) { UI::Redirect("invoice_print.php?id={$order->ID}"); } elseif (CONTEXTS::$APPCONTEXT == APPCONTEXT::ORDERWIZARD) { $smarty = Core::GetSmartyInstance("SmartyExt"); $smarty->assign($GLOBALS["display"]); $smarty->display("order_complete.tpl"); exit(); } }
} } } // If order has invoices, save it and issue invoices if (count($Order->GetInvoiceList())) { Log::Log("Save order", E_USER_NOTICE); $Order->Save(); $invoices_paid = true; foreach ($Order->GetInvoiceList() as $_Invoice) { $invoices_paid &= $_Invoice->Status == INVOICE_STATUS::PAID; } if ($Order->GetTotal() == 0 || $invoices_paid) { UI::Redirect("order_info.php?orderid={$Order->ID}"); } else { $_SESSION['orderid'] = $Order->ID; UI::Redirect("checkout.php"); } } } } $display["attr"] = $_POST; if (!$stepno) { $stepno = 1; } // // get TLD Prices // if ($stepno == 1) { $display["transferTLDs"] = array(); foreach ($TLDs as $k => $v) { try {
public function loginAsOwnerAction() { $account = Scalr_Account::init()->loadById($this->getParam(self::CALL_PARAM_NAME)); $owner = $account->getOwner(); Scalr_Session::create($owner->getId()); UI::Redirect("/#/dashboard"); }
{ $db->Execute("UPDATE countries SET enabled='1' WHERE id=?", array($row["id"])); $row["enabled"] = 1; } elseif (!isset($post_enabled[$row["id"]]) && $row['enabled'] == 1) { $db->Execute("UPDATE countries SET enabled='0' WHERE id=?", array($row["id"])); $row["enabled"] = 0; } $db->Execute("UPDATE countries SET vat=? WHERE id=?", array(round($post_vat[$row["id"]], 2), $row["id"])); $row["vat"] = $post_vat[$row["id"]]; $mess = _("Countries successfully saved"); } $display["rows"][] = $row; } if ($_POST && $post_actionsubmit) UI::Redirect("countries.php"); $display["pn"] = $req_pn; $display["pt"] = $req_pt; $display["pf"] = $post_filter_q ? $post_filter_q : $req_pf; $display["help"] = ""; require_once ("src/append.inc.php"); ?>