本文整理汇总了PHP中get_order_id_by_sn函数的典型用法代码示例。如果您正苦于以下问题:PHP get_order_id_by_sn函数的具体用法?PHP get_order_id_by_sn怎么用?PHP get_order_id_by_sn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_order_id_by_sn函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: respond
/**
* 响应操作
*/
function respond()
{
if (!empty($_POST)) {
foreach ($_POST as $key => $data) {
$_GET[$key] = $data;
}
}
$payment = get_payment("alipay");
$payment = unserialize_config($payment['pay_config']);
$alipay_config = array();
$alipay_config['partner'] = $payment['alipay_partner'];
//安全检验码,以数字和字母组成的32位字符
//如果签名方式设置为“MD5”时,请设置该参数
$alipay_config['key'] = $payment['alipay_key'];
//商户的私钥(后缀是.pen)文件相对路径
//如果签名方式设置为“0001”时,请设置该参数
$alipay_config['private_key_path'] = '';
//$alipay_config['private_key_path'] = 'key/rsa_private_key.pem';
//支付宝公钥(后缀是.pen)文件相对路径
//如果签名方式设置为“0001”时,请设置该参数
$alipay_config['ali_public_key_path'] = '';
//$alipay_config['ali_public_key_path']= 'key/alipay_public_key.pem';
//签名方式 不需修改
$alipay_config['sign_type'] = 'MD5';
//字符编码格式 目前支持 gbk 或 utf-8
$alipay_config['input_charset'] = 'utf-8';
//$alipay_config['cacert'] = ROOT_PATH .'mobile/includes/modules/cacert.pem';
$alipay_config['cacert'] = '';
//ca证书路径地址,用于curl中ssl校验
//请保证cacert.pem文件在当前文件夹目录中
//$alipay_config['cacert'] = getcwd().'\\cacert.pem';
//访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
$alipay_config['transport'] = 'http';
require_once ROOT_PATH . "includes/modules/lib/alipay_notify.class.php";
$alipayNotify = new AlipayNotify($alipay_config);
$verify_result = $alipayNotify->verifyReturn();
if ($verify_result) {
$out_trade_no = trim($_GET['out_trade_no']);
$order_sn = trim(substr($out_trade_no, 0, 13));
$log_id = get_order_id_by_sn($order_sn);
order_paid($log_id);
//$sql = "SELECT l.`log_id` FROM " . $GLOBALS['hhs']->table('order_info')." as info LEFT JOIN ". $GLOBALS['hhs']->table('pay_log') ." as l ON l.order_id=info.order_id WHERE info.order_sn = '$order_sn'";
//$order_log_id = $GLOBALS['db']->getOne($sql);
return true;
} else {
return false;
}
}
开发者ID:shiruolin,项目名称:hzzshop,代码行数:51,代码来源:alipay.php
示例2: respond
/**
* 响应操作
*/
function respond()
{
$payment = get_payment('wxpay');
/*取返回参数*/
$fields = 'bank_billno,bank_type,discount,fee_type,input_charset,notify_id,out_trade_no,partner,product_fee' . ',sign_type,time_end,total_fee,trade_mode,trade_state,transaction_id,transport_fee';
$arr = null;
foreach (explode(',', $fields) as $val) {
if (isset($_REQUEST[$val])) {
$arr[$val] = trim($_REQUEST[$val]);
}
}
$order_sn = $arr['out_trade_no'];
$log_id = get_order_id_by_sn($order_sn);
/* 如果trade_state大于0则表示支付失败 */
if ($arr['trade_state'] > 0) {
return false;
}
/* 检查支付的金额是否相符 */
if (!check_money($log_id, $arr['total_fee'] / 100)) {
return false;
}
$sign = $_REQUEST['sign'];
$sign_md5 = $this->create_sign($arr);
if ($sign_md5 != $sign) {
return false;
} else {
/* 改变订单状态 */
order_paid($log_id);
return true;
}
}
开发者ID:petroslee,项目名称:weixinpay-for-ecshop,代码行数:34,代码来源:wxpay.php
示例3: respond
/**
* 响应操作
*/
function respond()
{
/*取返回参数*/
$cmd_no = $_GET['cmdno'];
$pay_result = $_GET['pay_result'];
$pay_info = $_GET['pay_info'];
$bill_date = $_GET['date'];
$bargainor_id = $_GET['bargainor_id'];
$transaction_id = $_GET['transaction_id'];
$sp_billno = $_GET['sp_billno'];
$total_fee = $_GET['total_fee'];
$fee_type = $_GET['fee_type'];
$attach = $_GET['attach'];
$sign = $_GET['sign'];
$payment = get_payment('tenpay');
//$order_sn = $bill_date . str_pad(intval($sp_billno), 5, '0', STR_PAD_LEFT);
//$log_id = preg_replace('/0*([0-9]*)/', '\1', $sp_billno); //取得支付的log_id
if ($attach == 'voucher') {
$log_id = get_order_id_by_sn($sp_billno, "true");
} else {
$log_id = get_order_id_by_sn($sp_billno);
}
/* 如果pay_result大于0则表示支付失败 */
if ($pay_result > 0) {
return false;
}
/* 检查支付的金额是否相符 */
if (!check_money($log_id, $total_fee / 100)) {
return false;
}
/* 检查数字签名是否正确 */
$sign_text = "cmdno=" . $cmd_no . "&pay_result=" . $pay_result . "&date=" . $bill_date . "&transaction_id=" . $transaction_id . "&sp_billno=" . $sp_billno . "&total_fee=" . $total_fee . "&fee_type=" . $fee_type . "&attach=" . $attach . "&key=" . $payment['tenpay_key'];
$sign_md5 = strtoupper(md5($sign_text));
if ($sign_md5 != $sign) {
return false;
} else {
/* 改变订单状态 */
order_paid($log_id);
return true;
}
}
开发者ID:dlpc,项目名称:ecshop,代码行数:44,代码来源:tenpay.php
示例4: respond
/**
* 响应操作
*/
function respond()
{
/*取返回参数*/
$cmd_no = $_GET['cmdno'];
$retcode = $_GET['retcode'];
$status = $_GET['status'];
$seller = $_GET['seller'];
$total_fee = $_GET['total_fee'];
$trade_price = $_GET['trade_price'];
$transport_fee = $_GET['transport_fee'];
$buyer_id = $_GET['buyer_id'];
$chnid = $_GET['chnid'];
$cft_tid = $_GET['cft_tid'];
$mch_vno = $_GET['mch_vno'];
$attach = !empty($_GET['attach']) ? $_GET['attach'] : '';
$version = $_GET['version'];
$sign = $_GET['sign'];
$payment = get_payment('tenpayc2c');
$log_id = get_order_id_by_sn($mch_vno);
//$log_id = str_replace($attach, '', $mch_vno); //取得支付的log_id
/* 如果$retcode大于0则表示支付失败 */
if ($retcode > 0)
{
//echo '操作失败';
return false;
}
/* 检查支付的金额是否相符 */
if (!check_money($log_id, $total_fee / 100))
{
//echo '金额不相等';
return false;
}
/* 检查数字签名是否正确 */
$sign_text = "buyer_id=" . $buyer_id . "&cft_tid=" . $cft_tid . "&chnid=" . $chnid . "&cmdno=" . $cmd_no . "&mch_vno=" . $mch_vno . "&retcode=" . $retcode . "&seller=" .$seller . "&status=" . $status . "&total_fee=" . $total_fee . "&trade_price=" . $trade_price . "&transport_fee=" . $transport_fee . "&version=" . $version . "&key=" . $payment['tenpay_key'];
$sign_md5 = strtoupper(md5($sign_text));
if ($sign_md5 != $sign)
{
//echo '签名错误';
return false;
}
elseif ($status = 3)
{
/* 改变订单状态为已付款 */
order_paid($log_id, PS_PAYING);
return true;
}
else
{
//为止error
return false;
}
}
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:59,代码来源:tenpayc2c.php
示例5: respond
/**
* 响应操作
*/
function respond()
{
$payment = get_payment($_GET['code']);
//--获取云网支付网关向商户发送的支付通知信息(以下简称为通知信息)
$c_mid = $_REQUEST['c_mid'];
//商户编号,在申请商户成功后即可获得,可以在申请商户成功的邮件中获取该编号
$c_order = $_REQUEST['c_order'];
//商户提供的订单号
$c_orderamount = $_REQUEST['c_orderamount'];
//商户提供的订单总金额,以元为单位,小数点后保留两位,如:13.05
$c_ymd = $_REQUEST['c_ymd'];
//商户传输过来的订单产生日期,格式为"yyyymmdd",如20050102
$c_transnum = $_REQUEST['c_transnum'];
//云网支付网关提供的该笔订单的交易流水号,供日后查询、核对使用;
$c_succmark = $_REQUEST['c_succmark'];
//交易成功标志,Y-成功 N-失败
$c_moneytype = $_REQUEST['c_moneytype'];
//支付币种,0为人民币
$c_cause = $_REQUEST['c_cause'];
//如果订单支付失败,则该值代表失败原因
$c_memo1 = $_REQUEST['c_memo1'];
//商户提供的需要在支付结果通知中转发的商户参数一
$c_memo2 = $_REQUEST['c_memo2'];
//商户提供的需要在支付结果通知中转发的商户参数二
$c_signstr = $_REQUEST['c_signstr'];
//云网支付网关对已上信息进行MD5加密后的字符串
//--校验信息完整性---
if ($c_mid == "" || $c_order == "" || $c_orderamount == "" || $c_ymd == "" || $c_moneytype == "" || $c_transnum == "" || $c_succmark == "" || $c_signstr == "") {
//echo "支付信息有误!";
return false;
}
//--将获得的通知信息拼成字符串,作为准备进行MD5加密的源串,需要注意的是,在拼串时,先后顺序不能改变
//商户的支付密钥,登录商户管理后台(https://www.cncard.net/admin/),在管理首页可找到该值
$c_pass = trim($payment['c_pass']);
$srcStr = $c_mid . $c_order . $c_orderamount . $c_ymd . $c_transnum . $c_succmark . $c_moneytype . $c_memo1 . $c_memo2 . $c_pass;
//--对支付通知信息进行MD5加密
$r_signstr = md5($srcStr);
//--校验商户网站对通知信息的MD5加密的结果和云网支付网关提供的MD5加密结果是否一致
if ($r_signstr != $c_signstr) {
//echo "签名验证失败";
return false;
}
//验证通过后,将订单sn转换为ID 来操作ec订单表
if ($c_memo2 == 'voucher') {
$c_order = get_order_id_by_sn($c_order, "true");
} else {
$c_order = get_order_id_by_sn($c_order);
}
/* 检查支付的金额是否相符 */
if (!check_money($c_order, $c_orderamount)) {
//echo "订单金额不对";
return false;
}
//--校验商户编号
$MerchantID = trim($payment['c_mid']);
//商户自己的编号
if ($MerchantID != $c_mid) {
//echo "提交的商户编号有误";
return false;
}
if ($c_memo1 != abs(crc32($payment['c_memo1']))) {
//echo "个性签名不一致";
//return false;
}
// $r_orderamount = $row["订单金额"]; //商户从自己订单系统获取该值
// if($r_orderamount!=$c_orderamount){
// echo "支付金额有误";
// exit;
// }
//--校验商户订单系统中记录的订单生成日期和云网支付网关通知信息中的订单生成日期是否一致
// $r_ymd = $row["订单生成日期"]; //商户从自己订单系统获取该值
// if($r_ymd!=$c_ymd){
// echo "订单时间有误";
// exit;
// }
//--校验返回的支付结果的格式是否正确
if ($c_succmark != "Y" && $c_succmark != "N") {
//echo "参数提交有误";
return false;
}
//--根据返回的支付结果,商户进行自己的发货等操作
if ($c_succmark = "Y") {
//根据商户自己商务规则,进行发货等系列操作
/* 改变订单状态 */
order_paid($c_order);
return true;
} else {
//echo $c_cause;
return false;
}
}
开发者ID:a494008974,项目名称:bzbshop,代码行数:94,代码来源:cncard.php
示例6: respond
/**
* 响应操作
*返回值为:0:失败;1:成功;字符串:正在付款[注意:当该订单状态为'正在付款时,请您务必到我方服务器查看最终的结果,谢谢']
*/
function respond()
{
$payment = get_payment($_GET['code']);
////////////////////////////////////////////////////////////////////////////////////////以下是新代码
//判断是第几次请求
if (isset($_POST["ReturnBillNo"]) && !empty($_POST["ReturnBillNo"])) {
//订单号
$returnBillNo = $_POST["ReturnBillNo"];
//币种
$ReturnCurrency = $_POST["ReturnCurrency"];
//金额
$ReturnAmount = $_POST["ReturnAmount"];
//支付状态
$ReturnSucceed = $_POST["ReturnSucceed"];
//返回码: 1 :表示交易成功 ; 0: 表示交易失败
//支付结果文字说明
$ReturnResult = $_POST["ReturnResult"];
// success: 表示成功 ; fail:表示失败
//加密串
$ReturnMD5info = $_POST["ReturnMD5info"];
$MD5key = $payment['MD5key'];
//MD5私钥
$md5src = $returnBillNo . $ReturnCurrency . $ReturnAmount . $ReturnSucceed . $MD5key;
//校验源字符串
$md5sign = strtoupper(md5($md5src));
//MD5检验结果
$zh = get_order_id_by_sn($returnBillNo);
//substr($BillNo, 14);
$zh = intval(trim($zh));
/* 验证 */
if ($ReturnMD5info == $md5sign) {
if (check_money($zh, $ReturnAmount / $payment['Rate'])) {
if ($Succeed == '1') {
/* 改变订单状态 */
order_paid($zh, PS_PAYED);
return '1';
} else {
if ($Succeed == '0') {
return '0';
} else {
return '0';
}
}
} else {
return '0';
}
} else {
return '0';
}
} else {
if (isset($_REQUEST["BillNo"]) && !empty($_REQUEST["BillNo"])) {
$BillNo = $_REQUEST["BillNo"];
//订单号
$Currency = $_REQUEST["Currency"];
//币种
$Amount = $_REQUEST["Amount"];
//金额
$Succeed = $_REQUEST["Succeed"];
//支付状态
$TradeNo = $_REQUEST["TradeNo"];
//支付平台流水号
$Result = $_REQUEST["Result"];
//支付结果
$MD5info = $_REQUEST["MD5info"];
//取得的MD5校验信息
$Remark = $_REQUEST["Remark"];
//备注
$MD5key = $payment['MD5key'];
//MD5私钥
$md5src = $BillNo . $Currency . $Amount . $Succeed . $MD5key;
//校验源字符串
$md5sign = strtoupper(md5($md5src));
//MD5检验结果
$zh = get_order_id_by_sn($BillNo);
//substr($BillNo, 14);
$zh = intval(trim($zh));
/* 验证 */
if ($MD5info == $md5sign) {
if (check_money($zh, $Amount / $payment['Rate'])) {
if ($Succeed == '88') {
/* 改变订单状态 */
order_paid($zh, PS_PAYED);
return '1';
} else {
if ($Succeed == '1' || $Succeed == '9' || $Succeed == '19') {
/* 改变订单状态 */
order_paid($zh, PS_PAYING);
return $Result;
} else {
return '0';
}
}
} else {
return '0';
}
} else {
//.........这里部分代码省略.........
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:101,代码来源:epay95.php
示例7: foreach
foreach ($payment as $k => $v) {
if ($v['name'] == 'chinabank_key') {
$key = $v['value'];
}
}
} else {
die('error');
}
$v_oid = trim($_POST['v_oid']);
$v_pmode = trim($_POST['v_pmode']);
$v_pstatus = trim($_POST['v_pstatus']);
$v_pstring = trim($_POST['v_pstring']);
$v_amount = trim($_POST['v_amount']);
$v_moneytype = trim($_POST['v_moneytype']);
$remark1 = trim($_POST['remark1']);
$remark2 = trim($_POST['remark2']);
$v_md5str = trim($_POST['v_md5str']);
$md5string = strtoupper(md5($v_oid . $v_pstatus . $v_amount . $v_moneytype . $key));
if ($v_md5str == $md5string) {
if ($v_pstatus == '20') {
if ($remark1 == 'voucher') {
$v_oid = get_order_id_by_sn($v_oid, 'true');
} else {
$v_oid = get_order_id_by_sn($v_oid);
}
order_paid($v_oid);
}
echo 'ok';
} else {
echo 'error';
}
开发者ID:netroby,项目名称:ecshop,代码行数:31,代码来源:chinabank_receive.php
示例8: trim
//2、开通了高级即时到账,从该笔交易成功时间算起,过了签约时的可退款时限(如:三个月以内可退款、一年以内可退款等)后。
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
echo "success";
//请不要修改或删除
} else {
if ($trade_status == 'TRADE_SUCCESS') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//如果有做过处理,不执行商户的业务程序
//注意:
//该种交易状态只在一种情况下出现——开通了高级即时到账,买家付款成功后。
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
$order_sn = trim(substr($out_trade_no, 0, 13));
$log_id = get_order_id_by_sn($order_sn);
//只发一次
$sql = "select pay_status from " . $hhs->table('order_info') . " where order_sn='{$order_sn}' ";
$pay_status = $db->getOne($sql);
if ($pay_status != 2) {
pay_team_action($order_sn);
}
order_paid($log_id);
echo "success";
//请不要修改或删除
}
}
}
//——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:notify_url.php
示例9: Log_
}
$returnXml = $notify->returnXml();
echo $returnXml;
//==商户根据实际情况设置相应的处理流程,此处仅作举例=======
//以log文件形式记录回调信息
$log_ = new Log_();
$log_name = "./notify_url.log";
//log文件路径
$log_->log_result($log_name, "【接收到的notify通知】:\n" . $xml . "\n");
if ($notify->checkSign() == TRUE) {
if ($notify->data["return_code"] == "FAIL") {
//此处应该更新一下订单状态,商户自行增删操作
$log_->log_result($log_name, "【通信出错】:\n" . $xml . "\n");
} elseif ($notify->data["result_code"] == "FAIL") {
//此处应该更新一下订单状态,商户自行增删操作
$log_->log_result($log_name, "【业务出错】:\n" . $xml . "\n");
} else {
$order = $notify->getData();
$orsn = $order["out_trade_no"];
$odid = get_order_id_by_sn($orsn);
order_paid($odid);
//$wxpay = new wxpay();
//$wxpay->respond();
//此处应该更新一下订单状态,商户自行增删操作
$log_->log_result($log_name, "【支付成功】:\n" . $order["out_trade_no"] . "\n");
}
//商户自行增加处理流程,
//例如:更新订单状态
//例如:数据库操作
//例如:推送支付完成信息
}
开发者ID:TotoroLeon,项目名称:wxpay_ecshop,代码行数:31,代码来源:notify_url.php
示例10: respond
/**
* 响应操作
*/
function respond()
{
$payment = get_payment(basename(__FILE__, '.php'));
$v_oid = trim($_POST['v_oid']);
$v_pmode = trim($_POST['v_pmode']);
$v_pstatus = trim($_POST['v_pstatus']);
$v_pstring = trim($_POST['v_pstring']);
$v_amount = trim($_POST['v_amount']);
$v_moneytype = trim($_POST['v_moneytype']);
$remark1 = trim($_POST['remark1']);
$remark2 = trim($_POST['remark2']);
$v_md5str = trim($_POST['v_md5str']);
/**
* 重新计算md5的值
*/
$key = $payment['chinabank_key'];
$md5string = strtoupper(md5($v_oid . $v_pstatus . $v_amount . $v_moneytype . $key));
/* 检查秘钥是否正确 */
if ($v_md5str == $md5string) {
//验证通过后,将订单sn转换为ID 来操作ec订单表
if ($remark1 == 'voucher') {
$v_oid = get_order_id_by_sn($v_oid, "true");
} else {
$v_oid = get_order_id_by_sn($v_oid);
}
if ($v_pstatus == '20') {
/* 改变订单状态 */
order_paid($v_oid);
return true;
}
} else {
return false;
}
}
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:37,代码来源:chinabank.php
示例11: respond
/**
* 响应操作
*/
function respond()
{
//order_paid($v_oid);
//return true;
$payment = get_payment(basename(__FILE__, '.php'));
$merid = trim($_POST['merid']);
$orderno = trim($_POST['orderno']);
$transdate = trim($_POST['transdate']);
$amount = trim($_POST['amount']);
$currencycode = trim($_POST['currencycode']);
$transtype = trim($_POST['transtype']);
$status = trim($_POST['status']);
$checkvalue = trim($_POST['checkvalue']);
$v_gateid = trim($_POST['GateId']);
$v_Priv1 = trim($_POST['Priv1']);
/**
* 重新计算密钥的值
*/
$pubkey = $payment['chinapay_pubkey_file'];
$PGID = buildKey(ROOT_PATH . $pubkey);
if (!$PGID) {
echo "导入私钥文件失败!";
exit;
}
$verify = verifyTransResponse($merid, $orderno, $amount, $currencycode, $transdate, $transtype, $status, $checkvalue);
if (!$verify) {
echo "验证签名失败!";
exit;
}
/* 检查秘钥是否正确 */
if ($status == '1001') {
$v_ordesn = chinapaysn2ecshopsn($orderno);
$order_id = get_order_id_by_sn($v_ordesn);
/* 改变订单状态 */
order_paid($order_id);
return true;
} else {
return false;
}
}
开发者ID:qida,项目名称:chinapay-for-ecshop,代码行数:43,代码来源:ChinaPay.php
示例12: get_verify_wap
public function get_verify_wap()
{
$arr['order_id'] = $_REQUEST['order_id'];
//天下支付订单号
$arr['mch_order_id'] = $_REQUEST['mch_order_id'];
//商户订单号
$arr['price'] = $_REQUEST['price'];
//订单单价(元)
$arr['quantity'] = $_REQUEST['quantity'];
//数量
$arr['total_fee'] = $_REQUEST['total_fee'];
//订单总额(元)
$arr['token_id'] = $_REQUEST['token_id'];
//订单唯一凭证
$arr['status'] = $_REQUEST['status'];
//支付状态(success:支付成功,其他:支付失败)
$sign = $_REQUEST['sign'];
$md_sign_parm = '';
foreach ($arr as $key => $value) {
$md_sign_parm .= $key . '=' . $value . '&';
}
$pay_config = $this->db->getOne("SELECT pay_config FROM " . $this->ecs->table('payment') . " WHERE pay_code = 'TXD'");
$pay_config = unserialize($pay_config);
$md_sign = md5($md_sign_parm . 'mch_key=' . $pay_config['cfg_key']);
/*
echo "<br>";
echo '本地原始加密:'.$md_sign_parm.'mch_key='.$pay_config['cfg_key']."<br>";
echo "本地sign:".$md_sign."<br>";
echo "传递sign:".$sign."<br>";
echo '121<br>';*/
if ($sign != $md_sign) {
return false;
}
//效验
if ($arr['status'] != 'success') {
return false;
}
//echo '12<br>';
//主动查询订单信息
//获取订单信息
$sql = "SELECT order_id,order_sn,order_amount,txd_pay_token_id AS token_id,pay_id,user_id \r\n\t\t FROM " . $this->ecs->table('order_info') . " \r\n\t\t WHERE order_sn = '{$arr['mch_order_id']}' \r\n\t\t AND txd_pay_token_id = '{$arr['token_id']}'";
$order = $this->db->getRow($sql);
//配置
$this->config($order['pay_id'], $order);
//主动求情结果 屏蔽自动查询
//$message = $this->get_order_result();
//请求结果失败
//if($message['code'] != '1') return false;
$sql = "SELECT p.order_amount \r\n\t\t FROM " . $this->ecs->table('order_info') . " AS o \r\n\t\t LEFT JOIN " . $this->ecs->table('pay_log') . " AS p on p.order_id = o.order_id \r\n\t\t WHERE o.order_sn = '{$arr['mch_order_id']}' \r\n\t\t AND txd_pay_token_id = '{$arr['token_id']}'";
$arr['total_fee'] = $this->db->getOne($sql);
//日志
$sql_arr = array('txd_data' => '', 'txd_return' => http_build_query($arr) . $sign, 'txd_or' => '3', 'order_sn' => $arr['mch_order_id']);
$this->get_token_log($sql_arr, '1');
//修改订单状态
$v_oid = get_order_id_by_sn($arr['mch_order_id']);
order_paid($v_oid);
$arr['ec_order_id'] = $order['mch_order_id'];
$arr['txd_order_id'] = $order['order_id'];
$arr['user_id'] = $order['user_id'];
return $arr;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:61,代码来源:txd.php
示例13: pay_verify
function pay_verify()
{
if (!empty($_POST)) {
foreach ($_POST as $key => $data) {
$_GET[$key] = $data;
}
}
$arr = array();
$seller_email = rawurldecode($_GET['seller_email']);
$order_sn = $_GET['out_trade_no'];
$arr['key'] = $this->order_num($order_sn);
/* 检查数字签名是否正确 */
ksort($_GET);
reset($_GET);
$sign = '';
foreach ($_GET as $key => $val) {
if ($key != 'sign' && $key != 'sign_type' && $key != 'code') {
$sign .= "{$key}={$val}&";
}
}
$sign = substr($sign, 0, -1) . $arr['key'];
//dump(MD5($sign));
//$sign = substr($sign, 0, -1) . ALIPAY_AUTH;
if (md5($sign) != $_GET['sign']) {
return false;
}
/* 检查支付的金额是否相符 */
/* if (!check_money($order_sn, $_GET['total_fee']))
{
return false;
}
else*/
if ($_GET['trade_status'] == 'TRADE_FINISHED') {
/* 改变订单状态 */
if ($_GET['extra_common_param'] == 'rechargeable') {
$v_oid = get_order_id_by_sn($order_sn, 'true');
} else {
$v_oid = get_order_id_by_sn($order_sn);
}
order_paid($v_oid);
$_GET['status'] = 1;
$_GET['orderid'] = $order_sn;
$_GET['payprice'] = $_GET['total_fee'];
return $_GET;
} else {
return false;
}
}
开发者ID:dlpc,项目名称:ecshop,代码行数:48,代码来源:pay_alipay.php
示例14: POST_pay_verify
function POST_pay_verify()
{
if (!isset($_POST) || empty($_POST)) {
return false;
}
$arr = array();
$arr['orderid'] = $_POST['orderid'];
//订单号
$arr['chargemoney'] = $_POST['chargemoney'];
//金额
$arr['systemno'] = $_POST['systemno'];
//新泛联订单号
$arr['channelid'] = $_POST['channelid'];
//支付渠道
$arr['status'] = $_POST['status'];
//支付状态
$arr['ext1'] = $_POST['ext1'];
$arr['ext2'] = $_POST['ext2'];
$arr['validate'] = $_POST['validate'];
//md5 值
$arr['key'] = $this->order_num($arr['orderid']);
$this->untx_pay_log($arr, 2);
$md5_respond = $this->POST_md5_respond($arr);
//dump($md5_respond);
if ($arr['validate'] == $md5_respond) {
if ($arr['status'] == '1') {
if ($arr['ext1'] == 'rechargeable') {
$v_oid = get_order_id_by_sn($arr['orderid'], 'true');
} else {
$v_oid = get_order_id_by_sn($arr['orderid']);
}
//检查金额
if (!check_money($v_oid, $_POST['chargemoney'])) {
return '0';
exit;
}
//返回成功信息
order_paid($v_oid);
return '1';
}
} else {
return '0';
}
}
开发者ID:dlpc,项目名称:ecshop,代码行数:44,代码来源:pay_untx.php
注:本文中的get_order_id_by_sn函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论