Example #1
0
        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);
        }
Example #2
0
        /// <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);
        }