|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
decode a php file encoded by fopo |
|
Posted: Sun May 12, 2013 4:37 am |
|
|
vcr_semorgh |
Beginner |
|
|
Joined: May 11, 2013 |
Posts: 3 |
|
|
|
|
|
|
|
|
|
|
|
|
Re: decode a php file encoded by fopo |
|
Posted: Sun May 12, 2013 10:24 am |
|
|
david |
Advanced user |
|
|
Joined: Jan 04, 2013 |
Posts: 58 |
|
|
|
|
|
|
|
Decoded
Code: |
<?php
$license_domain = "irlot.com"; preg_match("@^(?:http://)?([^/]+)@i",$_SERVER["HTTP_HOST"], $host); preg_match('/[^.]+\.[^.]+$/', $host[1], $matches); if ($matches[0] == $license_domain){ require_once("ext/lib/nusoap.php"); class osC_Payment_mellat extends osC_Payment { var $_title, $_code = "mellat", $_status = false, $_sort_order, $_order_id; function osC_Payment_mellat() { global $order, $osC_Database, $osC_Language, $osC_ShoppingCart; $this->_title = $osC_Language->get("payment_mellat_title"); $this->_method_title = $osC_Language->get("payment_mellat_method_title"); $this->_status = (MODULE_PAYMENT_MELLAT_STATUS == "1") ? true : false; $this->_sort_order = MODULE_PAYMENT_MELLAT_SORT_ORDER; $this->form_action_url = "https://pgw.bpm.bankmellat.ir/pgwchannel/startpay.mellat"; if ($this->_status === true) { if ((int)MODULE_PAYMENT_MELLAT_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_MELLAT_ORDER_STATUS_ID; } if ((int)MODULE_PAYMENT_MELLAT_ZONE > 0) { $check_flag = false; $Qcheck = $osC_Database->query("select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id"); $Qcheck->bindTable(":table_zones_to_geo_zones", TABLE_ZONES_TO_GEO_ZONES); $Qcheck->bindInt(":geo_zone_id", MODULE_PAYMENT_MELLAT_ZONE); $Qcheck->bindInt(":zone_country_id", $osC_ShoppingCart->getBillingAddress("country_id")); $Qcheck->execute(); while ($Qcheck->next()) { if ($Qcheck->valueInt("zone_id") < 1) { $check_flag = true; break; } elseif ($Qcheck->valueInt("zone_id") == $osC_ShoppingCart->getBillingAddress("zone_id")) { $check_flag = true; break; } } if ($check_flag === false) { $this->_status = false; } } } } function selection() { return array("id" => $this->_code, "module" => $this->_method_title); } function pre_confirmation_check() { return false; } function confirmation() { global $osC_Language, $osC_CreditCard; $this->_order_id = osC_Order :: insert(ORDERS_STATUS_PREPARING); $confirmation = array("title" => $this->_method_title, "fields" => array(array("title" => $osC_Language->get("payment_mellat_description")))); return $confirmation; } function process_button() { global $osC_Currencies, $osC_ShoppingCart, $osC_Language, $osC_Database; if (MODULE_PAYMENT_MELLAT_CURRENCY == "Selected Currency") { $currency = $osC_Currencies->getCode(); } else { $currency = MODULE_PAYMENT_MELLAT_CURRENCY; } $amount = round($osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $currency), 2); $order = $this->_order_id; $client = new nusoap_client("https://pgws.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl"); $namespace="http://interfaces.core.sw.bps.com/"; $terminalId = MODULE_PAYMENT_MELLAT_TERMINAL_ID; $userName = MODULE_PAYMENT_MELLAT_USER_NAME; $userPassword = MODULE_PAYMENT_MELLAT_USER_PASSWORD; $orderId = $order; $amount = $amount; $localDate = date("Ymd"); $localTime = date("His"); $additionalData = ''; $payerId = 0; $callBackUrl = osc_href_link(FILENAME_CHECKOUT, "process", "SSL", null, null, true); $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "amount" => $amount, "localDate" => $localDate, "localTime" => $localTime, "additionalData" => $additionalData, "callBackUrl" => $callBackUrl, "payerId" => $payerId); $result = $client->call("bpPayRequest", $parameters, $namespace); if ($client->fault) { echo $osC_Language->get("payment_mellat_connection_fault")."<br><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { echo $osC_Language->get("payment_mellat_connection_error")."<br>"; echo "<pre>" . $err . "</pre>"; die(); } else { $res = explode (",",$resultStr); $ResCode = $res[0]; if ($ResCode == "0") { $osC_Database->simpleQuery("insert into `" . DB_TABLE_PREFIX . "online_transactions`
\x9 \x9 \x9 \x9(orders_id,receipt_id,transaction_method,transaction_date,transaction_amount,transaction_id) values
\x9 ('$order','$res[1]','mellat','','$amount','')
\x9 \x9 \x9 "); } else { osC_Order::remove($this->_order_id); echo check_mellat_state_error($ResCode)."<br>"; } } } $process_button_string = osc_draw_hidden_field("RefId", $res[1]); return $process_button_string; } function get_error() { return false; } function process() { global $osC_Language, $osC_Customer, $osC_ShoppingCart, $_POST, $_GET, $osC_Database, $messageStack; $RefId = $_POST["RefId"]; $ResCode = $_POST["ResCode"]; $SaleOrderId = $_POST["SaleOrderId"]; $SaleReferenceId = $_POST["SaleReferenceId"]; if($_POST["ResCode"]=="0") { $Qtransaction = $osC_Database->query("insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())"); $Qtransaction->bindTable(":table_orders_transactions_history", TABLE_ORDERS_TRANSACTIONS_HISTORY); $Qtransaction->bindInt(":orders_id", $SaleOrderId); $Qtransaction->bindInt(":transaction_code", 1); $Qtransaction->bindValue(":transaction_return_value", $SaleReferenceId); $Qtransaction->bindInt(":transaction_return_status", 1); $Qtransaction->execute(); $client = new nusoap_client("https://pgws.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl"); $namespace="http://interfaces.core.sw.bps.com/"; $terminalId = MODULE_PAYMENT_MELLAT_TERMINAL_ID; $userName = MODULE_PAYMENT_MELLAT_USER_NAME; $userPassword = MODULE_PAYMENT_MELLAT_USER_PASSWORD; $orderId = $SaleOrderId; $verifySaleOrderId = $SaleOrderId; $verifySaleReferenceId = $SaleReferenceId; $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "saleOrderId" => $verifySaleOrderId, "saleReferenceId" => $verifySaleReferenceId); $result = $client->call("bpVerifyRequest", $parameters, $namespace); if ($client->fault) { echo "<h2>Fault1</h2><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { $inquirySaleOrderId = $SaleOrderId; $inquirySaleReferenceId = $SaleReferenceId; $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "saleOrderId" => $inquirySaleOrderId, "saleReferenceId" => $inquirySaleReferenceId); $result = $client->call("bpInquiryRequest", $parameters, $namespace); if ($client->fault) { echo "<h2>Fault2</h2><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { $reversalSaleOrderId = $SaleOrderId; $reversalSaleReferenceId = $SaleReferenceId; $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "saleOrderId" => $reversalSaleOrderId, "saleReferenceId" => $reversalSaleReferenceId); $result = $client->call("bpReversalRequest", $parameters, $namespace); if ($client->fault) { echo "<h2>Fault3</h2><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { echo "<h2>Error</h2><pre>" . $err . "</pre>"; die(); } else { $osC_Database->simpleQuery("delete from `" . DB_TABLE_PREFIX . "online_transactions` where 1 and ( receipt_id = '$RefId' ) and ( orders_id = '$SaleOrderId' )"); osC_Order::remove($this->_order_id); $messageStack->add_session("checkout", "خطا در تاييد تراکنش ، مبلغ تراکنش با موفقيت به حساب شما برگشت داده شد.", "error"); osc_redirect(osc_href_link(FILENAME_CHECKOUT, "checkout&view=shippingMethodForm", "SSL", null, null, true)); } } echo "<h2>Error</h2><pre>" . $err . "</pre>"; die(); } else { $settleSaleOrderId = $SaleOrderId; $settleSaleReferenceId = $SaleReferenceId; $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "saleOrderId" => $settleSaleOrderId, "saleReferenceId" => $settleSaleReferenceId); $result = $client->call("bpSettleRequest", $parameters, $namespace); if ($client->fault) { echo "<h2>Fault4</h2><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { echo "<h2>Error</h2><pre>" . $err . "</pre>"; die(); } else { $osC_Database->simpleQuery("update `" . DB_TABLE_PREFIX . "online_transactions` set transaction_id = '$SaleReferenceId',transaction_date = '".date("YmdHis")."' where 1 and ( receipt_id = '$RefId' )"); $Qtransaction = $osC_Database->query("insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())"); $Qtransaction->bindTable(":table_orders_transactions_history", TABLE_ORDERS_TRANSACTIONS_HISTORY); $Qtransaction->bindInt(":orders_id", $SaleOrderId); $Qtransaction->bindInt(":transaction_code", 1); $Qtransaction->bindValue(":transaction_return_value", $SaleReferenceId); $Qtransaction->bindInt(":transaction_return_status", 1); $Qtransaction->execute(); $this->_order_id = osC_Order::insert(); $comments = $osC_Language->get("payment_mellat_method_refid")."[" . $SaleReferenceId . "]"; osC_Order::process($this->_order_id, $this->order_status, $comments); } } } } echo "<h2>Error</h2><pre>" . $err . "</pre>"; die(); } else { $settleSaleOrderId = $SaleOrderId; $settleSaleReferenceId = $SaleReferenceId; $err = $client->getError(); if ($err) { echo "<h2>Constructor error</h2><pre>" . $err . "</pre>"; die(); } $parameters = array( "terminalId" => $terminalId, "userName" => $userName, "userPassword" => $userPassword, "orderId" => $orderId, "saleOrderId" => $settleSaleOrderId, "saleReferenceId" => $settleSaleReferenceId); $result = $client->call("bpSettleRequest", $parameters, $namespace); if ($client->fault) { echo "<h2>Fault</h2><pre>"; print_r($result); echo "</pre>"; die(); } else { $resultStr = $result; $err = $client->getError(); if ($err) { echo "<h2>Error</h2><pre>" . $err . "</pre>"; die(); } else { $osC_Database->simpleQuery("update `" . DB_TABLE_PREFIX . "online_transactions` set transaction_id = '$SaleReferenceId',transaction_date = '".date("YmdHis")."' where 1 and ( receipt_id = '$RefId' )"); $Qtransaction = $osC_Database->query("insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())"); $Qtransaction->bindTable(":table_orders_transactions_history", TABLE_ORDERS_TRANSACTIONS_HISTORY); $Qtransaction->bindInt(":orders_id", $SaleOrderId); $Qtransaction->bindInt(":transaction_code", 1); $Qtransaction->bindValue(":transaction_return_value", $SaleReferenceId); $Qtransaction->bindInt(":transaction_return_status", 1); $Qtransaction->execute(); $this->_order_id = osC_Order::insert(); $comments = $osC_Language->get("payment_mellat_method_refid")."[" . $SaleReferenceId . "]"; osC_Order::process($this->_order_id, $this->order_status, $comments); } } } } } else { $osC_Database->simpleQuery("delete from `" . DB_TABLE_PREFIX . "online_transactions` where 1 and ( receipt_id = '$RefId' ) and ( orders_id = '$SaleOrderId' )"); osC_Order::remove($this->_order_id); $messageStack->add_session("checkout", check_mellat_state_error($ResCode), "error"); osc_redirect(osc_href_link(FILENAME_CHECKOUT, "checkout&view=shippingMethodForm", "SSL", null, null, true)); } } function callback() { global $osC_Database; } } function check_mellat_state_error($ResCode){ switch($ResCode){ case "0" : $pay_error="تراکنش با موفقيت انجام شد."; break; case "11" : $pay_error="شماره کارت نامعتبر است."; break; case "12" : $pay_error="موجودي کافي نيست."; break; case "13" : $pay_error="رمز نادرست است."; break; case "14" : $pay_error="تعداد دفعات وارد کردن رمز پيش از حد مجاز است."; break; case "15" : $pay_error="کارت نامعتبراست."; break; case "17" : $pay_error="کاربر از انجام تراکنش منصرف شده است."; break; case "18" : $pay_error="تاريخ انقضاي کارت گذشته است."; break; case "111" : $pay_error="صادرکننده کارت نامعتبر است."; break; case "112" : $pay_error="خطاي سوييچ صادرکننده کارت"; break; case "113" : $pay_error="پاسخ از صادرکننده کارت دريافت نشد."; break; case "114" : $pay_error="دارنده کارت مجاز به انجام اين تراکنش نيست."; break; case "21" : $pay_error="پذيرنده نامعتبر است"; break; case "22" : $pay_error="ترمينال مجوز ارائه سرويس درخواستي را ندارد."; break; case "23" : $pay_error="خطاي امنيتي رخ داده است."; break; case "24" : $pay_error="اطلاعات کاربري پذيرنده نامعتبر است."; break; case "25" : $pay_error="مبلغ نامعتبر است."; break; case "31" : $pay_error="پاسخ نامعتبر است."; break; case "32" : $pay_error="فرمت اطلاعات وارد شده صحيح نيست."; break; case "33" : $pay_error="حساب نامعتبر است."; break; case "34" : $pay_error="خطاي سيستمي"; break; case "35" : $pay_error="تاريخ نامعتبر است."; break; case "41" : $pay_error="شماره درخواست تکراري است."; break; case "42" : $pay_error="تراکنش sale يافت نشد."; break; case "43" : $pay_error="قبلا درخواست verify داده شده است."; break; case "44" : $pay_error="درخواست verify يافت نشد."; break; case "45" : $pay_error="تراکنش settle شده است."; break; case "46" : $pay_error="تراکنش settle نشده است."; break; case "47" : $pay_error="تراکنش settle يافت نشد."; break; case "48" : $pay_error="تراکنش reverse شده است."; break; case "49" : $pay_error="تراکنش refund يافت نشد."; break; case "412" : $pay_error="شناسه قبض نادرست است."; break; case "413" : $pay_error="شناسه پرداخت نادرست است."; break; case "414" : $pay_error="سازمان صادرکننده قبض نامعتبر است."; break; case "415" : $pay_error="زمان جلسه کاري به پايان رسيده است."; break; case "416" : $pay_error="خطا در ثبت اطلاعات"; break; case "417" : $pay_error="شناسه پرداخت کننده نامعتبراست."; break; case "418" : $pay_error="اشکال در تعريف اطلاعات مشتري"; break; case "419" : $pay_error="تعداد دفعات ورود اطلاعات از حد مجاز گذشته است."; break; case "421" : $pay_error="IP نامعتبر است"; break; case "51" : $pay_error="تراکنش تکراري است."; break; case "52" : $pay_error="سرويس درخواستي موجود نمي باشد."; break; case "54" : $pay_error="تراکنش مرجع موجود نيست."; break; case "55" : $pay_error="تراکنش نامعتبر است."; break; case "61" : $pay_error="خطا در واريز"; break; DEFAULT : $pay_error= "خطاي نامشخص [خطاي شماره : $ResCode]"; } return "خطا " . $ResCode ." : ". $pay_error; } }
?> |
|
|
|
|
|
|
|
|
|
Posted: Sat Jun 01, 2013 2:16 am |
|
|
myg3nx |
Advanced user |
|
|
Joined: Jun 01, 2013 |
Posts: 72 |
Location: indonesia |
|
|
|
|
|
|
|
|
|
|
www.waraxe.us Forum Index -> Php
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|