Пример #1
0
 public function processSave()
 {
     require_once dirname(__FILE__) . "/AgileSellerPaymentInfo.php";
     if (Tools::getValue("id_seller") <= 0) {
         $this->errors[] = Tools::displayError("Seller is required.");
     }
     if (Tools::getValue("id_agile_seller_paymentinfo") <= 0) {
         if (AgileSellerPaymentInfo::is_seller_payment_info_existed(Tools::getValue("module_name"), Tools::getValue("id_seller"))) {
             $this->errors[] = Tools::displayError("Seller Payment Info " . Tools::getValue("module_name") . " module already exsited.");
         }
     }
     ${${"GLOBALS"}["oxouihb"]} = array(" ", "\t", "\r\n", "\n", "\r");
     if (Tools::getValue("module_name") == "googlecheckout") {
         $tsookg = "toRemove";
         $_POST["info1"] = str_replace(${$tsookg}, "", $_POST["info1"]);
         if (AgileSellerPaymentInfo::is_seller_payment_account_existed("googlecheckout", Tools::getValue("id_seller"), Tools::getValue("info1"))) {
             $this->errors[] = Tools::displayError("The google checkout merchant id has been used by another seller.");
         }
     }
     if (Tools::getValue("module_name") == "agilepaypal") {
         ${"GLOBALS"}["aaifkstfva"] = "toRemove";
         $_POST["info1"] = str_replace(${${"GLOBALS"}["aaifkstfva"]}, "", $_POST["info1"]);
         if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilepaypal", Tools::getValue("id_seller"), Tools::getValue("info1"))) {
             $this->errors[] = Tools::displayError("The paypal account email address has been used by another seller.");
         }
         if (((int) $_POST["in_use_on"] || !empty($_POST["info1"])) && !Validate::isEmail($_POST["info1"])) {
             $this->errors[] = Tools::displayError("The paypal account email is invalid.");
         }
     }
     if (!empty($this->errors)) {
         $this->redirect_after = false;
         return false;
     }
     $_POST["in_use"] = (int) Tools::getValue("in_use_on");
     parent::processSave();
 }
 public function hookSubcartPaymentInfo($modulename, $formid, $is_parallel_payment = false)
 {
     global $smarty, $cookie;
     $_SESSION[self::SUBCART_SESSION_KEY] = 0;
     if (intval(Configuration::get("AGILE_MS_PAYMENT_MODE")) == self::PAYMENT_MODE_SELLER or ${${"GLOBALS"}["ecmmoezcsbwo"]} == "parallel_confirm_form") {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         ${"GLOBALS"}["udjhod"] = "unpaid_sellers";
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/AgileSellerPaymentInfo.php";
         ${${"GLOBALS"}["udjhod"]} = self::get_unpaid_sellers();
         if (!empty(${${"GLOBALS"}["uhnoyti"]}) and count(${${"GLOBALS"}["uhnoyti"]}) > 0) {
             $pegmrqvvh = "unpaid_sellers";
             $qfgtoxgglb = "unpaid_seller";
             ${"GLOBALS"}["owphoxzzq"] = "existSupportPayment";
             ${"GLOBALS"}["cqmbmhojw"] = "formid";
             ${"GLOBALS"}["ivclipi"] = "recepient";
             $gjsoifwdwzb = "is_parallel_payment";
             ${${"GLOBALS"}["vlhmfsabigj"]} = array();
             foreach (${$pegmrqvvh} as ${$qfgtoxgglb}) {
                 $cszptxpxew = "unpaid_seller";
                 ${"GLOBALS"}["kybolky"] = "id_seller";
                 ${"GLOBALS"}["tcdertwhmw"] = "subcart_discounts";
                 $iefslihwm = "id_seller";
                 $uzgiknt = "subcart_discounts";
                 ${"GLOBALS"}["vbpkbvdrm"] = "support_payment";
                 $lowipyaeb = "formid";
                 ${"GLOBALS"}["wvfdosp"] = "other_info";
                 $jabgpgnqebr = "id_seller";
                 ${${"GLOBALS"}["vbpkbvdrm"]} = 1;
                 $fdcpbg = "seller_name";
                 ${"GLOBALS"}["xbhypslnqt"] = "id_seller";
                 ${${"GLOBALS"}["qcrytsf"]} = ${$cszptxpxew}["id_owner"];
                 if (${$iefslihwm} > 0 && ${$lowipyaeb} != "parallel_confirm_form") {
                     $mpjbyikbk = "modulename";
                     ${"GLOBALS"}["jbztmlz"] = "modulename";
                     ${${"GLOBALS"}["tvyjtwh"]} = ${${"GLOBALS"}["zphwvfrdss"]};
                     $tekrbf = "paymentinfo";
                     if (${${"GLOBALS"}["jbztmlz"]} == "agilegooglecheckout") {
                         $frykoy = "payment_modulename";
                         ${$frykoy} = "googlecheckout";
                     } else {
                         if (${$mpjbyikbk} == "agilebankwire") {
                             ${"GLOBALS"}["humivxnjrbk"] = "payment_modulename";
                             ${${"GLOBALS"}["humivxnjrbk"]} = "bankwire";
                         }
                     }
                     ${"GLOBALS"}["lldqjfu"] = "payment_modulename";
                     ${$tekrbf} = AgileSellerPaymentInfo::getForSellerByModuleName(${${"GLOBALS"}["lldqjfu"]}, ${${"GLOBALS"}["qcrytsf"]});
                     if (!Validate::isLoadedObject(${${"GLOBALS"}["ntnrquojkaa"]})) {
                         ${${"GLOBALS"}["vjlgjofetoi"]} = 0;
                     } else {
                         if ($paymentinfo->in_use != 1) {
                             $brbrgptdpef = "support_payment";
                             ${$brbrgptdpef} = 0;
                         }
                     }
                 }
                 ${"GLOBALS"}["epycwhcjrfr"] = "seller_name";
                 $xerwnucdb = "cartinfo";
                 ${${"GLOBALS"}["oclbkvhtf"]} = AgileMultipleSeller::create_subcart_for_seller(${$jabgpgnqebr});
                 ${"GLOBALS"}["rivnorkzj"] = "moduleinstance";
                 ${"GLOBALS"}["ngpracnqrs"] = "moduleinstance";
                 $rmsixygh = "modulename";
                 ${${"GLOBALS"}["epycwhcjrfr"]} = "";
                 ${"GLOBALS"}["rgokucipqb"] = "subcart_total";
                 if (${${"GLOBALS"}["kybolky"]} == 0) {
                     ${${"GLOBALS"}["rcxekslsb"]} = Configuration::get("PS_SHOP_NAME");
                 } else {
                     ${"GLOBALS"}["polxsocg"] = "id_seller";
                     $iqphuuwjje = "seller_name";
                     ${${"GLOBALS"}["atnqtpp"]} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["polxsocg"]}), $cookie->id_lang);
                     ${$iqphuuwjje} = isset(${${"GLOBALS"}["atnqtpp"]}) ? $sellerinfo->company : $this->getL("Unknow");
                 }
                 Cache::clean("Cart::getCartRules" . ${$xerwnucdb}["id_cart"] . "-*");
                 ${${"GLOBALS"}["uuouexp"]} = new Cart(${${"GLOBALS"}["oclbkvhtf"]}["id_cart"]);
                 ${${"GLOBALS"}["rgokucipqb"]} = $subcart->getOrderTotal(true, Cart::BOTH, null, null, false);
                 ${${"GLOBALS"}["tcdertwhmw"]} = $subcart->getOrderTotal(true, Cart::ONLY_DISCOUNTS, null, null, false);
                 ${${"GLOBALS"}["brvkng"]} = $subcart->getOrderTotal(true, Cart::BOTH) - $subcart->getOrderTotal(false, Cart::BOTH);
                 ${${"GLOBALS"}["gcpcmr"]} = Module::getInstanceByName(${$rmsixygh});
                 ${"GLOBALS"}["duvlppreoh"] = "recepients";
                 ${${"GLOBALS"}["krvwnkwth"]} = "";
                 if (Validate::isLoadedObject(${${"GLOBALS"}["rivnorkzj"]}) && method_exists(${${"GLOBALS"}["ngpracnqrs"]}, "getAdditionalInfo")) {
                     ${${"GLOBALS"}["krvwnkwth"]} = $moduleinstance->getAdditionalInfo(${${"GLOBALS"}["qcrytsf"]});
                 }
                 ${${"GLOBALS"}["duvlppreoh"]}[] = array("id_seller" => ${${"GLOBALS"}["xbhypslnqt"]}, "support_payment" => ${${"GLOBALS"}["vjlgjofetoi"]}, "seller_name" => ${$fdcpbg}, "products" => $subcart->getProducts(), "id_subcart" => $subcart->id, "total_tax" => ${${"GLOBALS"}["brvkng"]}, "shippingCost" => $subcart->getOrderTotal(true, Cart::ONLY_SHIPPING), "subcart_total" => ${${"GLOBALS"}["ewciuizck"]}, "subcart_totaldiscounts" => ${$uzgiknt}, "other_info" => ${${"GLOBALS"}["wvfdosp"]});
             }
             $wfvtkolo = "recepients";
             ${${"GLOBALS"}["oxuqpqbl"]} = false;
             foreach (${$wfvtkolo} as ${${"GLOBALS"}["ivclipi"]}) {
                 ${"GLOBALS"}["lwviwhhyz"] = "recepient";
                 if (${${"GLOBALS"}["lwviwhhyz"]}["support_payment"] == 1) {
                     ${"GLOBALS"}["imdsmll"] = "existSupportPayment";
                     ${${"GLOBALS"}["imdsmll"]} = true;
                     break;
                 }
             }
             if (!${${"GLOBALS"}["owphoxzzq"]}) {
                 return "";
             }
             $smarty->assign(array("recepients" => ${${"GLOBALS"}["vlhmfsabigj"]}, "modulename" => ${${"GLOBALS"}["zphwvfrdss"]}, "moduleformid" => ${${"GLOBALS"}["cqmbmhojw"]}, "is_parallel_payment" => ${$gjsoifwdwzb}));
             return $this->display($this->get_module_file(), "payment-subcart.tpl");
         }
     }
 }
Пример #3
0
 protected function processSubmitSellerinfo()
 {
     ${"GLOBALS"}["ffnxcnlg"] = "id_paymentinfo_paypal";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${"GLOBALS"}["frvqikxjd"] = "paypal_inuse";
     $wcqfvynoolh = "id_paymentinfo_cod";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/AgileSellerPaymentInfo.php";
     ${${"GLOBALS"}["ztmujejepnz"]} = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer), self::$cookie->id_lang);
     if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilepaypal", $sellerinfo->id_seller, Tools::getValue("paypal_email"))) {
         $this->errors[] = Tools::displayError("The paypal account email has been used by another seller.");
     }
     ${"GLOBALS"}["uohljc"] = "id_paymentinfo_paypal";
     ${"GLOBALS"}["oxhfxn"] = "paypal_emailaddress";
     ${${"GLOBALS"}["oxhfxn"]} = Tools::getValue("paypal_email");
     ${"GLOBALS"}["yxiqwgdbl"] = "paymentinfo_paypal";
     ${${"GLOBALS"}["frvqikxjd"]} = (int) Tools::getValue("paypal_in_use");
     if ((${${"GLOBALS"}["zmendemfxetq"]} || !empty(${${"GLOBALS"}["wkdsijnbhw"]})) && !Validate::isEmail(${${"GLOBALS"}["wkdsijnbhw"]})) {
         $this->errors[] = Tools::displayError("The paypal account email is invalid.");
     }
     if (!empty($this->errors)) {
         return;
     }
     ${"GLOBALS"}["gzxrhutccoo"] = "cod_notes";
     ${${"GLOBALS"}["uohljc"]} = intval(Tools::getValue("id_paymentinfo_paypal"));
     if (${${"GLOBALS"}["ffnxcnlg"]} > 0) {
         ${${"GLOBALS"}["yxiqwgdbl"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["xcjjpktqh"]});
     } else {
         ${${"GLOBALS"}["hwlygpy"]} = new AgileSellerPaymentInfo();
         $paymentinfo_paypal->id = 0;
         $paymentinfo_paypal->id_currency = 0;
     }
     $paymentinfo_paypal->id_seller = $sellerinfo->id_seller;
     ${"GLOBALS"}["urxswawvr"] = "paymentinfo_cod";
     $paymentinfo_paypal->module_name = "agilepaypal";
     $paymentinfo_paypal->info1 = Tools::getValue("paypal_email");
     $paymentinfo_paypal->in_use = Tools::getValue("paypal_in_use");
     $paymentinfo_paypal->save();
     ${${"GLOBALS"}["gzxrhutccoo"]} = Tools::getValue("cod_notes");
     ${${"GLOBALS"}["ybifkiqb"]} = (int) Tools::getValue("cod_in_use");
     ${$wcqfvynoolh} = intval(Tools::getValue("id_paymentinfo_cod"));
     if (${${"GLOBALS"}["nmyqlkttxp"]} > 0) {
         ${${"GLOBALS"}["urxswawvr"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["xcjjpktqh"]});
     } else {
         $wgvhvlphcwd = "paymentinfo_cod";
         ${$wgvhvlphcwd} = new AgileSellerPaymentInfo();
         $paymentinfo_cod->id = 0;
     }
     $paymentinfo_cod->id_seller = $sellerinfo->id_seller;
     $paymentinfo_cod->module_name = "agilecashondelivery";
     $paymentinfo_cod->info1 = Tools::getValue("cod_notes");
     $paymentinfo_cod->in_use = Tools::getValue("cod_in_use");
     $paymentinfo_cod->save();
     if (Module::isInstalled("agilegooglecheckout")) {
         $dtrinzc = "id_paymentinfo_gcheckout";
         if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilegooglecheckout", $sellerinfo->id_seller, Tools::getValue("gcheckout_merchant_id"))) {
             $this->errors[] = Tools::displayError("The google checkout account has been used by another seller.");
             return;
         }
         $pcyquknfjc = "id_paymentinfo_gcheckout";
         $yucskmiujsn = "paymentinfo_gcheckout";
         ${$dtrinzc} = intval(Tools::getValue("id_paymentinfo_gcheckout"));
         if (${$pcyquknfjc} > 0) {
             ${$yucskmiujsn} = new AgileSellerPaymentInfo(${${"GLOBALS"}["rmpumsc"]});
         } else {
             ${${"GLOBALS"}["hocodd"]} = new AgileSellerPaymentInfo();
             $paymentinfo_gcheckout->id = 0;
             $paymentinfo_gcheckout->id_currency = 0;
         }
         $paymentinfo_gcheckout->id_seller = $sellerinfo->id_seller;
         $paymentinfo_gcheckout->module_name = "googlecheckout";
         $paymentinfo_gcheckout->info1 = Tools::getValue("gcheckout_merchant_id");
         $paymentinfo_gcheckout->info2 = Tools::getValue("gcheckout_key");
         $paymentinfo_gcheckout->in_use = Tools::getValue("gcheckout_in_use");
         $paymentinfo_gcheckout->save();
     }
     if (Module::isInstalled("agilebankwire")) {
         $sefhkjfq = "paymentinfo_bankwire";
         ${"GLOBALS"}["udeoyndd"] = "id_paymentinfo_bankwire";
         ${${"GLOBALS"}["nxbcvt"]} = intval(Tools::getValue("id_paymentinfo_bankwire"));
         if (${${"GLOBALS"}["udeoyndd"]} > 0) {
             ${$sefhkjfq} = new AgileSellerPaymentInfo(${${"GLOBALS"}["nxbcvt"]});
         } else {
             ${"GLOBALS"}["wkjndne"] = "paymentinfo_bankwire";
             ${${"GLOBALS"}["wkjndne"]} = new AgileSellerPaymentInfo();
             $paymentinfo_bankwire->id = 0;
             $paymentinfo_bankwire->id_currency = 0;
         }
         $paymentinfo_bankwire->id_seller = $sellerinfo->id_seller;
         $paymentinfo_bankwire->module_name = "bankwire";
         $paymentinfo_bankwire->info1 = Tools::getValue("bankwire_accountowner");
         $paymentinfo_bankwire->info2 = Tools::getValue("bankwire_accountdetails");
         $paymentinfo_bankwire->info3 = Tools::getValue("bankwire_bankaddress");
         $paymentinfo_bankwire->in_use = Tools::getValue("bankwire_in_use");
         $paymentinfo_bankwire->save();
     }
     if (Module::isInstalled("agilepaybycheque")) {
         $yjttwrr = "id_paymentinfo_agilepaybycheque";
         ${"GLOBALS"}["ysarmtdkwo"] = "id_paymentinfo_agilepaybycheque";
         ${$yjttwrr} = intval(Tools::getValue("id_paymentinfo_agilepaybycheque"));
         if (${${"GLOBALS"}["ysarmtdkwo"]} > 0) {
             ${${"GLOBALS"}["swrqbqopsma"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["gqrxkgtct"]});
         } else {
             $brrgvkf = "paymentinfo_agilepaybycheque";
             ${$brrgvkf} = new AgileSellerPaymentInfo();
             $paymentinfo_agilepaybycheque->id = 0;
             $paymentinfo_agilepaybycheque->id_currency = 0;
         }
         $paymentinfo_agilepaybycheque->id_seller = $sellerinfo->id_seller;
         $paymentinfo_agilepaybycheque->module_name = "agilepaybycheque";
         $paymentinfo_agilepaybycheque->info1 = Tools::getValue("agilepaybycheque_paytoname");
         $paymentinfo_agilepaybycheque->info2 = Tools::getValue("agilepaybycheque_address");
         $paymentinfo_agilepaybycheque->in_use = Tools::getValue("agilepaybycheque_in_use");
         $paymentinfo_agilepaybycheque->save();
     }
     if (empty($this->errors)) {
         self::$smarty->assign("cfmmsg_flag", 1);
     }
 }