function getCallbackHmacString($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType) { include 'merchantProperties.php'; #取得加密前的字符串 $sbOld = ""; #加入商家ID $sbOld = $sbOld . $p1_MerId; #加入消息类型 $sbOld = $sbOld . $r0_Cmd; #加入业务返回码 $sbOld = $sbOld . $r1_Code; #加入交易ID $sbOld = $sbOld . $r2_TrxId; #加入交易金额 $sbOld = $sbOld . $r3_Amt; #加入货币单位 $sbOld = $sbOld . $r4_Cur; #加入产品Id $sbOld = $sbOld . $r5_Pid; #加入订单ID $sbOld = $sbOld . $r6_Order; #加入用户ID $sbOld = $sbOld . $r7_Uid; #加入商家扩展信息 $sbOld = $sbOld . $r8_MP; #加入交易结果返回类型 $sbOld = $sbOld . $r9_BType; logstr($r6_Order, $sbOld, HmacMd5($sbOld, $merchantKey)); return HmacMd5($sbOld, $merchantKey); }
function getCallbackHmacString($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType) { global $p1_MerId; global $merchantKey; $sbOld = ""; $sbOld = $sbOld . $p1_MerId; $sbOld = $sbOld . $r0_Cmd; $sbOld = $sbOld . $r1_Code; $sbOld = $sbOld . $r2_TrxId; $sbOld = $sbOld . $r3_Amt; $sbOld = $sbOld . $r4_Cur; $sbOld = $sbOld . $r5_Pid; $sbOld = $sbOld . $r6_Order; $sbOld = $sbOld . $r7_Uid; $sbOld = $sbOld . $r8_MP; $sbOld = $sbOld . $r9_BType; logstr($r6_Order, $sbOld, HmacMd5($sbOld, $merchantKey)); return HmacMd5($sbOld, $merchantKey); }
/** @api */ function addCol($table, $col) { $found = false; foreach ($this->tableMeta as $e) { if (strcasecmp($e["name"], $table) != 0) { continue; } $n = strlen($col); foreach ($e["fields"] as $f) { if (strncasecmp($f, $col, $n) != 0) { continue; } if (strlen($f) > $n) { if (!preg_match('/^\\W$/', $f[$n])) { continue; } } $this->_addColByMeta($e["name"], $f); $found = true; break; } } if (!$found) { logstr("!!! cannot find table and col: `{$table}.{$col}`\n"); } else { logstr("=== done\n"); } }
function generateBlackholeFile() { global $blackholes, $config; $string2write = ""; foreach ($blackholes as $bhEntry) { $string2write .= $bhEntry->toBlackholeFileString(); } file_put_contents($config['blackholeipfile'], $string2write); logstr("blackholes written to new file"); }
$sbOld = $sbOld . $r5_Pid; #加入商户订单号 $sbOld = $sbOld . $r6_Order; #加入商户扩展信息 $sbOld = $sbOld . $r8_MP; #加入支付状态 $sbOld = $sbOld . $rb_PayStatus; #加入已退款次数 $sbOld = $sbOld . $rc_RefundCount; #加入已退款金额 $sbOld = $sbOld . $rd_RefundAmt; echo "[" . $sbOld . "]"; //echo $sNewString; //echo $sNewString; $sNewString = HmacMd5($sbOld, $merchantKey); logstr($r6_Order, $sbOld, HmacMd5($sbOld, $merchantKey)); //校验码正确 if ($sNewString == $hmac) { if ($r1_Code == "1") { echo "<br>查询成功!"; echo "<br>订单号:" . $r6_Order; echo "<br>易宝支付交易流水号:" . $r2_TrxId; echo "<br>商品名称:" . $r5_Pid; echo "<br>支付金额:" . $r3_Amt; echo "<br>商户扩展信息:" . $r8_MP; echo "<br>订单状态:" . $rb_PayStatus; echo "<br>已退款次数:" . $rc_RefundCount; echo "<br>已退款金额:" . $rd_RefundAmt; } else { if ($r1_Code == "50") { echo "<br>该订单不存在";
} } #进行校验码检查 取得加密前的字符串 $sbOld = ""; #加入业务类型 $sbOld = $sbOld . $r0_Cmd; #加入退款申请是否成功 $sbOld = $sbOld . $r1_Code; #加入易宝支付交易流水号 $sbOld = $sbOld . $r2_TrxId; #加入退款金额 $sbOld = $sbOld . $r3_Amt; #加入交易币种 $sbOld = $sbOld . $r4_Cur; $sNewString = HmacMd5($sbOld, $merchantKey); logstr($r2_TrxId, $sbOld, HmacMd5($sbOld, $merchantKey)); //校验码正确 if ($sNewString == $hmac) { if ($r1_Code == "1") { echo "<br>订单退款请求成功!"; echo "<br>易宝支付交易流水号:" . $r2_TrxId; echo "<br>退款金额:" . $r3_Amt; } else { echo "<br>订单退款请求失败"; exit; } } else { echo "<br>localhost::" . $sNewString; echo "<br>YeePay:" . $hmac; echo "<br>交易签名无效."; exit;