/** * 验证 * * @param int $length * @return string */ public function VerifyCode($name, $code) { $sessionCode = WeFlex_Session::Get($name); if ($code == $sessionCode) { return true; } else { return false; } }
public function checkPayment() { $payKey = WeFlex_Session::Get("paypal-adaptive-pay-key"); $orderId = WeFlex_Session::Get("order_id"); if (!$payKey) { throw new Exception("no pay key"); } $rtn = $this->_paypal->paymentDetail($payKey); /* Display the API response back to the browser. If the response from PayPal was a success, display the response parameters' If the response was an error, display the errors received using APIError.php. */ $ack = strtoupper($rtn["responseEnvelope.ack"]); if ($ack != "SUCCESS") { $this->_logErrorPayment($orderId, TCVM_Payment_Imple::PAYMENT_PAYPAL_ADAPTIVE, $rtn); throw new Exception("the payment has some error"); } $this->_logSuccessPayment($orderId, TCVM_Payment_Imple::PAYMENT_PAYPAL_ADAPTIVE, $payKey, $rtn); }
private function _getSession() { $userStr = WeFlex_Session::Get(self::SESSION_NAME_SPACE); if ($userStr) { $user = unserialize($userStr); return $user; } return null; }
private function _getShippingSession() { return unserialize(WeFlex_Session::Get(self::SESSION_SHIPPING)); }
protected function _getSession() { $userStr = WeFlex_Session::Get(self::SESSION_KEY); if ($userStr) { $user = unserialize($userStr); return $user; } return false; }
/** * @return Zend_Oauth_Token_Access */ protected function _getAccessToken() { if (WeFlex_Session::Get(self::SESSION_ACCESS_TOKEN) && !$this->_accessToken) { $this->_accessToken = unserialize(WeFlex_Session::Get(self::SESSION_ACCESS_TOKEN)); } return $this->_accessToken; }
private function _getSession() { $session = WeFlex_Session::Get(self::SESSION_CART); $userMod = TCVM_User_Factory::Factory(); $loginUser = $userMod->getLoginedUser(); $basic = $userMod->getUserRegistrationBasic($loginUser["id"]); //init 4 step if (!$session) { $session = array(); } if (!isset($session[self::STEP_BASIC]) && !$basic) { $session[self::STEP_BASIC] = array(); $session[self::STEP_BASIC]["veterinary_acupuncture"] = array(); $session[self::STEP_BASIC]["tcvm_clinical_approach"] = array(); $session[self::STEP_BASIC]["advanced_programs"] = array(); $session[self::STEP_BASIC]["practice"] = array(); } if (!isset($session[self::STEP_BASIC]) && $basic) { $session[self::STEP_BASIC] = $basic; } if (!isset($session[self::STEP_PAYINFO])) { $session[self::STEP_PAYINFO] = array(); } if (!isset($session[self::STEP_PRODUCT])) { $session[self::STEP_PRODUCT] = array(); $session[self::STEP_PRODUCT]["products"] = array(); $session[self::STEP_PRODUCT]["deduct"] = 0; $session[self::STEP_PRODUCT]["new"] = 0; } if (!isset($session[self::STEP_PROFILE])) { $session[self::STEP_PROFILE] = array(); } if (!isset($session["total_price"])) { $session["total_price"] = 0; } if (!isset($session["info"])) { $session["info"] = array(); } return $session; }