Exemplo n.º 1
0
        public string BuildRegisterUrl(string Acccount, object OtherInfo)
        {
            SystemOptions so = new SystemOptions();

            string gateway        = so["MemberRegister_Alipay_Gateway"].ToString("");
            string service        = "create_member";
            string partner        = so["MemberRegister_Alipay_UserNumber"].ToString(""); //卖家商户号
            string Key            = so["MemberRegister_Alipay_MD5"].ToString("");
            string sign_type      = "MD5";
            string _input_charset = "utf-8";

            if ((gateway == "") || (partner == "") || (Key == ""))
            {
                return("");
            }

            string return_url   = Shove._Web.Utility.GetUrl() + "/AlipayMemberReceive/RegReceive.aspx";
            string email        = Acccount;
            string cert_type    = "";
            string cert_no      = "";
            string company_name = "";
            string account_type = "";
            string other_info   = OtherInfo.ToString();

            Utility utility = new Utility();

            if (PF.AlipayAccountRegisterPid != "")
            {
                return(utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "email", email, "cert_type", cert_type, "cert_no",
                                         cert_no, "company_name", company_name, "account_type", account_type, "other_info", other_info, "return_url", return_url, "id", PF.AlipayAccountRegisterPid));
            }
            else
            {
                return(utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "email", email, "cert_type", cert_type, "cert_no",
                                         cert_no, "company_name", company_name, "account_type", account_type, "other_info", other_info, "return_url", return_url));
            }
        }
Exemplo n.º 2
0
    protected void AlipayPay(string defaultbank)
    {
        Alipay.Gateway.Utility ap = new Alipay.Gateway.Utility();
        string aliay_url          = "";

        partner = so["OnlinePay_Alipay_UserNumber"].ToString("");  //卖家商户号
        key     = so["OnlinePay_Alipay_MD5Key"].ToString("");


        aliay_url = ap.Createurl(
            gateway,
            service,
            partner,
            key,
            sign_type,
            _input_charset,
            "return_url",
            return_url,
            "notify_url",
            notify_url,
            "out_trade_no",
            out_trade_no,
            "subject",
            subject,
            "payment_type",
            payment_type,
            "total_fee",
            total_fee,
            "seller_email",
            seller_email,
            "body",
            body,
            "show_url",
            show_url,
            "defaultbank",
            defaultbank,
            "paymethod",
            paymethod
            );

        if (aliay_url == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "地址构建出现错误");

            return;
        }

        this.Response.Write("<script language='javascript'>window.top.location.href='" + aliay_url + "'</script>");
    }
Exemplo n.º 3
0
 protected void AlipayPay(string defaultbank)
 {
     Alipay.Gateway.Utility utility = new Alipay.Gateway.Utility();
     string str = "";
     this.partner = this.so["OnlinePay_Alipay_UserNumber"].ToString("");
     this.key = this.so["OnlinePay_Alipay_MD5Key"].ToString("");
     str = utility.Createurl(this.gateway, this.service, this.partner, this.key, this.sign_type, this._input_charset, new string[] {
         "return_url", this.return_url, "notify_url", this.notify_url, "out_trade_no", this.out_trade_no, "subject", this.subject, "payment_type", this.payment_type, "total_fee", this.total_fee, "seller_email", this.seller_email, "body", this.body,
         "show_url", this.show_url, "defaultbank", defaultbank, "paymethod", this.paymethod
      });
     if (str == "")
     {
         JavaScript.Alert(this.Page, "地址构建出现错误");
     }
     else
     {
         base.Response.Write("<script language='javascript'>window.top.location.href='" + str + "'</script>");
     }
 }
Exemplo n.º 4
0
    protected void BankClick(string bankPay)
    {
        Alipay.Gateway.Utility utility = new Alipay.Gateway.Utility();
        string str = "";

        this.partner = this.so["OnlinePay_Alipay_UserNumber1"].ToString("");
        this.key     = this.so["OnlinePay_Alipay_MD5Key1"].ToString("");
        str          = utility.Createurl(this.gateway, this.service, this.partner, this.key, this.sign_type, this._input_charset, new string[] {
            "return_url", this.return_url, "notify_url", this.notify_url, "out_trade_no", this.out_trade_no, "subject", this.subject, "payment_type", this.payment_type, "total_fee", this.total_fee, "seller_email", this.seller_email, "body", this.body,
            "defaultbank", bankPay, "paymethod", this.paymethod
        });
        if (str == "")
        {
            JavaScript.Alert(this.Page, "地址构建出现错误");
        }
        else
        {
            base.Response.Write("<script language='javascript'>window.top.location.href='" + str + "'</script>");
        }
    }
Exemplo n.º 5
0
        public int Query(string PayType, string PaymentNumber, ref string AlipayPaymentNumber, ref string ReturnDescription)
        {
            SystemOptions so = new SystemOptions();

            string gateway        = so["QueryAddMoney_Alipay_Gateway"].ToString("");
            string service        = "single_trade_query";
            string partner        = ""; //卖家商户号
            string Key            = "";
            string _input_charset = "utf-8";
            string sign_type      = "MD5";

            if (PayType == "ALIPAY_alipay")
            {
                partner = so["OnlinePay_Alipay_UserNumber"].ToString("");  //卖家商户号
                Key     = so["OnlinePay_Alipay_MD5Key"].ToString("");
            }
            else
            {
                partner = so["OnlinePay_Alipay_UserNumber1"].ToString("");  //卖家商户号
                Key     = so["OnlinePay_Alipay_MD5Key1"].ToString("");
            }

            if ((gateway == "") || (partner == "") || (Key == ""))
            {
                ReturnDescription = "系统设置信息错误";

                return(-1);
            }

            Utility utility = new Utility();

            string aliay_url = utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "out_trade_no", PaymentNumber);

            string AlipayResult = "";

            try
            {
                AlipayResult = PF.GetHtml(aliay_url, "utf-8", 120);
            }
            catch
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return(-2);
            }

            if (string.IsNullOrEmpty(AlipayResult))
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return(-3);
            }

            XmlDocument XmlDoc = new XmlDocument();

            try
            {
                XmlDoc.Load(new StringReader(AlipayResult));
            }
            catch
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return(-4);
            }

            System.Xml.XmlNodeList nodesIs_success = XmlDoc.GetElementsByTagName("is_success");

            if ((nodesIs_success == null) || (nodesIs_success.Count < 1))
            {
                ReturnDescription = "查询信息获取异常,请重新查询";

                return(-5);
            }

            string is_success = nodesIs_success[0].InnerText;

            if (is_success.ToUpper() != "T")
            {
                ReturnDescription = "该支付记录未支付成功";

                return(-6);
            }

            System.Xml.XmlNodeList nodesTrade_no = XmlDoc.GetElementsByTagName("trade_no");

            if ((nodesTrade_no == null) || (nodesTrade_no.Count < 1))
            {
                ReturnDescription = "没有对应的支付信息";

                return(-7);
            }

            AlipayPaymentNumber = nodesTrade_no[0].InnerText;

            System.Xml.XmlNodeList nodesTrade_Status = XmlDoc.GetElementsByTagName("trade_status");

            if ((nodesTrade_Status == null) || (nodesTrade_Status.Count < 1))
            {
                ReturnDescription = "没有对应的支付信息";

                return(-8);
            }

            string Trade_Status = nodesTrade_Status[0].InnerText.ToUpper();

            if (Trade_Status == "WAIT_BUYER_PAY")
            {
                ReturnDescription = "等待买家付款";

                return(-9);
            }

            if (Trade_Status == "WAIT_SELLER_SEND_GOODS")
            {
                ReturnDescription = "买家付款成功(担保交易,未确定支付给商家)";

                return(-10);
            }

            if (Trade_Status == "WAIT_BUYER_CONFIRM_GOODS")
            {
                ReturnDescription = "卖家发货成功(未确定支付给商家)";

                return(-11);
            }

            if (Trade_Status == "TRADE_CLOSED")
            {
                ReturnDescription = "交易被关闭,未成功付款";

                return(-12);
            }

            if (Trade_Status != "TRADE_FINISHED" && Trade_Status != "TRADE_SUCCESS")
            {
                ReturnDescription = "其他未成功支付的错误";

                return(-9999);
            }

            return(0);
        }
Exemplo n.º 6
0
    protected void AlipayPay(string defaultbank)
    {
        Alipay.Gateway.Utility ap = new Alipay.Gateway.Utility();
        string aliay_url = "";

        partner = so["OnlinePay_Alipay_UserNumber"].ToString("");  //卖家商户号
        key = so["OnlinePay_Alipay_MD5Key"].ToString("");


        aliay_url = ap.Createurl(
                gateway,
                service,
                partner,
                key,
                sign_type,
                _input_charset,
                "return_url",
                return_url,
                "notify_url",
                notify_url,
                "out_trade_no",
                out_trade_no,
                "subject",
                subject,
                "payment_type",
                payment_type,
                "total_fee",
                total_fee,
                "seller_email",
                seller_email,
                "body",
                body,
                "show_url",
                show_url,
                "defaultbank",
                defaultbank,
                "paymethod",
                paymethod
                );

        if (aliay_url == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "地址构建出现错误");

            return;
        }

        this.Response.Write("<script language='javascript'>window.top.location.href='" + aliay_url + "'</script>");
    }
Exemplo n.º 7
0
        public long Query(string Account, ref string RealityName)
        {
            SystemOptions so = new SystemOptions();

            string gateway = so["MemberRegister_Alipay_Gateway"].ToString("");
            string service = "user_query";
            string partner = so["MemberRegister_Alipay_UserNumber"].ToString("");  //卖家商户号
            string Key = so["MemberRegister_Alipay_MD5"].ToString("");
            string _input_charset = "utf-8";
            string sign_type = "MD5";

            if ((gateway == "") || (partner == "") || (Key == ""))
            {
                return -1;
            }

            Utility utility = new Utility();

            string aliay_url = utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "email", Account);

            string AlipayResult = "";

            try
            {
                AlipayResult = PF.GetHtml(aliay_url, "utf-8", 20);
            }
            catch
            {
                return -2;
            }

            if (string.IsNullOrEmpty(AlipayResult))
            {
                return -3;
            }

            XmlDocument XmlDoc = new XmlDocument();

            try
            {
                XmlDoc.Load(new StringReader(AlipayResult));
            }
            catch
            {
                return -4;
            }

            System.Xml.XmlNodeList nodesIs_success = XmlDoc.GetElementsByTagName("is_success");

            if ((nodesIs_success == null) || (nodesIs_success.Count < 1))
            {
                return -5;
            }

            string is_success = nodesIs_success[0].InnerText;

            if (is_success.ToUpper() != "T")
            {
                return -6;
            }

            System.Xml.XmlNodeList nodesUserID = XmlDoc.GetElementsByTagName("user_id");

            if ((nodesUserID == null) || (nodesUserID.Count < 1))
            {
                return -7;
            }

            System.Xml.XmlNodeList nodesUserRealityName = XmlDoc.GetElementsByTagName("real_name");

            if ((nodesUserRealityName != null) && (nodesUserRealityName.Count >= 1))
            {
                RealityName = nodesUserRealityName[0].InnerText;
            }
            else
            {
                RealityName = "";
            }

            return Shove._Convert.StrToLong(nodesUserID[0].InnerText, -8);
        }
Exemplo n.º 8
0
        public long Query(string Account, ref string RealityName)
        {
            SystemOptions so = new SystemOptions();

            string gateway        = so["MemberRegister_Alipay_Gateway"].ToString("");
            string service        = "user_query";
            string partner        = so["MemberRegister_Alipay_UserNumber"].ToString(""); //卖家商户号
            string Key            = so["MemberRegister_Alipay_MD5"].ToString("");
            string _input_charset = "utf-8";
            string sign_type      = "MD5";

            if ((gateway == "") || (partner == "") || (Key == ""))
            {
                return(-1);
            }

            Utility utility = new Utility();

            string aliay_url = utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "email", Account);

            string AlipayResult = "";

            try
            {
                AlipayResult = PF.GetHtml(aliay_url, "utf-8", 20);
            }
            catch
            {
                return(-2);
            }

            if (string.IsNullOrEmpty(AlipayResult))
            {
                return(-3);
            }

            XmlDocument XmlDoc = new XmlDocument();

            try
            {
                XmlDoc.Load(new StringReader(AlipayResult));
            }
            catch
            {
                return(-4);
            }

            System.Xml.XmlNodeList nodesIs_success = XmlDoc.GetElementsByTagName("is_success");

            if ((nodesIs_success == null) || (nodesIs_success.Count < 1))
            {
                return(-5);
            }

            string is_success = nodesIs_success[0].InnerText;

            if (is_success.ToUpper() != "T")
            {
                return(-6);
            }

            System.Xml.XmlNodeList nodesUserID = XmlDoc.GetElementsByTagName("user_id");

            if ((nodesUserID == null) || (nodesUserID.Count < 1))
            {
                return(-7);
            }

            System.Xml.XmlNodeList nodesUserRealityName = XmlDoc.GetElementsByTagName("real_name");

            if ((nodesUserRealityName != null) && (nodesUserRealityName.Count >= 1))
            {
                RealityName = nodesUserRealityName[0].InnerText;
            }
            else
            {
                RealityName = "";
            }

            return(Shove._Convert.StrToLong(nodesUserID[0].InnerText, -8));
        }
Exemplo n.º 9
0
        public int Query(string PayType, string PaymentNumber, ref string AlipayPaymentNumber, ref string ReturnDescription)
        {
            SystemOptions so = new SystemOptions();

            string gateway = so["QueryAddMoney_Alipay_Gateway"].ToString("");
            string service = "single_trade_query";
            string partner = "";  //卖家商户号
            string Key = "";
            string _input_charset = "utf-8";
            string sign_type = "MD5";

            if (PayType == "ALIPAY_alipay")
            {
                partner = so["OnlinePay_Alipay_UserNumber"].ToString("");  //卖家商户号
                Key = so["OnlinePay_Alipay_MD5Key"].ToString("");
            }
            else
            {
                partner = so["OnlinePay_Alipay_UserNumber1"].ToString("");  //卖家商户号
                Key = so["OnlinePay_Alipay_MD5Key1"].ToString("");
            }

            if ((gateway == "") || (partner == "") || (Key == ""))
            {
                ReturnDescription = "系统设置信息错误";

                return -1;
            }

            Utility utility = new Utility();

            string aliay_url = utility.Createurl(gateway, service, partner, Key, sign_type, _input_charset, "out_trade_no", PaymentNumber);

            string AlipayResult = "";

            try
            {
                AlipayResult = PF.GetHtml(aliay_url, "utf-8", 120);
            }
            catch
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return -2;
            }

            if (string.IsNullOrEmpty(AlipayResult))
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return -3;
            }

            XmlDocument XmlDoc = new XmlDocument();

            try
            {
                XmlDoc.Load(new StringReader(AlipayResult));
            }
            catch
            {
                ReturnDescription = "数据获取异常,请重新审核";

                return -4;
            }

            System.Xml.XmlNodeList nodesIs_success = XmlDoc.GetElementsByTagName("is_success");

            if ((nodesIs_success == null) || (nodesIs_success.Count < 1))
            {
                ReturnDescription = "查询信息获取异常,请重新查询";

                return -5;
            }

            string is_success = nodesIs_success[0].InnerText;

            if (is_success.ToUpper() != "T")
            {
                ReturnDescription = "该支付记录未支付成功";

                return -6;
            }

            System.Xml.XmlNodeList nodesTrade_no = XmlDoc.GetElementsByTagName("trade_no");

            if ((nodesTrade_no == null) || (nodesTrade_no.Count < 1))
            {
                ReturnDescription = "没有对应的支付信息";

                return -7;
            }

            AlipayPaymentNumber = nodesTrade_no[0].InnerText;

            System.Xml.XmlNodeList nodesTrade_Status = XmlDoc.GetElementsByTagName("trade_status");

            if ((nodesTrade_Status == null) || (nodesTrade_Status.Count < 1))
            {
                ReturnDescription = "没有对应的支付信息";

                return -8;
            }

            string Trade_Status = nodesTrade_Status[0].InnerText.ToUpper();

            if (Trade_Status == "WAIT_BUYER_PAY")
            {
                ReturnDescription = "等待买家付款";

                return -9;
            }

            if (Trade_Status == "WAIT_SELLER_SEND_GOODS")
            {
                ReturnDescription = "买家付款成功(担保交易,未确定支付给商家)";

                return -10;
            }

            if (Trade_Status == "WAIT_BUYER_CONFIRM_GOODS")
            {
                ReturnDescription = "卖家发货成功(未确定支付给商家)";

                return -11;
            }

            if (Trade_Status == "TRADE_CLOSED")
            {
                ReturnDescription = "交易被关闭,未成功付款";

                return -12;
            }

            if (Trade_Status != "TRADE_FINISHED" && Trade_Status != "TRADE_SUCCESS")
            {
                ReturnDescription = "其他未成功支付的错误";

                return -9999;
            }

            return 0;
        }