<?php
//作者主页 https://www.woailunwen.com
$pay_memberid = '商户号';
$pay_orderid = '订单号';
$pay_amount = '支付金额';
$pay_applydate = date("Y-m-d H:i:s"); //订单时间
$pay_bankcode = '通道编码';
$pay_notifyurl = '异步地址';
$pay_callbackurl = '同步地址';
$Md5key = '你的密钥';
$native = array(
"pay_memberid" => $pay_memberid,
"pay_orderid" => $pay_orderid,
"pay_amount" => $pay_amount,
"pay_applydate" => $pay_applydate,
"pay_bankcode" => $pay_bankcode,
"pay_notifyurl" => $pay_notifyurl,
"pay_callbackurl" => $pay_callbackurl,
);
ksort($native);
$md5str = "";
foreach ($native as $key => $val) {
$md5str = $md5str . $key . "=" . $val . "&";
}
//作者主页 https://www.bz80.com
echo '签名串:';echo($md5str . "key=" . $Md5key);
$sign = strtoupper(md5($md5str . "key=" . $Md5key));
$native["pay_md5sign"] = $sign;
echo '<br>得到签名后,转换为大写字母。<br>';
echo $sign;
?>