コード例 #1
0
        internal static PaymentResult OnPayFundTransfer(String tellerNO, String orgNO, DateTime tradeDate, PayFundTransfer inputData, out String outmsg)
        {
            outmsg = "";
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayFundTransfer(tellerNO, orgNO, tradeDate, inputData, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, tellerNO, orgNO, (int)MessageBizType.PayFundTrans, codemsg, inputData.TransferFlowNo);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayFundTransferData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayFundTransferData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (retdata.RPData.RetCode == "00");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage,null);
                    resultdetail.HostReturnCode = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnCode,null);
                    resultdetail.HostTranFlowNo = CommonDataHelper.StrTrimer(retdata.RPData.HostTranFlowNo,null);
                    resultdetail.TransSeq = CommonDataHelper.StrTrimer(retdata.RPData.TransSeq, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage,null);
                    
                    if (retdata.RPData.RetCode == "00")
                    {
                        statecode = MsgLogState.RecvSucceed;
                    }
                    else if (retdata.RPData.RetCode == "02")
                    {
                        statecode = MsgLogState.PayTimeOut;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                //MQMsgCommonHelper.UpdateMQLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                OnUpdateDBLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
コード例 #2
0
 private void buttonFundTransfer_Click(object sender, EventArgs e)
 {
     PayFundTransfer data = new PayFundTransfer();
     data.Teller = textBoxTellerNO.Text.Trim();
     data.TransferFlowNo = textBoxFundFlowNO.Text.Trim();
     data.PayBank = textBoxOrgNO.Text.Trim();
     data.TranDate = DateTime.Now.ToString("yyyyMMdd");
     data.PayAccount = textBoxPayAccount.Text.Trim();
     data.PayAccountName = textBoxPayName.Text.Trim();
     data.RecAccount = textBoxRecAccount.Text.Trim();
     data.RecAccountName = textBoxRecName.Text.Trim();
     data.RecAccountBanks = textBoxRecBankNO.Text.Trim();
     data.PackageChannelType = textBoxChanelType.Text.Trim();
     //data.CurrencyType = textBoxCurrency.Text.Trim();
     data.PayAmount = textBoxTradeAmount.Text.Trim();
     //data.BizType = textBoxBizType.Text.Trim();
     data.Fee = textBoxFee.Text.Trim();
     data.Remark = textBoxRemark.Text.Trim();
     //data.ChannelId = textBoxChannelID.Text.Trim();
     data.PendingSN = textBoxPendingSN.Text.Trim();
     Guid messageID = MsgTransferUtility.PayFundTransfer(data.Teller, data.PayBank, DateTime.Now, data, ref uLongText);
     MessageData msgdata = new MessageData { MessageID = messageID, FirstTime = DateTime.Now, TragetPlatform = PlatformType.Payment };
     msgdata.ReqPackageList.Enqueue(new PackageData(1, uLongText));
     msgdata.IsMultiPackage = false;
     DispatchMsg(msgdata);
 }
コード例 #3
0
        /// <summary>
        /// 资金划拨
        /// </summary>
        /// <param name="tellerNO">柜员号</param>
        /// <param name="orgNO">机构号</param>
        /// <param name="tradeDate">交易日期</param>
        /// <param name="inputData">资金划拨输入数据对象</param>
        /// <param name="codemsg"></param>
        /// <returns></returns>
        public static Guid PayFundTransfer(String tellerNO, String orgNO, DateTime tradeDate, PayFundTransfer inputData, ref byte[] codemsg)
        {
            PayFundTransferData data = new PayFundTransferData();
            data.RQData.Teller = tellerNO;
            data.RQData.TransferFlowNo = inputData.TransferFlowNo;// CommonDataHelper.PadLeft4BizFlowNO(inputData.TransferFlowNo, '0', 18);
            data.RQData.PayBank = orgNO;
            data.RQData.TranDate = tradeDate.ToString("yyyyMMdd");
            data.RQData.PayAccount = inputData.PayAccount;
            data.RQData.PayAccountName = inputData.PayAccountName;
            if (string.IsNullOrEmpty(inputData.RecAccount))
            {
                inputData.RecAccount = "0";
            }
            data.RQData.RecAccount = inputData.RecAccount;
            data.RQData.RecAccountName = inputData.RecAccountName;
            data.RQData.RecAccountBanks = inputData.RecAccountBanks;
            data.RQData.PackageChannelType = inputData.PackageChannelType;
            data.RQData.CurrencyType = inputData.CurrencyType;
            data.RQData.PayAmount = inputData.PayAmount;
            data.RQData.BizType = inputData.BizType;
            data.RQData.Fee = inputData.Fee;
            data.RQData.Remark = inputData.Remark;
            data.RQData.ChannelId = inputData.ChannelId;
            data.RQData.PendingSN = inputData.PendingSN;

            return MsgTransfer.CodeMsgToBinary(data, ref codemsg);
        }
コード例 #4
0
 /// <summary>
 /// 资金划拨
 /// </summary>
 /// <param name="tellerNO">机构号</param>
 /// <param name="orgNO">柜员号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">输入信息的数据</param>
 /// <param name="result">返回结果的数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>成功与否</returns>
 public static bool PayFundTransfer(String tellerNO, String orgNO, DateTime tradeDate, PayFundTransfer inputData, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayFundTransfer(tellerNO, orgNO, tradeDate, inputData, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }
コード例 #5
0
 /// <summary>
 /// 资金划拨
 /// </summary>
 /// <param name="tellerNO">柜员号</param>
 /// <param name="orgNO">机构号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">资金划拨输入数据对象</param>
 /// <param name="codemsg"></param>
 /// <returns></returns>
 public static Guid PayFundTransfer(String tellerNO, String orgNO, DateTime tradeDate, PayFundTransfer inputData, ref byte[] codemsg)
 {
     PayFundTransferData data = new PayFundTransferData();
     data.RQData.Teller = tellerNO;
     data.RQData.TransferFlowNo = inputData.TransferFlowNo;// CommonDataHelper.PadLeft4BizFlowNO(inputData.TransferFlowNo, '0', 18);
     data.RQData.PayBank = orgNO;
     data.RQData.TranDate = tradeDate.ToString("yyyyMMdd");
     data.RQData.PayAccount = inputData.PayAccount;
     data.RQData.PayAccountName = inputData.PayAccountName;
     if (string.IsNullOrEmpty(inputData.RecAccount))
     {
         inputData.RecAccount = "0";
     }
     data.RQData.RecAccount = inputData.RecAccount;
     data.RQData.RecAccountName = inputData.RecAccountName;
     data.RQData.RecAccountBanks = inputData.RecAccountBanks;
     data.RQData.PackageChannelType = inputData.PackageChannelType;
     data.RQData.CurrencyType = inputData.CurrencyType;
     data.RQData.PayAmount = inputData.PayAmount;
     data.RQData.BizType = inputData.BizType;
     data.RQData.Fee = inputData.Fee;
     data.RQData.Remark = inputData.Remark;            
     data.RQData.ChannelId = inputData.ChannelId;
     data.RQData.PendingSN = inputData.PendingSN;
   
     try
     {
         return PreProcessPaymentMsg(data, ref codemsg);
     }
     catch (BizArgumentsException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw new Exception(MESSAGE_ENCODE_EXCEPTION, ex);
     }
 }