<?php 		  // 公共函数定义
  function StrToHex($string)
  {
     $hex="";
     for ($i=0;$i<strlen($string);$i++)
         $hex.=dechex(ord($string[$i]));
     $hex=strtoupper($hex);
     return $hex;
  }

	// 接收订单提交信息
	$m_id       = 	$this->merid;
	$m_orderid  = 	$this->orderid;
	$m_oamount  = 	$this->amount;
	$m_ocurrency= 	"001";
	$m_url      = 	$this -> url = $SiteUrl."memberfunc_payresult.php";
	$m_txcode   = 	"001";
	$m_language = 	"001";
	$s_name     = 	$this->rname;
	$s_addr     = 	$this->raddr;
	$s_postcode = 	$this->rpost;
	$s_tel      = 	$this->rtel;
	$s_eml      = 	$this->remail;
	$r_name     = 	$this->rname;
	$r_addr     = 	$this->raddr;
	$r_postcode = 	$this->rpost;
	$r_tel      = 	$this->rtel;
	$r_eml      = 	$this->remail;
	$m_ocomment = 	$this->$rnote;
	$m_status	= 	0;
	
	//组织订单信息
	$m_info = $m_id."|".$m_orderid."|".$m_oamount."|".$m_ocurrency."|".$m_url."|".$m_txcode."|".$m_language;
	$s_info = $s_name."|"."s_addr"."|"."s_postcode"."|"."s_tel"."|".$s_eml;
	$r_info = $r_name."|"."r_addr"."|"."r_postcode"."|"."r_tel"."|".$r_eml."|"."m_ocomment"."|".$m_status;
	
	$OrderInfo = $m_info."|".$s_info."|".$r_info;
	
	//订单信息先转换成HEX，然后再加密
	$key = 'nps&!@#$';
	
	$OrderInfo = StrToHex($OrderInfo);
	$digest = strtoupper(md5($OrderInfo.$key));
			  
			  //nps
		      $hiddenString = "<Input Type=hidden Name=\"OrderMessage\" id=OrderMessage value=\"".$OrderInfo."\">";
			  $hiddenString.= "<Input Type=hidden Name=\"digest\" id=digest value=\"".$digest."\">";
			  $this->action = "https://202.103.190.140:8443/nps/jsp/nps_decrypt.jsp";
			  $hiddenString = "<form Name=\"FORM\" target=_blank method=post action=".$this->action.">".$hiddenString."<input  type=submit value='立即通过".$this->pcenter."在线支付' name=submit></form>";
?>