public static bool VerifyNotify(FengHeNotify notifyinfo) { //-------记录请求参数 YSWL.Log.LogHelper.AddInfoLog("FengHe-->VerifyNotify", String.Format("参数为:memberid-->{0}&returncode-->{1}&orderid-->{2}&amount-->{3}&datetime-->{4}&transaction_id-->{5}&attach-->{6}&sign--->{7}", notifyinfo.memberid, notifyinfo.returncode, notifyinfo.orderid, notifyinfo.amount, notifyinfo.datetime, notifyinfo.transaction_id, notifyinfo.attach, notifyinfo.sign)); if (String.IsNullOrWhiteSpace(notifyinfo.memberid) || String.IsNullOrWhiteSpace(notifyinfo.orderid)) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【FengHe支付回调通知失败"), "参数错误"); return(false); } string signStr = StringHelper.GetMD5(String.Format("amount={0}&datetime={1}&memberid={2}&orderid={3}&returncode={4}&transaction_id={5}&key={6}", notifyinfo.amount, notifyinfo.datetime, notifyinfo.memberid, notifyinfo.orderid, notifyinfo.returncode, notifyinfo.transaction_id, apikey)).ToUpper(); if (signStr == notifyinfo.sign) { if (notifyinfo.returncode == "00") { ColoPay.BLL.Pay.Order orderBll = new BLL.Pay.Order(); ColoPay.Model.Pay.Order orderInfo = orderBll.GetModel(notifyinfo.orderid); if (orderInfo == null) { return(false); } if (orderInfo.PaymentStatus == 2) { return(true); } bool isSuccess = orderBll.CompleteOrder(orderInfo); if (isSuccess)//成功之后需要回调商家回调地址 { try { ColoPay.BLL.Pay.Enterprise.Notify(orderInfo); } catch (Exception ex) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】FengHe支付回调通知失败:{1}", orderInfo.OrderCode, ex.Message), ex.StackTrace); return(isSuccess); } } return(isSuccess); } else { return(false); } } else { YSWL.Log.LogHelper.AddErrorLog(String.Format("订单【{0}】FengHe支付验证失败", notifyinfo.orderid), String.Format("参数为:memberid-->{0}&returncode-->{1}&orderid-->{2}&amount-->{3}&datetime-->{4}&transaction_id-->{5}&attach-->{6}&sign--->{7}", notifyinfo.memberid, notifyinfo.returncode, notifyinfo.orderid, notifyinfo.amount, notifyinfo.datetime, notifyinfo.transaction_id, notifyinfo.attach, notifyinfo.sign)); //验证失败,记录日志 ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】FengHe支付验证失败", notifyinfo.orderid), String.Format("参数为:memberid-->{0}&returncode-->{1}&orderid-->{2}&amount-->{3}&datetime-->{4}&transaction_id-->{5}&attach-->{6}&sign--->{7}", notifyinfo.memberid, notifyinfo.returncode, notifyinfo.orderid, notifyinfo.amount, notifyinfo.datetime, notifyinfo.transaction_id, notifyinfo.attach, notifyinfo.sign)); return(false); } }
public static bool VerifyNotify(QrNotify notifyinfo) { //-------记录请求参数 YSWL.Log.LogHelper.AddInfoLog("QR_Pay-->VerifyNotify", String.Format("参数为:customerid-->{0}&status-->{1}&sdpayno-->{2}&sdorderno-->{3}&total_fee-->{4}&paytype-->{5}&apikey-->{6}&sign--->{7}", notifyinfo.customerid, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.sdorderno, notifyinfo.total_fee, notifyinfo.paytype, apikey, notifyinfo.sign)); if (notifyinfo.customerid == 0 || String.IsNullOrWhiteSpace(notifyinfo.sdpayno) || String.IsNullOrWhiteSpace(notifyinfo.sdorderno) || String.IsNullOrWhiteSpace(notifyinfo.paytype)) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【QRPay支付回调通知失败"), "参数错误"); return(false); } string signStr = StringHelper.GetMD5(String.Format("customerid={0}&status={1}&sdpayno={2}&sdorderno={3}&total_fee={4}&paytype={5}&{6}", notifyinfo.customerid, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.sdorderno, notifyinfo.total_fee, notifyinfo.paytype, apikey)); if (signStr == notifyinfo.sign) { if (notifyinfo.status == 1) { ColoPay.BLL.Pay.Order orderBll = new BLL.Pay.Order(); ColoPay.Model.Pay.Order orderInfo = orderBll.GetModel(notifyinfo.sdorderno); if (orderInfo == null) { return(false); } if (orderInfo.PaymentStatus == 2) { return(true); } bool isSuccess = orderBll.CompleteOrder(orderInfo); if (isSuccess)//成功之后需要回调商家回调地址 { try { ColoPay.BLL.Pay.Enterprise.Notify(orderInfo); } catch (Exception ex) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】QrPay支付回调通知失败:{1}", orderInfo.OrderCode, ex.Message), ex.StackTrace); return(isSuccess); } } return(isSuccess); } else { return(false); } } else { YSWL.Log.LogHelper.AddInfoLog(String.Format("订单【{0}】QrPay支付验证失败", notifyinfo.sdorderno), String.Format("参数为:customerid-->{0}&status-->{1}&sdpayno-->{2}&sdorderno-->{3}&total_fee-->{4}&paytype-->{5}&apikey-->{6}&sign--->{7}", notifyinfo.customerid, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.sdorderno, notifyinfo.total_fee, notifyinfo.paytype, apikey, notifyinfo.sign)); //验证失败,记录日志 ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】QrPay支付验证失败", notifyinfo.sdorderno), String.Format("参数为:customerid-->{0}&status-->{1}&sdpayno-->{2}&sdorderno-->{3}&total_fee-->{4}&paytype-->{5}&apikey-->{6}&sign--->{7}", notifyinfo.customerid, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.sdorderno, notifyinfo.total_fee, notifyinfo.paytype, apikey, notifyinfo.sign)); return(false); } }
public static bool VerifyNotify(DaNotify notifyinfo) { //-------记录请求参数 YSWL.Log.LogHelper.AddInfoLog("DaDaBank-->VerifyNotify", String.Format("参数为:order-->{0}&code-->{1}&mount-->{2}&msg-->{3}&time-->{4}&sign-->{5}", notifyinfo.order, notifyinfo.code, notifyinfo.mount, notifyinfo.msg, notifyinfo.time, notifyinfo.sign)); if (String.IsNullOrWhiteSpace(notifyinfo.order) || String.IsNullOrWhiteSpace(notifyinfo.code)) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【DaPay支付回调通知失败"), "参数错误"); return(false); } string signStr = GetNotifySignStr(notifyinfo.order, notifyinfo.mount, notifyinfo.code, notifyinfo.msg, notifyinfo.time); //StringHelper.GetMD5(String.Format("mch_id={0}&status={1}&sdpayno={2}&order_no={3}&money={4}&paytype={5}&{6}", notifyinfo.mch_id, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.order_no, notifyinfo.money, notifyinfo.paytype, apikey)); if (signStr == notifyinfo.sign) { if (notifyinfo.code == "200") { ColoPay.BLL.Pay.Order orderBll = new BLL.Pay.Order(); ColoPay.Model.Pay.Order orderInfo = orderBll.GetModel(notifyinfo.order); if (orderInfo == null) { return(false); } if (orderInfo.PaymentStatus == 2) { return(true); } bool isSuccess = orderBll.CompleteOrder(orderInfo); if (isSuccess)//成功之后需要回调商家回调地址 { try { ColoPay.BLL.Pay.Enterprise.Notify(orderInfo); } catch (Exception ex) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】DaPay支付回调通知失败:{1}", orderInfo.OrderCode, ex.Message), ex.StackTrace); return(isSuccess); } } return(isSuccess); } else { return(false); } } else { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单DaPay支付回调通知失败"), String.Format("加密签名错误:接口签名字段为【{0}】---生成的签名为【{1}】", notifyinfo.sign, signStr)); //验证失败,记录日志 ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】DaPay支付验证失败", notifyinfo.order), String.Format("参数为:order-->{0}&code-->{1}&mount-->{2}&msg-->{3}&time-->{4}", notifyinfo.order, notifyinfo.code, notifyinfo.mount, notifyinfo.msg, notifyinfo.time)); return(false); } }
public static bool VerifyNotify(BZNotify notifyinfo) { if (String.IsNullOrWhiteSpace(notifyinfo.mch_id) || String.IsNullOrWhiteSpace(notifyinfo.sdpayno) || String.IsNullOrWhiteSpace(notifyinfo.order_no) || String.IsNullOrWhiteSpace(notifyinfo.paytype)) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【BZPay支付回调通知失败"), "参数错误"); return(false); } string signStr = StringHelper.GetMD5(String.Format("mch_id={0}&status={1}&sdpayno={2}&order_no={3}&money={4}&paytype={5}&{6}", notifyinfo.mch_id, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.order_no, notifyinfo.money, notifyinfo.paytype, apikey)); if (signStr == notifyinfo.sign) { if (notifyinfo.status == 1) { ColoPay.BLL.Pay.Order orderBll = new BLL.Pay.Order(); ColoPay.Model.Pay.Order orderInfo = orderBll.GetModel(notifyinfo.order_no); if (orderInfo == null) { return(false); } if (orderInfo.PaymentStatus == 2) { return(true); } bool isSuccess = orderBll.CompleteOrder(orderInfo); if (isSuccess)//成功之后需要回调商家回调地址 { try { ColoPay.BLL.Pay.Enterprise.Notify(orderInfo); } catch (Exception ex) { ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】BZPay支付回调通知失败:{1}", orderInfo.OrderCode, ex.Message), ex.StackTrace); return(isSuccess); } } return(isSuccess); } else { return(false); } } else { //验证失败,记录日志 ColoPay.BLL.SysManage.LogHelp.AddErrorLog(String.Format("订单【{0}】BZPay支付验证失败", notifyinfo.order_no), String.Format("参数为:mch_id-->{0}&status-->{1}&sdpayno-->{2}&order_no-->{3}&money-->{4}&paytype-->{5}&apikey-->{6}", notifyinfo.mch_id, notifyinfo.status, notifyinfo.sdpayno, notifyinfo.order_no, notifyinfo.money, notifyinfo.paytype, apikey)); return(false); } }