Exemplo n.º 1
0
function CheckHmac($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac)
{
    if ($hmac == getCallbackHmacString($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType)) {
        return true;
    } else {
        return false;
    }
    //易宝签名
    function xmlSign($xml)
    {
        $ch = curl_init("http://" . $_SERVER['HTTP_HOST'] . ":8088/sign");
        curl_setopt_array($ch, array(CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_POSTFIELDS => 'req=' . rawurlencode($xml)));
        $response = curl_exec($ch);
        return $response;
    }
    //易宝服务callback 数据验证
    function callbackSign($response, $sign)
    {
        $ch = curl_init("http://" . $_SERVER['HTTP_HOST'] . ":8088/verify");
        curl_setopt_array($ch, array(CURLOPT_POST => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_POSTFIELDS => 'req=' . rawurlencode($response) . "&sign=" . rawurlencode($sign)));
        $result = curl_exec($ch);
        // print($result)
        return $result;
    }
}
Exemplo n.º 2
0
function CheckHmac($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac)
{
    if ($hmac == getCallbackHmacString($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType)) {
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 3
0
function CheckHmac($r0_Cmd,$p1_MerId,$r1_Code,$r2_TrxId,$r3_Amt,$r4_Cur,$r5_Pid,$r6_Order,$r7_Uid,$r8_MP,$r9_BType,$hmac,$merchantKey)
{
	return ($hmac==getCallbackHmacString($r0_Cmd,$p1_MerId,$r1_Code,$r2_TrxId,$r3_Amt,$r4_Cur,$r5_Pid,$r6_Order,$r7_Uid,$r8_MP,$r9_BType,$merchantKey));
}
Exemplo n.º 4
0
function CheckHmac($sCmd, $sErrorCode, $sTrxId, $orderId, $amount, $cur, $productId, $userId, $MP, $bType, $svrHmac)
{
    //    $args = func_get_args();
    //	print_r($args);
    //echo "<br>";
    //echo $svrHmac."<br>";
    //echo getCallbackHmacString($sCmd,$sErrorCode,$sTrxId,$orderId,$amount,$cur,$productId,$userId,$MP,$bType);
    if ($svrHmac == getCallbackHmacString($sCmd, $sErrorCode, $sTrxId, $orderId, $amount, $cur, $productId, $userId, $MP, $bType)) {
        return true;
    } else {
        return false;
    }
}