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; } }
//查询 private void query() { try { UnicomQueryInfo info = UnicomAccess.query(Payment.unicomPayParam.PhoneOn); if (!"0000".Equals(info.msgrsp.retcode)) { if (info.msgrsp.retshow.Length > 0) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), info.msgrsp.retshow); return; } else { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); return; } } Payment.unicomPayParam.Msgrsp = info.msgrsp; Payment.unicomPayParam.AccountNo = info.msgrsp.ACCOUNT_NO; //显示电话号码 this.lblBalance.Dispatcher.Invoke(new balanceDelegate(setBalanceText), Payment.unicomPayParam.PhoneOn); //显示当月消费金额 this.lblAmount.Dispatcher.Invoke(new amountDelegate(setAmountText), info.msgrsp.PRESENT_AMOUNT); //账户余额 this.lblyue.Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), this.lblyue, info.msgrsp.PAYMENT_AMOUNT); //显示面板 this.panel.Dispatcher.Invoke(new panelShowDelegate(setPanelVisibility), true); //显示充值按钮 this.OkBtn.Dispatcher.Invoke(new isShowBtnDelegate(setBtnVisibility), OkBtn, true); //提示信息 lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "您的话费信息"); SysBLL.Player("继续充值请点积确定按钮.wav"); } catch (WtException wte) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); } catch (Exception e) { lblAccountInfo.Dispatcher.Invoke(new showInfoDelegate(setShowInfo), "查询失败,请稍后再试"); log.Write("error:FormUnicomStep02:query():" + e.Message); } finally { //隐藏动态图片 loadlbl.Dispatcher.Invoke(new isShowLabelDelegate(isShowLabel), loadlbl, false); } }