private void orderInfo(ref WaterOrderInfo orderinfo, PayParam p) { WaterOrderParam param = new WaterOrderParam(); param.paymentno = info.msgrsp.orderlist[0].custNo; param.billdate = info.msgrsp.orderlist[0].billDate; param.paymentamout = info.msgrsp.orderlist[0].amout; param.shopType = PayAccess.isWtLkl(p.icParams); log.Write("发起订单:用户编号:" + param.paymentno + ",账单金额:" + param.paymentamout); orderinfo = WaterAccess.WaterOrder(param); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //订单实际支付金额 p.rechageAmount = Convert.ToDouble(orderinfo.msgrsp.realAmout).ToString(); //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.waterPayParam.OrderInfo = orderinfo; log.Write("订单提交成功:云平台订单号:" + orderinfo.msgrsp.orderNo); }
private void orderInfo(ref ElecOrderInfo orderinfo, PayParam p) { log.Write("发起订单:用户编号:" + payParam.Account + ",充值金额:" + payParam.UserInputMoney); payParam.ShopType = PayAccess.isWtLkl(p.icParams); orderinfo = ElecAccess.ElecOrder(payParam); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; //订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.elecPayParam.OrderInfo = orderinfo; Payment.elecPayParam.RechageAmount = orderinfo.msgrsp.realAmout; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); }
private void orderInfo(ref WintopOrderInfo orderinfo, PayParam p) { log.Write("发起订单:甘肃一卡通卡号:" + Payment.wintopReChargeParam.WtCardNo + ",充值金额:" + Payment.wintopReChargeParam.UserInputMoney); Payment.wintopReChargeParam.ShopType = PayAccess.isWtLkl(p.icParams); orderinfo = WintopAccess.WintopOrder(Payment.wintopReChargeParam); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = Payment.wintopReChargeParam.WintopDiscountInfoMsgrspList.CZ00030; //订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.wintopReChargeParam.RechageAmount = Payment.wintopReChargeParam.WintopDiscountInfoMsgrspList.CZ00030; Payment.wintopReChargeParam.WintopOrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); }
private void button5_Click_1(object sender, EventArgs e) { PropSecOrderParam param = new PropSecOrderParam(); param.shopType = "1"; param.AMOUNT = "12"; param.paymentAmout = "0"; param.SC10009 = "W000000001"; param.SC10010 = "01"; param.SC10007 = "XQ00000221"; param.SC10008 = SC10008; param.merchantNo = merchantNo; PropSecOrderInfo info = access.order(param); PayAccess payAccess = new PayAccess(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("serviceType", "5_2"); parameters.Add("realAmout", info.msgrsp.realAmout); parameters.Add("tr.shop_type", "1"); parameters.Add("tr.cloud_no", info.msgrsp.orderNo); parameters.Add("terminalNo", SysConfigHelper.readerNode("ClientNo")); parameters.Add("ipAddress", SysConfigHelper.readerNode("PayName")); PayResultInfo payinfo = payAccess.PayResNewAcc(parameters); StringBuilder result1 = new StringBuilder(2048); StringBuilder result2 = new StringBuilder(2048); IntPtr status = PropSwwyBLL.WF002( new StringBuilder("02"), //业务类型 new StringBuilder("01"), //卡片种类 new StringBuilder("01"), //卡片版本 new StringBuilder(""), //,业务步骤 new StringBuilder(""), //卡片唯一识别号 new StringBuilder(""), //物业公司编号 new StringBuilder(""), //小区编号 new StringBuilder("W000000001"), //表具产商编号 new StringBuilder("8"), //端口号 result1, //返回说明 new StringBuilder(payinfo.SC20003.ToString()), //业务输入信息 result2 //业务返回信息 ); string result = Marshal.PtrToStringAnsi(status); MessageBox.Show(result); PropSecCardJson card = new PropSec().JsonToModel(result2.ToString()); //SC10007 = card.G_0806; SC10008 = card.G_1802; listViewAdd("写卡:" + "状态:" + result.ToString() + "返回说明:" + result1.ToString() + "返回信息:" + result2.ToString()); //IntPtr intPtr = ReturnString(); //string str = Marshal.PtrToStringAnsi(intPtr); }
private void orderInfo(ref PropOrderInfo orderinfo, PayParam p) { PropOrderParam param = new PropOrderParam(); //获取订单 try { if (payParam.PropType == 1) { //房屋 param.queryid = payParam.HouseInfo.houseid; param.isPark = "1"; } else if (payParam.PropType == 2) { //车位 param.queryid = payParam.ParkInfo.parkingid; param.isPark = "0"; } param.paymentAmout = payParam.ChargeList.money; param.shopType = PayAccess.isWtLkl(p.icParams); param.merchantNo = Payment.PropPayParam.MerchantNo; log.Write("发起订单:用户电话号码:" + payParam.Mobile + ",账单金额:" + payParam.ChargeList.money); orderinfo = PropAccess.Order(param); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.PropPayParam.PropOrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); } catch (Exception ex1) { log.Write("error:物业获取缴费订单失败!" + ex1.Message + ex1.InnerException); return; } }
public void orderInfo(ref MobileOrderInfo orderinfo, PayParam p) { try { MobileOrderParam mobileOrderParam = new MobileOrderParam(); //获取订单 log.Write("发起订单:电话号码:" + payParam.PhoneOn + ",缴费金额:" + payParam.UserInputMoney); mobileOrderParam.mobile = payParam.PhoneOn; mobileOrderParam.paymentAmout = p.userInputAmount; mobileOrderParam.shopType = PayAccess.isWtLkl(p.icParams); orderinfo = MobileAccess.order(mobileOrderParam, payParam.QueryInfo); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; if (PayStaticParam.payType == 0) { //交易金额 p.rechageAmount = p.userInputAmount; Payment.mobilePayParam.RechageAmount = p.userInputAmount; } else { //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; Payment.mobilePayParam.RechageAmount = orderinfo.msgrsp.realAmout; } //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.mobilePayParam.OrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); } catch (Exception ex) { log.Write("获取缴费订单失败:" + ex.Message + Environment.NewLine + ex.InnerException); //获取订单的失败 exit("充值失败,请稍后再试..."); return; } }
public void orderInfo(ref UnicomOrderInfo orderinfo, PayParam p) { try { //获取订单 log.Write("发起订单:电话号码:" + payParam.PhoneOn + ",缴费金额:" + payParam.UserInputMoney); string shoptype = PayAccess.isWtLkl(p.icParams); orderinfo = UnicomAccess.order(payParam.PhoneOn, p.userInputAmount, payParam.Msgrsp.ACCOUNT_NO, shoptype); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; if (PayStaticParam.payType == 0) { //交易金额 p.rechageAmount = p.userInputAmount; Payment.unicomPayParam.RechageAmount = p.userInputAmount; } else { //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; Payment.unicomPayParam.RechageAmount = orderinfo.msgrsp.realAmout; } //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.unicomPayParam.Orderinfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); } catch (Exception e) { log.Write("获取缴费订单失败!:" + e.Message); //获取订单的失败 exit("充值失败,请重新缴费,或退卡"); return; } }
/// <summary> /// 提交物业2订单 /// </summary> /// <returns></returns> private Boolean propSecOrder() { try { PropSecAccess access = new PropSecAccess(); PropSecOrderParam param = new PropSecOrderParam(); param.shopType = PayAccess.isWtLkl(Payment.propSecPayParam.IcParams); param.AMOUNT = Payment.propSecPayParam.UserInputMoney; param.paymentAmout = "1"; param.SC10009 = Payment.propSecPayParam.ManufacturerNum; param.SC10010 = Payment.propSecPayParam.CardType; param.SC10007 = ConfigSysParam.ResidentialNo; param.SC10014 = Payment.propSecPayParam.PrimaryKey; param.SC10008 = Payment.propSecPayParam.SC10008; param.merchantNo = Payment.propSecPayParam.merchantNo; PropSecOrderInfo orderinfo = access.order(param); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return(false); } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return(false); } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return(false); } Payment.propSecPayParam.p = new PayParam(); //获取商户号 Payment.propSecPayParam.p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 Payment.propSecPayParam.p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //订单实际支付金额 Payment.propSecPayParam.p.rechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 Payment.propSecPayParam.p.orderNo = orderinfo.msgrsp.orderNo; Payment.propSecPayParam.RechageAmount = orderinfo.msgrsp.realAmout; Payment.propSecPayParam.orderInfo = orderinfo; log.Write("订单提交成功:云平台订单号:" + orderinfo.msgrsp.orderNo); return(true); } catch (Exception ex) { } return(false); }
private void orderInfo(ref PropOrderInfo orderinfo, PayParam p) { PropOrderParam param = new PropOrderParam(); //获取订单 try { param.paymentno = Payment.propPayTempParam.AccountNo; param.merchantNo = Payment.propPayTempParam.MerchantNo; param.AMOUNT = Payment.propPayTempParam.UserInputMoney; param.HOUSEID = Payment.propPayTempParam.House; param.paymentAmout = Payment.propPayTempParam.RechageAmount; param.shopType = PayAccess.isWtLkl(p.icParams); param.TYPE = Payment.propPayTempParam.PropType; //log.Write("发起订单:用户电话号码:" + payParam.Mobile + ",账单金额:" + payParam.ChargeList.money); orderinfo = PropAccess.getPropOrder(param); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.propPayTempParam.PropOrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); } catch (Exception ex1) { log.Write("error:物业获取缴费订单失败!" + ex1.Message + ex1.InnerException); return; } }
private void pay() { log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:小区物业"); Thread.Sleep(3000); //测试 Util.JumpUtil.jumpCommonPage("FormPropStepTemp06_success"); return; PayAccess payAccess = new PayAccess(); PayParam p = new PayParam(); Pay pay = new Pay(); //订单结果 PropOrderInfo orderinfo = null; //初始化参数 payAccess.InitPayParam(ref p); PayBLL.payCode_terminalNo(ref p); try { //获取订单 orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormPropStepTemp06_success"); } return; } catch (Exception ex9) { log.Write("交易异常:" + ex9.Message); exit(SysConfigHelper.readerNode("payUnknownInfo")); return; } }
/// <summary> /// 退款 /// </summary> /// <param name="orderinfo"></param> /// <param name="payResultInfo"></param> /// <param name="p"></param> public void refund(ref PayResultInfo payResultInfo, PayParam p) { try { RefundParam refundParam = new RefundParam(); //交易类型 refundParam.serviceType = p.serviceType; //是否写卡成功 refundParam.rqFlushesCode = p.rqFlushesCode; //交易类型 refundParam.shop_type = isWtLkl(p.icParams); //云平台订单号 refundParam.cloud_no = p.orderNo; //交易金额 payResultInfo.map["4"] = p.rechageAmount; //退款 if (p.icParams == null) { //万通退款 refundParam.data = Wanton.wtRefund(payResultInfo.map, p.MERCHANTNO_shopNo); } else { //银行卡退款 refundParam.data = LKLProcedure.wtPayRevoke(payResultInfo.map, p); } PayAccess payAccess = new PayAccess(); //发起退款 PayResultInfo result = payAccess.RefundAcc(refundParam); if ("0000".Equals(result.code)) { log.Write("退款成功!"); } else { log.Write("退款失败!"); } } catch (Exception ex) { log.Write("error:退款异常:" + ex.Message + ex.InnerException); } }
//设置签到 private void setSignTime() { try { if (DateTime.Now.Hour == 0) { if (DateTime.Now.Minute > 5) { if (SysBLL.signTime.Day != DateTime.Now.Day) { log.Write("签到时间已到,开始签到。"); SysBLL.signTime = DateTime.Now; //万通拉卡拉签到 PayAccess.LklWtSign(); } } } } catch (Exception e) { log.Write("签到异常:" + e.Message); } }
public void orderInfo(ref GasOrderInfo orderinfo, PayParam p) { log.Write("发起订单:燃气卡号:" + card.CardNo + ",充值气量:" + card.rechargeNum); GasOrderParam gasOrderParam = new GasOrderParam(); gasOrderParam.paymentno = card.CardNo; gasOrderParam.chargeAmount = card.rechargeNum; gasOrderParam.paymentAmout = card.price; gasOrderParam.shopType = PayAccess.isWtLkl(p.icParams); //发送燃气订单 orderinfo = GasAccess.gasOrder(gasOrderParam); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if ("11111".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; if (!orderinfo.msgrsp.retcode.Equals("0000")) { throw new Exception(); } Payment.GasPayParam.GasOrderInfo = orderinfo; }
public void pay() { TradeRecord tradeRecord = new TradeRecord(); log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:电力"); PayAccess payAccess = new PayAccess(); PayParam p = new PayParam(); Pay pay = new Pay(); //订单 ElecOrderInfo orderinfo = null; //初始化参数 payAccess.InitPayParam(ref p); PayBLL.payCode_terminalNo(ref p); try { //获取订单 orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormElectricStep06_success"); } return; } catch (Exception ex9) { log.Write("交易异常:" + ex9.Message); exit(SysConfigHelper.readerNode("payFailInfo")); return; } }
public void pay() { log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:广电"); PayAccess payAccess = new PayAccess(); PayParam p = new PayParam(); //订单结果 BroadCasOrderInfo orderinfo = null; Pay pay = new Pay(); //初始化银行卡交易参数 payAccess.InitPayParam(ref p); //设置交易流水 PayBLL.payCode_terminalNo(ref p); try { //获取订单 orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormBroadCasStep06_success"); } return; } catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); } catch (Exception ee) { log.Write("交易异常:" + ee.Message); exit("缴费失败,请重新缴费,或退卡"); return; } }
/// <summary> /// 初始化资源,所有要用的资源都在这里加载,防止内存泄露 /// </summary> private void initResouces() { //加载页面 new ResourceInitialise().LoadForm(); try { //上送版本号 WtPayAccess.insertVersion(); //设置系统时间 SysBLL.SetSystemTime(BroadCasAccess.getSystemTime()); //设备签到 string mechineNo = ConfigurationManager.AppSettings["MechineNo"]; SysBLL.MechineSign(mechineNo); //万通拉卡拉签到 PayAccess.LklWtSign(); //燃气注册表 SysBLL.RunBat(System.AppDomain.CurrentDomain.BaseDirectory + SysConfigHelper.readerNode("regist")); } catch (Exception ex) { log.Write("error:MainWindow:weatherWorker_DoWork:" + ex.Message); } }
public void orderInfo(ref HeatOrderInfo orderinfo, PayParam p) { //热力订单 HeatOrderParam orderParam = new HeatOrderParam(); orderParam.paymentno = info.custNo; //查询的custNo orderParam.realAmout = info.amout; //查询的amout orderParam.paymentAmout = info.amout; orderParam.billDate = info.billDate; orderParam.shopType = PayAccess.isWtLkl(p.icParams); log.Write("发起订单:用户编号:" + orderParam.paymentno + ",缴费金额:" + info.amout); orderinfo = HeatAccess.HeatOrder(orderParam); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.heatPayParam.RechageAmount = orderinfo.msgrsp.realAmout; Payment.heatPayParam.HeatOrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); }
private void pay() { log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:水务"); PayAccess payAccess = new PayAccess(); PayParam p = new PayParam(); Pay pay = new Pay(); //订单结果 WaterOrderInfo orderinfo = null; //初始化参数 payAccess.InitPayParam(ref p); PayBLL.payCode_terminalNo(ref p); try { //获取订单 orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormWaterStep06_success"); } return; } catch (Exception ex6) { log.Write("交易异常:" + ex6.Message); exit("缴费失败,请重新缴费,或退卡"); return; } }
public void orderInfo(ref BroadCasOrderInfo orderinfo, PayParam p) { //获取订单 BroadCasOrderParam param = new BroadCasOrderParam(); param.paymentno = list.CUSTNO; param.paymentAmout = list.BANLANCE; //param.balenceNO = list.balenceNO; param.shopType = PayAccess.isWtLkl(p.icParams); log.Write("获取订单:用户编号:" + param.paymentno + ",账单金额:" + param.paymentAmout + ",余额账本编码:" + param.balenceNO); //发送缴费订单 orderinfo = BroadCasAccess.order(param); if ("9999".Equals(orderinfo.msgrsp.retcode)) { return; } if ("1234".Equals(orderinfo.msgrsp.retcode)) { return; } if (!"0000".Equals(orderinfo.msgrsp.retcode)) { return; } //获取商户号 p.MERCHANTNO_shopNo = orderinfo.msgrsp.MERCHANTNO; //获取终端号 p.TERMINALNO_clientNo = orderinfo.msgrsp.TERMINALNO; //交易金额 p.rechageAmount = orderinfo.msgrsp.realAmout; Payment.broadCasPayParam.RechageAmount = orderinfo.msgrsp.realAmout; //交易订单号 p.orderNo = orderinfo.msgrsp.orderNo; Payment.broadCasPayParam.BroadCasOrderInfo = orderinfo; log.Write("订单提交成功:订单号:" + orderinfo.msgrsp.orderNo); }
/// <summary> /// 支付 /// </summary> /// <param name="p"></param> /// <returns></returns> public PayResultInfo payStart(PayParam p) { //密码键盘工具类 PasswordBLL pwdBLL = new PasswordBLL(); //交易数据访问类 PayAccess payAccess = new PayAccess(); //支付结果 PayResultInfo payResultInfo = null; try { Dictionary <string, string> parameters = new Dictionary <string, string>(); //缴费类型 parameters.Add("serviceType", p.serviceType); //交易金额 parameters.Add("realAmout", p.rechageAmount); //交易类型,纸币,银行卡,万通卡 parameters.Add("tr.shop_type", isWtLkl(p.icParams)); if (PayStaticParam.payType == -1) {//电子现金支付相关参数 //获取批次号 p.batchNo = LKLProcedure.GetBatchNo(); //获取支付报文 parameters.Add("tr.data", PayBLL.PayMessage(ref p)); //批次流水号 parameters.Add("dzls", p.batchNo + p.WtLklorderNo); } //云平台交易流水号 parameters.Add("tr.cloud_no", p.orderNo); if ("4".Equals(p.serviceType)) { //万通卡支付相关参数 if (SysBLL.IsTest.Equals("正式")) { parameters.Add("terminalno", "XNJ00002"); parameters.Add("terminal", ConfigurationManager.AppSettings["MechineNo"]); } else { parameters.Add("terminalno", "UU000002"); parameters.Add("terminal", ConfigurationManager.AppSettings["MechineNo"]); } } else { parameters.Add("terminalNo", p.terminalNo); } //设置其余参数 initParam(parameters, p); //发起支付 payResultInfo = payAccess.PayResNewAcc(parameters); //纸币交易到此为止 if (PayStaticParam.payType == 0) { if ("0000".Equals(payResultInfo.code)) { //支付成功 log.Write("--------------------交易结束--------------------"); return(payResultInfo); } else { payResultInfo.code = "9999"; log.Write("--------------------交易结束--------------------"); return(payResultInfo); } } if (isNull(payResultInfo) || ("9991".Equals(payResultInfo.code))) { //冲正 CorrectParam correctParam = new CorrectParam(); //缴费类型 correctParam.serviceType = p.serviceType; //支付类型 correctParam.shop_type = isWtLkl(p.icParams); //云平台交易流水 correctParam.cloud_no = p.orderNo; for (int i = 1; i <= 3; i++) { //获取冲正报文 correctParam.data = Util.JumpUtil.CorrectJump(p); //发起冲正 PayResultInfo payResultInfoacc = payAccess.CorrectAcc(correctParam); if ("0000".Equals(payResultInfoacc.code)) { break; } } payResultInfo.code = "9991"; return(payResultInfo); } else if ("9955".Equals(payResultInfo.code)) { //密码错误 SysBLL.PasswordErrorInfo = "密码错误,请重新输入!"; log.Write("密码错误"); log.Write("--------------------交易结束--------------------"); if (p.icParams == null) { //打开键盘,同时交易页面跳转到输入密码页面,万通 pwdBLL.OpenKeyboard(SysConfigHelper.readerNode("ZT598Port"), "9600", p.WtNo); return(payResultInfo); } else { //打开键盘,同时交易页面跳转到输入密码页面,银行卡 pwdBLL.OpenKeyboard(SysConfigHelper.readerNode("ZT598Port"), "9600", p.icParams["cardNo"]); return(payResultInfo); } } else if ("9951".Equals(payResultInfo.code)) { //余额不足 log.Write("余额不足"); return(payResultInfo); } else if ("9900".Equals(payResultInfo.code)) { //发起退款 refund(ref payResultInfo, p); return(payResultInfo); } else if ("0000".Equals(payResultInfo.code)) { //支付成功 log.Write("--------------------交易结束--------------------"); //银行卡给万通卡充值成功后,测试环境下会在其他服务页面中显示银行卡退款按钮,可进行退款操作 if (SysBLL.IsTest.Equals("测试")) { if (p.serviceType.Equals("4")) { //发起退款 RefundTest refundTest = new RefundTest(); refundTest.refundPayResultInfo = payResultInfo; refundTest.refundPayParam = p; PayStaticParam.refundTest.Add(refundTest); } } return(payResultInfo); } else { return(payResultInfo); } } catch (Exception ex) { log.Write("error:99:支付失败:" + ex.Message + ex.InnerException); return(payResultInfo); } }
public void pay() { log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:燃气"); PayAccess payAccess = new PayAccess(); PayParam p = new PayParam(); Pay pay = new Pay(); //订单结果 GasOrderInfo orderinfo = null; //初始化参数 payAccess.InitPayParam(ref p); PayBLL.payCode_terminalNo(ref p); try { //获取订单 orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { bool isCarsWrite = false; WriteCardParam writeCardParam = new WriteCardParam(); writeCardParam.write_card_status = "3"; //金卡卡内充值 if (card.cardType == 1) { int rechageNum = Convert.ToInt32(card.rechargeNum) + card.GasValue; if (jinCard.Recharge(card.CardNo, rechageNum)) { isCarsWrite = true; writeCardParam.write_card_status = "1"; } } //先锋卡内充值 if (card.cardType == 2) { int rechageNum = Convert.ToInt32(card.rechargeNum); if (xf.Recharge(card.CardNo, rechageNum)) { isCarsWrite = true; writeCardParam.write_card_status = "1"; } } //写卡状态 writeCardParam.serviceType = p.serviceType; writeCardParam.rqFlushesCode = isCardTypeRq(card); writeCardParam.shop_type = PayAccess.isWtLkl(p.icParams); writeCardParam.cloud_no = orderinfo.msgrsp.orderNo; writeCardParam.data = pay.refundStr(p.payResultInfo, p); payAccess.WriteCardAcc(writeCardParam); if (isCarsWrite) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormGasGoldenCardStep08_success"); return; } else { log.Write("error:燃气卡写卡失败"); exitRefund("缴费失败,退款成功"); return; } } return; } catch (Exception ex) { log.Write("error:" + ex.Message); } exit("缴费失败,退款成功"); return; }
public void pay() { log.Write("--------------------交易开始--------------------"); log.Write("----------缴费类型:物业二次"); PayAccess payAccess = new PayAccess(); PayParam p = Payment.propSecPayParam.p; Pay pay = new Pay(); //订单结果 PropSecOrderInfo orderinfo = Payment.propSecPayParam.orderInfo; //初始化参数 payAccess.InitPayParam(ref p); PayBLL.payCode_terminalNo(ref p); try { //获取订单 //orderInfo(ref orderinfo, p); //获取订单结果处理 if (pay.orderInfoResult(orderinfo.msgrsp.retcode, orderinfo.msgrsp.retshow) == false) { return; } //支付 if (pay.payResult(ref p)) { bool isCarsWrite = false; //写卡状态 WriteCardParam writeCardParam = new WriteCardParam(); StringBuilder result1 = new StringBuilder(2048); StringBuilder result2 = new StringBuilder(2048); log.Write("物业2读卡:业务类型:08,卡片种类:" + Payment.propSecPayParam.CardType + ",表具厂商编号:" + Payment.propSecPayParam.ManufacturerNum + ",业务输入信息:" + p.propSecSC20003); IntPtr status = PropSwwy.WF002( new StringBuilder("02"), //业务类型 new StringBuilder(Payment.propSecPayParam.CardType), //卡片种类 new StringBuilder("01"), //卡片版本 new StringBuilder(""), //,业务步骤 new StringBuilder(""), //卡片唯一识别号 new StringBuilder(""), //物业公司编号 new StringBuilder(""), //小区编号 new StringBuilder(Payment.propSecPayParam.ManufacturerNum), //表具产商编号 new StringBuilder(SysConfigHelper.readerNode("PropSwwyName")), //端口号 result1, //返回说明 new StringBuilder(p.propSecSC20003), //业务输入信息 result2 //业务返回信息 ); string result = Marshal.PtrToStringAnsi(status); if ("0".Equals(result)) { //写卡成功 writeCardParam.write_card_status = "1"; isCarsWrite = true; } else { //写卡失败 writeCardParam.write_card_status = "3"; PayResultInfo payresultInfo = p.payResultInfo; p.rqFlushesCode = "SC005"; //pay.refund(ref payresultInfo, p); isCarsWrite = false; } //PropSecCardJson card = new PropSec().JsonToModel(result2.ToString()); writeCardParam.serviceType = p.serviceType; writeCardParam.rqFlushesCode = isCardTypeRq(); writeCardParam.shop_type = PayAccess.isWtLkl(p.icParams); writeCardParam.cloud_no = orderinfo.msgrsp.orderNo; writeCardParam.data = pay.refundStr(p.payResultInfo, p); PayResultInfo resultInfo = payAccess.WriteCardAcc(writeCardParam); if (isCarsWrite) { log.Write("--------------------交易结束--------------------"); Util.JumpUtil.jumpCommonPage("FormPropSecStep08_success"); return; } else { log.Write("error:物业卡写卡失败"); FormTip.FormFailRefundShowinfo = resultInfo.msg; Util.JumpUtil.jumpCommonPage("FormFailRefund"); return; } } return; } catch (AccessViolationException ave) { log.Write("error:" + ave.Message); } catch (Exception ex) { log.Write("error:" + ex.Message); } exit("缴费失败,请稍后再试..."); return; }
private void readCard() { try { Thread.Sleep(1500); //等待用户插卡 MachCardBLL.waitCard(); } catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); } catch (Exception ex) { log.Write("error:插卡页readCard():" + ex.Message); } while (true) { try { Thread.Sleep(700); //卡机内是否有卡 if (!MachCardBLL.CardUsable()) { continue; } PrintInfo("正在读卡,请稍后..."); Thread.Sleep(1500); } catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); } catch (Exception ex) { log.Write("error:插卡页readCard():" + ex.Message); } try { //签到 PayAccess.ReadSign(); string wtNo = wt.GetCardNo(); if (wtNo != null) { if (wtNo.Length == 16) { if (SysBLL.payCostType == 3) { //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); PrintInfo("暂不支持此卡,请取卡"); return; } else { SysBLL.payCardType = 1; SysBLL.payCardNo = wtNo; if (!pwdBLL.SetCryptMode(1)) { throw new Exception("系统异常,请稍后再试..."); //万通卡加密方式 } pwdBLL.closeKey(); //pwdBLL.OpenKeyboard(SysConfigHelper.readerNode("ZT598Port"), "9600", wtNo); if (!setPayParam(wtNo, null, wtNo)) { //PrintInfo("业务异常,请稍后再试..."); //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); return; } ; SysBLL.payTypeName = "甘肃一卡通"; WintopStatusInfo statusInfo = new WintopAccess().queryCardStatus(wtNo); if ((statusInfo.msgrsp.WTSTATE == null) || (statusInfo.msgrsp.WTSTATE.Equals(""))) { PrintInfo("业务正忙,请稍后再试"); //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); return; } if ("01".Equals(statusInfo.msgrsp.WTSTATE)) { //执行下一步操作 this.Dispatcher.Invoke(new Action(() => { Util.JumpUtil.jumpCommonPage("FormInputPassword"); })); return; } else { PrintInfo("该卡已挂失,无法正常使用"); //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); return; } } } } dictionary = null; //银行卡 dictionary = BankBLL.ReadBankCard(); SysBLL.IcBankDictionary = dictionary; //if (SysBLL.payCostType == 3) //{ SysBLL.payCardType = 0; SysBLL.payCardNo = dictionary["cardNo"]; if (!pwdBLL.SetCryptMode(0)) { throw new Exception("系统异常,请稍后再试..."); //拉卡拉加密方式 } pwdBLL.closeKey(); //pwdBLL.OpenKeyboard(SysConfigHelper.readerNode("ZT598Port"), "9600", dictionary["cardNo"]); //if (!setPayParam("", dictionary, dictionary["cardNo"])) throw new Exception("查询失败"); if (!setPayParam("", dictionary, dictionary["cardNo"])) { return; } ; SysBLL.payTypeName = "银行卡"; this.Dispatcher.Invoke(new Action(() => { Util.JumpUtil.jumpCommonPage("FormInputPassword"); })); return; //} //else //{ // //退卡 // MachCardBLL.backCard(); // //等待用户插卡 // MachCardBLL.waitCard(); // PrintInfo("暂不支持此卡,请取卡"); //} } catch (ThreadAbortException ae) { log.Write("error:读卡失败:" + ae.Message); return; }catch (WtException we) { log.Write("error:读卡异常"); PrintInfo("读取失败"); //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); } catch (Exception ex) { log.Write("error:读卡异常:" + ex.Message); PrintInfo("读取失败"); //退卡 MachCardBLL.backCard(); //等待用户插卡 MachCardBLL.waitCard(); } finally { //btnOkBg.Enabled = true; } } }