Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; require_once CLASS_..

Decoded Output download

<?php 
 require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; require_once CLASS_EX_REALDIR . 'page_extends/shopping/LC_Page_Shopping_Payment_Ex.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/plg_AmazonPaymentsV2_SC_AmazonPayments.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/helper/plg_AmazonPaymentsV2_SC_Helper_AmazonPayments.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/helper/plg_AmazonPaymentsV2_SC_Helper_ProductOptions.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/util/plg_AmazonPaymentsV2_SC_Utils.php'; class plg_AmazonPaymentsV2_LC_Page_Shopping_AmazonConfirm extends LC_Page_Ex { function init() { parent::init(); $this->tpl_title = ''; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->httpCacheControl('nocache'); } function process() { parent::process(); $this->action(); $this->sendResponse(); } function action() { $objCartSess = new SC_CartSession_Ex(); $objSiteSess = new SC_SiteSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objAmznPay = new plg_AmazonPaymentsV2_SC_AmazonPayments(); $objHelperProductOptions = new plg_AmazonPaymentsV2_SC_Helper_ProductOptions(); if (!$objSiteSess->isPrePage()) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR: regist_flag error."); SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess); } $uniqid = $objSiteSess->getUniqId(); plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm start. uniqid=".$uniqid); $objPurchase->verifyChangeCart($uniqid, $objCartSess); $cartKey = $objCartSess->getKey(); $tpl_message = $objCartSess->checkProducts($cartKey); if (!SC_Utils_Ex::isBlank($tpl_message)) { plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm disp skip."); SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } $this->is_download = ($cartKey == PRODUCT_TYPE_DOWNLOAD); $this->amazonCheckoutSessionId = $_REQUEST['amazonCheckoutSessionId']; $checkoutSession = $objAmznPay->getCheckoutSession($this->amazonCheckoutSessionId); if ($checkoutSession && $checkoutSession->statusDetails->state !== 'Open') { plg_AmazonPaymentsV2_SC_Utils::PrintLog("ERROR: CheckoutSession is not Open. CheckoutSession=" . $this->amazonCheckoutSessionId . " state=" . $checkoutSession->statusDetails->state); SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND, '', true); SC_Response_Ex::actionExit(); } $this->payment_descriptor = $checkoutSession->paymentPreferences[0]->paymentDescriptor; $objQuery =& SC_Query_Ex::getSingletonInstance(); $periodicPurchase_useFlg = plg_AmazonPaymentsV2_SC_Utils::existsPeriodicPurchase(); if ($periodicPurchase_useFlg !== false) { if ($cartKey == PLG_IPLPERIODICPURCHAS_PRODUCT_TYPE_PERIODIC) { $this->is_periodic_purchase = true; require_once PLUGIN_UPLOAD_REALDIR . 'IplPeriodicPurchase/class/helper/plg_IplPeriodicPurchase_SC_Helper_PeriodicPurchase.php'; $objHelperPeriodicPurchase = new plg_IplPeriodicPurchase_SC_Helper_PeriodicPurchase(); $this->arrPeriodicPurchaseCycle = $objHelperPeriodicPurchase->getPeriodicPurchaseCycle(); $this->is_periodic_purchase_cycle_single = $objHelperPeriodicPurchase->isPeriodicPurchaseCycleSingle($this->arrPeriodicPurchaseCycle); $this->is_periodic_purchase_no_deliv = (PLG_IPLPERIODICPURCHASE_ITEM_TYPE_DELIV == PLG_IPLPERIODICPURCHASE_ITEM_TYPE_DELIVERY_NO); $this->is_first_free = PLG_IPLPERIODICPURCHASE_DISCOUNT_PERCENT_1 == 100; } else { $this->is_periodic_purchase = false; } } else { $this->is_periodic_purchase = false; } $objQuery =& SC_Query_Ex::getSingletonInstance(); $this->CouponManage_useFlg = $objQuery->exists('dtb_plugin', 'plugin_code = ? and enable = ?', array('CouponManage', 1)); $this->arrDeliv = plg_AmazonPaymentsV2_SC_Utils::getAmazonDelivList($cartKey); $this->is_single_deliv = $this->isSingleDeliv($this->arrDeliv); $this->arrShipping = $objPurchase->getShippingTemp(); $arrCartItems = $objCartSess->getCartList($cartKey); if (substr(ECCUBE_VERSION, 0, 4) === "2.12") { foreach ($arrCartItems as $key => $item) { $arrCartItems[$key]['price_inctax'] = SC_Helper_DB_Ex::sfCalcIncTax($item['price']); } } $this->arrCartItems = $arrCartItems; $arrOrderTemp = $objPurchase->getOrderTemp($uniqid); $arrCalcResults = $objCartSess->calculate($cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref(false), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']); $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); $this->arrForm['customer_regist'] = $arrOrderTemp[PLG_AMAZONPAYMENTSV2_CUSTOMER_REGIST]; $this->arrForm['mail_magazine'] = $arrOrderTemp[PLG_AMAZONPAYMENTSV2_MAIL_MAGAZINE]; if ($this->is_periodic_purchase) { $arrKey = array( 'plg_ipl_periodic_purchase_cycle_specified', 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_TERM, 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_DAY, 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_DAYOFWEEK, 'plg_ipl_periodic_purchase_cycle_week', 'plg_ipl_periodic_purchase_cycle_day', ); foreach ($arrKey as $key) { if (!SC_Utils_Ex::isBlank($_SESSION['shipping'][0][$key])) { $this->arrForm[$key] = $_SESSION['shipping'][0][$key]; } } } if ((SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_name01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_name02'])) || (SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel02']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel03'])) || (SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_pref']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_zip01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_zip02']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_addr01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_addr02'])) ) { plg_AmazonPaymentsV2_SC_Utils::printLog("*** Shipping info is missing. START ***"); plg_AmazonPaymentsV2_SC_Utils::printLog("shipping info => ".var_export($this->arrShipping, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("order info => ".var_export($this->arrForm, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("session info => ".var_export($_SESSION, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("referer => ".$_SERVER['HTTP_REFERER']); plg_AmazonPaymentsV2_SC_Utils::printLog("user_agent => ".$_SERVER['HTTP_USER_AGENT']); plg_AmazonPaymentsV2_SC_Utils::printLog("*** Shipping info is missing. END ***"); $objAmznPay = new plg_AmazonPaymentsV2_SC_AmazonPayments(); $objHelperAmzn = new plg_AmazonPaymentsV2_SC_Helper_AmazonPayments(); $arrAddr = $objHelperAmzn->convertAddress($checkoutSession->shippingAddress); if (plg_AmazonPaymentsV2_ORDER_REVISE == 0) { $arrKana = $objHelperAmzn->reviseKana($arrAddr['shipping_name01'], $arrAddr['shipping_name02'], $arrOrderTemp['order_email']); if (!empty($arrKana)) { $arrAddr['shipping_kana01'] = $arrKana['kana01']; $arrAddr['shipping_kana02'] = $arrKana['kana02']; } } $objPurchase->saveShippingTemp($arrAddr); $objPurchase->setShipmentItemTempForSole($objCartSess, 0); } $this->arrShipping = $objPurchase->getShippingTemp(); $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $cartKey); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $arrOrderTemp['deliv_id']); $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '1'; $this->tpl_user_point = $objCustomer->getValue('point'); $this->name01 = $objCustomer->getValue('name01'); $this->name02 = $objCustomer->getValue('name02'); } switch ($this->getMode()) { case 'return': plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm return. uniqid=".$uniqid); $objSiteSess->setRegistFlag(); $parameters = array('amazonCheckoutSessionId' => $this->amazonCheckoutSessionId); SC_Response_Ex::sendRedirect(HTTPS_URL."shopping/plg_AmazonPaymentsV2_payment.php", $parameters); SC_Response_Ex::actionExit(); break; case 'confirm': plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm confirm. uniqid=".$uniqid); if (SC_Utils_Ex::isBlank($_SESSION['shipping'][0]['shipping_pref'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR: cannot get shippingaddress. check the shippingaddress."); $err_msg = ''; SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } $objQuery =& SC_Query_Ex::getSingletonInstance(); $this->arrForm[PLG_AMAZONPAYMENTSV2_AMAZON_REFERENCE_ID] = $this->amazonCheckoutSessionId; $this->arrForm['order_id'] = $objQuery->nextval('dtb_order_order_id'); $this->createPendingOrder($objPurchase, $objCustomer, $objSiteSess, $uniqid, $cartKey); $arrOrder = $objPurchase->getOrder($this->arrForm['order_id']); $checkoutSession = $objAmznPay->updateCheckoutSession($arrOrder, $this->amazonCheckoutSessionId); $this->amazon_checkout_redirect_url = $checkoutSession->webCheckoutDetails->amazonPayRedirectUrl; header("Location: {$this->amazon_checkout_redirect_url}"); SC_Response_Ex::actionExit(); break; default: break; } $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $this->welcome_point = $CONF['welcome_point']; if ($objHelperProductOptions->isEnabled()) { $objHelperProductOptions->adjustFromParam($this); } } function createPendingOrder($objPurchase, $objCustomer, $objSiteSess, $uniqid, $cartKey) { $objCartSess = new SC_CartSession_Ex(); $objHelperAmzn = new plg_AmazonPaymentsV2_SC_Helper_AmazonPayments(); if (!$this->isCorrectEmail($this->arrForm['order_email'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR:AmazonConfirm RFC violation email address."); $err_msg = 'Amazon Pay'; SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } if (empty($this->arrForm['order_id'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("order_id empty."); SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); SC_Response_Ex::actionExit(); } if ($this->tpl_login != 1) { $arrOrderer = array(); if (PLG_AMAZONPAYMENTSV2_ORDER_REVISE == 0) { $arrSex = $objHelperAmzn->reviseSex($this->arrForm['order_name01'], $this->arrForm['order_name02'], $this->arrForm['order_email']); if (!SC_Utils_Ex::isBlank($arrSex)){ $arrOrderer['order_sex'] = $arrSex['sex']; } } $this->arrForm = array_merge($this->arrForm, $arrOrderer); } $objPurchase->saveOrderTemp($uniqid, $this->arrForm, $objCustomer); $err_msg = $objCartSess->checkProducts($cartKey); if (!SC_Utils_Ex::isBlank($err_msg)) { plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirmno stock."); SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } $objSiteSess->setRegistFlag(); if ($this->is_download) { $objPurchase->unsetAllShippingTemp(true); } $objPurchase->completeOrder(ORDER_PENDING); $_SESSION['order_id'] = $this->arrForm['order_id']; } function isSingleDeliv($arrDeliv) { $objShopPay = new LC_Page_Shopping_Payment_Ex(); $result = $objShopPay->isSingleDeliv($arrDeliv); return $result; } function getSelectedDeliv($objPurchase, $objCartSess, $deliv_id) { $objShopPay = new LC_Page_Shopping_Payment_Ex(); if (substr(ECCUBE_VERSION, 0, 4) === "2.12") { $arrResult = $objShopPay->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); } elseif ((substr(ECCUBE_VERSION, 0, 4) === "2.13") || (substr(ECCUBE_VERSION, 0, 4) === "2.17")) { $arrResult = $objShopPay->getSelectedDeliv($objCartSess, $deliv_id); } return $arrResult; } function isCorrectEmail($email) { if(filter_var($email, FILTER_VALIDATE_EMAIL)) { return true; } $pattern = '/^([a-zA-Z])+([a-zA-Z0-9\._-])*@/'; if(preg_match($pattern, $email, $matches) === 1) { return false; } return false; } }  ?>

Did this file decode correctly?

Original Code

<?php
 require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; require_once CLASS_EX_REALDIR . 'page_extends/shopping/LC_Page_Shopping_Payment_Ex.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/plg_AmazonPaymentsV2_SC_AmazonPayments.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/helper/plg_AmazonPaymentsV2_SC_Helper_AmazonPayments.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/helper/plg_AmazonPaymentsV2_SC_Helper_ProductOptions.php'; require_once PLUGIN_UPLOAD_REALDIR . 'AmazonPaymentsV2/class/util/plg_AmazonPaymentsV2_SC_Utils.php'; class plg_AmazonPaymentsV2_LC_Page_Shopping_AmazonConfirm extends LC_Page_Ex { function init() { parent::init(); $this->tpl_title = ''; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->httpCacheControl('nocache'); } function process() { parent::process(); $this->action(); $this->sendResponse(); } function action() { $objCartSess = new SC_CartSession_Ex(); $objSiteSess = new SC_SiteSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objAmznPay = new plg_AmazonPaymentsV2_SC_AmazonPayments(); $objHelperProductOptions = new plg_AmazonPaymentsV2_SC_Helper_ProductOptions(); if (!$objSiteSess->isPrePage()) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR: regist_flag error."); SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess); } $uniqid = $objSiteSess->getUniqId(); plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm start. uniqid=".$uniqid); $objPurchase->verifyChangeCart($uniqid, $objCartSess); $cartKey = $objCartSess->getKey(); $tpl_message = $objCartSess->checkProducts($cartKey); if (!SC_Utils_Ex::isBlank($tpl_message)) { plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm disp skip."); SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } $this->is_download = ($cartKey == PRODUCT_TYPE_DOWNLOAD); $this->amazonCheckoutSessionId = $_REQUEST['amazonCheckoutSessionId']; $checkoutSession = $objAmznPay->getCheckoutSession($this->amazonCheckoutSessionId); if ($checkoutSession && $checkoutSession->statusDetails->state !== 'Open') { plg_AmazonPaymentsV2_SC_Utils::PrintLog("ERROR: CheckoutSession is not Open. CheckoutSession=" . $this->amazonCheckoutSessionId . " state=" . $checkoutSession->statusDetails->state); SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND, '', true); SC_Response_Ex::actionExit(); } $this->payment_descriptor = $checkoutSession->paymentPreferences[0]->paymentDescriptor; $objQuery =& SC_Query_Ex::getSingletonInstance(); $periodicPurchase_useFlg = plg_AmazonPaymentsV2_SC_Utils::existsPeriodicPurchase(); if ($periodicPurchase_useFlg !== false) { if ($cartKey == PLG_IPLPERIODICPURCHAS_PRODUCT_TYPE_PERIODIC) { $this->is_periodic_purchase = true; require_once PLUGIN_UPLOAD_REALDIR . 'IplPeriodicPurchase/class/helper/plg_IplPeriodicPurchase_SC_Helper_PeriodicPurchase.php'; $objHelperPeriodicPurchase = new plg_IplPeriodicPurchase_SC_Helper_PeriodicPurchase(); $this->arrPeriodicPurchaseCycle = $objHelperPeriodicPurchase->getPeriodicPurchaseCycle(); $this->is_periodic_purchase_cycle_single = $objHelperPeriodicPurchase->isPeriodicPurchaseCycleSingle($this->arrPeriodicPurchaseCycle); $this->is_periodic_purchase_no_deliv = (PLG_IPLPERIODICPURCHASE_ITEM_TYPE_DELIV == PLG_IPLPERIODICPURCHASE_ITEM_TYPE_DELIVERY_NO); $this->is_first_free = PLG_IPLPERIODICPURCHASE_DISCOUNT_PERCENT_1 == 100; } else { $this->is_periodic_purchase = false; } } else { $this->is_periodic_purchase = false; } $objQuery =& SC_Query_Ex::getSingletonInstance(); $this->CouponManage_useFlg = $objQuery->exists('dtb_plugin', 'plugin_code = ? and enable = ?', array('CouponManage', 1)); $this->arrDeliv = plg_AmazonPaymentsV2_SC_Utils::getAmazonDelivList($cartKey); $this->is_single_deliv = $this->isSingleDeliv($this->arrDeliv); $this->arrShipping = $objPurchase->getShippingTemp(); $arrCartItems = $objCartSess->getCartList($cartKey); if (substr(ECCUBE_VERSION, 0, 4) === "2.12") { foreach ($arrCartItems as $key => $item) { $arrCartItems[$key]['price_inctax'] = SC_Helper_DB_Ex::sfCalcIncTax($item['price']); } } $this->arrCartItems = $arrCartItems; $arrOrderTemp = $objPurchase->getOrderTemp($uniqid); $arrCalcResults = $objCartSess->calculate($cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref(false), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']); $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); $this->arrForm['customer_regist'] = $arrOrderTemp[PLG_AMAZONPAYMENTSV2_CUSTOMER_REGIST]; $this->arrForm['mail_magazine'] = $arrOrderTemp[PLG_AMAZONPAYMENTSV2_MAIL_MAGAZINE]; if ($this->is_periodic_purchase) { $arrKey = array( 'plg_ipl_periodic_purchase_cycle_specified', 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_TERM, 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_DAY, 'plg_ipl_periodic_purchase_cycle_id_'.PLG_IPLPERIODICPURCHASE_CYCLE_SPECIFIED_DAYOFWEEK, 'plg_ipl_periodic_purchase_cycle_week', 'plg_ipl_periodic_purchase_cycle_day', ); foreach ($arrKey as $key) { if (!SC_Utils_Ex::isBlank($_SESSION['shipping'][0][$key])) { $this->arrForm[$key] = $_SESSION['shipping'][0][$key]; } } } if ((SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_name01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_name02'])) || (SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel02']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_tel03'])) || (SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_pref']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_zip01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_zip02']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_addr01']) && SC_Utils_Ex::isBlank($this->arrShipping[0]['shipping_addr02'])) ) { plg_AmazonPaymentsV2_SC_Utils::printLog("*** Shipping info is missing. START ***"); plg_AmazonPaymentsV2_SC_Utils::printLog("shipping info => ".var_export($this->arrShipping, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("order info => ".var_export($this->arrForm, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("session info => ".var_export($_SESSION, true)); plg_AmazonPaymentsV2_SC_Utils::printLog("referer => ".$_SERVER['HTTP_REFERER']); plg_AmazonPaymentsV2_SC_Utils::printLog("user_agent => ".$_SERVER['HTTP_USER_AGENT']); plg_AmazonPaymentsV2_SC_Utils::printLog("*** Shipping info is missing. END ***"); $objAmznPay = new plg_AmazonPaymentsV2_SC_AmazonPayments(); $objHelperAmzn = new plg_AmazonPaymentsV2_SC_Helper_AmazonPayments(); $arrAddr = $objHelperAmzn->convertAddress($checkoutSession->shippingAddress); if (plg_AmazonPaymentsV2_ORDER_REVISE == 0) { $arrKana = $objHelperAmzn->reviseKana($arrAddr['shipping_name01'], $arrAddr['shipping_name02'], $arrOrderTemp['order_email']); if (!empty($arrKana)) { $arrAddr['shipping_kana01'] = $arrKana['kana01']; $arrAddr['shipping_kana02'] = $arrKana['kana02']; } } $objPurchase->saveShippingTemp($arrAddr); $objPurchase->setShipmentItemTempForSole($objCartSess, 0); } $this->arrShipping = $objPurchase->getShippingTemp(); $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $cartKey); $arrSelectedDeliv = $this->getSelectedDeliv($objPurchase, $objCartSess, $arrOrderTemp['deliv_id']); $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '1'; $this->tpl_user_point = $objCustomer->getValue('point'); $this->name01 = $objCustomer->getValue('name01'); $this->name02 = $objCustomer->getValue('name02'); } switch ($this->getMode()) { case 'return': plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm return. uniqid=".$uniqid); $objSiteSess->setRegistFlag(); $parameters = array('amazonCheckoutSessionId' => $this->amazonCheckoutSessionId); SC_Response_Ex::sendRedirect(HTTPS_URL."shopping/plg_AmazonPaymentsV2_payment.php", $parameters); SC_Response_Ex::actionExit(); break; case 'confirm': plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirm confirm. uniqid=".$uniqid); if (SC_Utils_Ex::isBlank($_SESSION['shipping'][0]['shipping_pref'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR: cannot get shippingaddress. check the shippingaddress."); $err_msg = ''; SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } $objQuery =& SC_Query_Ex::getSingletonInstance(); $this->arrForm[PLG_AMAZONPAYMENTSV2_AMAZON_REFERENCE_ID] = $this->amazonCheckoutSessionId; $this->arrForm['order_id'] = $objQuery->nextval('dtb_order_order_id'); $this->createPendingOrder($objPurchase, $objCustomer, $objSiteSess, $uniqid, $cartKey); $arrOrder = $objPurchase->getOrder($this->arrForm['order_id']); $checkoutSession = $objAmznPay->updateCheckoutSession($arrOrder, $this->amazonCheckoutSessionId); $this->amazon_checkout_redirect_url = $checkoutSession->webCheckoutDetails->amazonPayRedirectUrl; header("Location: {$this->amazon_checkout_redirect_url}"); SC_Response_Ex::actionExit(); break; default: break; } $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $this->welcome_point = $CONF['welcome_point']; if ($objHelperProductOptions->isEnabled()) { $objHelperProductOptions->adjustFromParam($this); } } function createPendingOrder($objPurchase, $objCustomer, $objSiteSess, $uniqid, $cartKey) { $objCartSess = new SC_CartSession_Ex(); $objHelperAmzn = new plg_AmazonPaymentsV2_SC_Helper_AmazonPayments(); if (!$this->isCorrectEmail($this->arrForm['order_email'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("ERROR:AmazonConfirm RFC violation email address."); $err_msg = 'Amazon Pay'; SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } if (empty($this->arrForm['order_id'])) { plg_AmazonPaymentsV2_SC_Utils::printLog("order_id empty."); SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); SC_Response_Ex::actionExit(); } if ($this->tpl_login != 1) { $arrOrderer = array(); if (PLG_AMAZONPAYMENTSV2_ORDER_REVISE == 0) { $arrSex = $objHelperAmzn->reviseSex($this->arrForm['order_name01'], $this->arrForm['order_name02'], $this->arrForm['order_email']); if (!SC_Utils_Ex::isBlank($arrSex)){ $arrOrderer['order_sex'] = $arrSex['sex']; } } $this->arrForm = array_merge($this->arrForm, $arrOrderer); } $objPurchase->saveOrderTemp($uniqid, $this->arrForm, $objCustomer); $err_msg = $objCartSess->checkProducts($cartKey); if (!SC_Utils_Ex::isBlank($err_msg)) { plg_AmazonPaymentsV2_SC_Utils::printLog("AmazonConfirmno stock."); SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $err_msg); SC_Response_Ex::actionExit(); } $objSiteSess->setRegistFlag(); if ($this->is_download) { $objPurchase->unsetAllShippingTemp(true); } $objPurchase->completeOrder(ORDER_PENDING); $_SESSION['order_id'] = $this->arrForm['order_id']; } function isSingleDeliv($arrDeliv) { $objShopPay = new LC_Page_Shopping_Payment_Ex(); $result = $objShopPay->isSingleDeliv($arrDeliv); return $result; } function getSelectedDeliv($objPurchase, $objCartSess, $deliv_id) { $objShopPay = new LC_Page_Shopping_Payment_Ex(); if (substr(ECCUBE_VERSION, 0, 4) === "2.12") { $arrResult = $objShopPay->getSelectedDeliv($objPurchase, $objCartSess, $deliv_id); } elseif ((substr(ECCUBE_VERSION, 0, 4) === "2.13") || (substr(ECCUBE_VERSION, 0, 4) === "2.17")) { $arrResult = $objShopPay->getSelectedDeliv($objCartSess, $deliv_id); } return $arrResult; } function isCorrectEmail($email) { if(filter_var($email, FILTER_VALIDATE_EMAIL)) { return true; } $pattern = '/^([a-zA-Z])+([a-zA-Z0-9\._-])*@/'; if(preg_match($pattern, $email, $matches) === 1) { return false; } return false; } } 

Function Calls

None

Variables

None

Stats

MD5 a4ae48657404d57e70a77c37a0ffe39b
Eval Count 0
Decode Time 93 ms