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;
     }
 }
Example #3
0
 function notify($request, $class_act)
 {
     $yeepay_log = array();
     $yeepay_log['code'] = 'notify';
     $yeepay_log['create_date'] = to_date(TIME_UTC, 'Y-m-d H:i:s');
     $yeepay_log['strxml'] = $_POST["notify"];
     $yeepay_log['html'] = $_POST["sign"];
     $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_log", $yeepay_log);
     $resp = $_POST["resp"];
     $sign = $_POST["sign"];
     $localSign = $sign;
     //正式版本,需要加上验证;
     if ($localSign == $sign) {
         //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/yeepay/CreateNewAcct.php';
             CreateNewAcctCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
         } else {
             if ($class_act == 'DoDpTrade') {
                 require_once APP_ROOT_PATH . 'system/collocation/yeepay/DoDpTrade.php';
                 DoDpTradeCallBack($str3Req);
             } else {
                 if ($class_act == 'BindBankCard') {
                     require_once APP_ROOT_PATH . 'system/collocation/yeepay/BindBankCard.php';
                     BindBankCardCallBack($str3Req);
                 } else {
                     if ($class_act == 'DoDwTrade') {
                         require_once APP_ROOT_PATH . 'system/collocation/yeepay/DoDwTrade.php';
                         DoDwTradeCallBack($str3Req);
                     } else {
                         if ($class_act == 'DoBids') {
                             //
                             require_once APP_ROOT_PATH . 'system/collocation/yeepay/DoBids.php';
                             DoBidsCallBack($str3Req);
                         } else {
                             if ($class_act == 'RegisterSubject') {
                                 require_once APP_ROOT_PATH . 'system/collocation/yeepay/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/yeepay/RegisterCreditor.php';
                                     RegisterCreditorCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                                     //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                                 } else {
                                     if ($class_act == 'DoLoans') {
                                         require_once APP_ROOT_PATH . 'system/collocation/yeepay/DoLoans.php';
                                         $ipsdata = RepaymentNewTradeCallBack($str3Req);
                                     } else {
                                         if ($class_act == 'RegisterCretansfer') {
                                             require_once APP_ROOT_PATH . 'system/collocation/yeepay/RegisterCretansfer.php';
                                             RegisterCretansferCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                                             //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                                         } else {
                                             if ($class_act == 'RepaymentNewTrade') {
                                                 require_once APP_ROOT_PATH . 'system/collocation/yeepay/RepaymentNewTrade.php';
                                                 RepaymentNewTradeCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req);
                                                 //showSuccess($pErrMsg,0,SITE_DOMAIN.APP_ROOT);
                                             } else {
                                                 if ($class_act == 'RepaymentRepayCallBack') {
                                                     require_once APP_ROOT_PATH . 'system/collocation/yeepay/RepaymentNewTrade.php';
                                                     $ipsdata = RepaymentRepayCallBack($str3Req);
                                                 } else {
                                                     if ($class_act == 'RegisterCretansferBack') {
                                                         require_once APP_ROOT_PATH . 'system/collocation/yeepay/RegisterCretansfer.php';
                                                         RegisterCretansferBack($str3Req);
                                                     } else {
                                                         if ($class_act == 'Transfer') {
                                                             require_once APP_ROOT_PATH . 'system/collocation/yeepay/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;
     }
 }