Example #1
0
function wsnotify($resultStr, $class_act, $cert_md5)
{
    $pMerCode = $resultStr["pMerCode"];
    $pErrCode = $resultStr["pErrCode"];
    $pErrMsg = $resultStr["pErrMsg"];
    $p3DesXmlPara = $resultStr["p3DesXmlPara"];
    $pSign = $resultStr["pSign"];
    $signPlainText = $pMerCode . $pErrCode . $pErrMsg . $p3DesXmlPara . $cert_md5;
    $localSign = md5($signPlainText);
    if ($localSign == $pSign) {
        //file_put_contents(PATH_LOG_FILE,PATH."--".date('YmdHis')."	验签通过"."\r\n",FILE_APPEND);
        $Crypt3Des = new Crypt3Des();
        //new 3des class
        $str3XmlParaInfo = $Crypt3Des->DESDecrypt($p3DesXmlPara);
        //3des解密
        if (empty($str3XmlParaInfo)) {
            //file_put_contents(PATH_LOG_FILE,PATH."--".date('YmdHis')."	3DES解密失败"."\r\n",FILE_APPEND);
            return;
        } else {
            require_once APP_ROOT_PATH . 'system/collocation/ips/xml.php';
            $str3ParaInfo = @XML_unserialize($str3XmlParaInfo);
            $str3Req = $str3ParaInfo['pReq'];
            if ($class_act == 'GuaranteeUnfreeze') {
                require_once APP_ROOT_PATH . 'system/collocation/ips/GuaranteeUnfreeze.php';
                GuaranteeUnfreezeCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                showSuccess($pErrMsg, 0, SITE_DOMAIN . APP_ROOT);
            }
            if ($class_act == 'Transfer') {
                require_once APP_ROOT_PATH . 'system/collocation/ips/Transfer.php';
                TransferCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                showSuccess($pErrMsg, 0, SITE_DOMAIN . APP_ROOT);
            }
        }
    }
}
Example #2
0
 function notify($request, $class_act)
 {
     $pMerCode = $request["pMerCode"];
     $pErrCode = $request["pErrCode"];
     $pErrMsg = $request["pErrMsg"];
     $p3DesXmlPara = $request["p3DesXmlPara"];
     $pSign = $request["pSign"];
     $signPlainText = $pMerCode . $pErrCode . $pErrMsg . $p3DesXmlPara . $this->cert_md5;
     $localSign = md5($signPlainText);
     if ($localSign == $pSign) {
         //echo "<br/>验签通过";
         $Crypt3Des = new Crypt3Des();
         //new 3des class
         $str3XmlParaInfo = $Crypt3Des->DESDecrypt($p3DesXmlPara);
         //3des解密
         require_once APP_ROOT_PATH . 'system/collocation/ips/xml.php';
         $str3ParaInfo = @XML_unserialize($str3XmlParaInfo);
         $str3Req = $str3ParaInfo['pReq'];
         //
         if ($class_act == 'CreateNewAcct') {
             require_once APP_ROOT_PATH . 'system/collocation/ips/CreateNewAcct.php';
             CreateNewAcctCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
         } else {
             if ($class_act == 'RegisterSubject') {
                 require_once APP_ROOT_PATH . 'system/collocation/ips/RegisterSubject.php';
                 RegisterSubjectCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                 //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
             } else {
                 if ($class_act == 'RegisterCreditor') {
                     require_once APP_ROOT_PATH . 'system/collocation/ips/RegisterCreditor.php';
                     RegisterCreditorCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                     //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                 } else {
                     if ($class_act == 'RegisterCretansfer') {
                         require_once APP_ROOT_PATH . 'system/collocation/ips/RegisterCretansfer.php';
                         RegisterCretansferCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                         //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                     } else {
                         if ($class_act == 'GuaranteeUnfreeze') {
                             require_once APP_ROOT_PATH . 'system/collocation/ips/GuaranteeUnfreeze.php';
                             GuaranteeUnfreezeCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                             //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                         } else {
                             if ($class_act == 'RepaymentNewTrade') {
                                 require_once APP_ROOT_PATH . 'system/collocation/ips/RepaymentNewTrade.php';
                                 RepaymentNewTradeCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                                 //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                             } else {
                                 if ($class_act == 'Transfer') {
                                     require_once APP_ROOT_PATH . 'system/collocation/ips/Transfer.php';
                                     TransferCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                                     //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         echo "<br/>验签不通过:{$localSign}<br/>";
         $Crypt3Des = new Crypt3Des();
         //new 3des class
         $str3XmlParaInfo = $Crypt3Des->DESDecrypt($p3DesXmlPara);
         //3des解密
         print_r($str3XmlParaInfo);
         require_once APP_ROOT_PATH . 'system/collocation/ips/xml.php';
         $str3ParaInfo = @XML_unserialize($str3XmlParaInfo);
         print_r($str3ParaInfo);
         exit;
     }
 }