Exemple #1
0
        public static RecallObject getRecall(string xml)
        {
            RecallObject recall = new RecallObject();

            recall.version   = getValue(xml, "version");
            recall.msgType   = getValue(xml, "msgType");
            recall.orderId   = getValue(xml, "reqOrdId");
            recall.orderTime = getValue(xml, "reqDate");
            recall.respDate  = getValue(xml, "respDate");
            recall.respType  = getValue(xml, "respType");
            recall.respCode  = getValue(xml, "respCode");
            recall.respMsg   = getValue(xml, "respMsg");
            return(recall);
        }
Exemple #2
0
        public static string getCallBack(RecallObject reCall)
        {
            string xml = "";

            xml  = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
            xml += "<merchant><head><version>";
            xml += "<![CDATA[" + reCall.version + "]]>";                           //版本号
            xml += "</version><msgType>";
            xml += "<![CDATA[" + reCall.msgType + "]]>";                           //支付方式1 支付宝 2 微信
            xml += "</msgType><reqDate>";
            xml += "<![CDATA[" + reCall.orderTime + "]]>";                         //订单时间
            xml += "</reqDate><respMsg>" + "<![CDATA[" + reCall.respMsg + "]]>";   //回执信息
            xml += "</respMsg><respType>" + "<![CDATA[" + reCall.respType + "]]>"; //消息提示类型
            xml += "</head><body><buyerId>";
            xml += "<![CDATA[" + reCall.buyerId + "]]>";                           //买方ID
            xml += "</buyerId><reqOrdId>";
            xml += "<![CDATA[" + reCall.reqOrdId + "]]>";                          //订单ID
            xml += "</reqOrdId><totalAmount>";
            xml += "<![CDATA[" + reCall.totalAmount + "]]>";                       //金额
            xml += "</totalAmount></body></merchant>";
            return(xml);
        }