Exemple #1
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");

            request.Method      = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            byte[] bytes = HttpContext.Current.Request.BinaryRead(HttpContext.Current.Request.ContentLength);
            string str2  = Encoding.ASCII.GetString(bytes) + "&cmd=_notify-validate";

            request.ContentLength = str2.Length;
            StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.ASCII);

            writer.Write(str2);
            writer.Close();
            StreamReader reader = new StreamReader(request.GetResponse().GetResponseStream());
            string       str3   = reader.ReadToEnd();

            reader.Close();
            string str4 = this.parameters["payment_status"];

            if ((str3 == "VERIFIED") && str4.Equals("Completed"))
            {
                this.OnPaidToMerchant();
            }
            else
            {
                this.OnNotifyVerifyFaild();
            }
        }
Exemple #2
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string text1 = this.parameters["mercode"];
            string str   = this.parameters["billno"];
            string str2  = this.parameters["amount"];
            string str3  = this.parameters["date"];
            string str4  = this.parameters["ipsbillno"];
            string str5  = this.parameters["succ"];
            string str6  = this.parameters["retEncodeType"];
            string text2 = this.parameters["msg"];
            string str7  = this.parameters["currency_type"];
            string text3 = this.parameters["attach"];
            string str8  = this.parameters["signature"];

            if ((((str == null) || (str2 == null)) || ((str3 == null) || (str4 == null))) || (((str5 == null) || (str6 == null)) || ((str7 == null) || (str8 == null))))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!str5.Equals("Y"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                string password = str + str2 + str3 + str5 + str4 + str7 + payee.PrimaryKey;
                if (!str8.Equals(FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower(CultureInfo.InvariantCulture)))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #3
0
 public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
 {
     this.Merchant = this.parameters["Merchant"];
     this.BillNo   = this.parameters["BillNo"];
     this.Amount   = this.parameters["Amount"];
     this.Success  = this.parameters["Success"];
     this.Remark   = this.parameters["Remark"];
     this.Sign     = this.parameters["Sign"];
     if ((((this.Merchant == null) || (this.BillNo == null)) || ((this.Amount == null) || (this.Success == null))) || ((this.Remark == null) || (this.Sign == null)))
     {
         this.OnNotifyVerifyFaild();
     }
     else if (!this.Success.Equals("Y"))
     {
         this.OnNotifyVerifyFaild();
     }
     else
     {
         string password = this.Merchant + this.BillNo + this.Amount + this.Remark + this.Success + payee.PrimaryKey;
         if (!this.Sign.Equals(FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower(CultureInfo.InvariantCulture)))
         {
             this.OnNotifyVerifyFaild();
         }
         else
         {
             this.OnPaidToMerchant();
         }
     }
 }
Exemple #4
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string str  = this.parameters["merchant"];
            string str2 = this.parameters["billno"];
            string str3 = this.parameters["v_pstring"];
            string str4 = this.parameters["amount"];
            string str5 = this.parameters["success"];
            string str6 = this.parameters["remark"];
            string str7 = this.parameters["sign"];

            if ((((str == null) || (str2 == null)) || ((str3 == null) || (str4 == null))) || (((str5 == null) || (str6 == null)) || (str7 == null)))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!str5.Equals("Y"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                string password = str + str2 + str4 + str5 + payee.PrimaryKey;
                if (!str7.Equals(FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5").ToLower(CultureInfo.InvariantCulture)))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #5
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string sCmd       = this.parameters["r0_Cmd"];
            string merchantId = this.parameters["p1_MerId"];
            string sErrorCode = this.parameters["r1_Code"];
            string sTrxId     = this.parameters["r2_TrxId"];
            string amount     = this.parameters["r3_Amt"];
            string cur        = this.parameters["r4_Cur"];
            string productId  = this.parameters["r5_Pid"];
            string orderId    = this.parameters["r6_Order"];
            string userId     = this.parameters["r7_Uid"];
            string mp         = this.parameters["r8_MP"];
            string bType      = this.parameters["r9_BType"];
            string hmac       = this.parameters["hmac"];

            if (sErrorCode != "1")
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!Buy.VerifyCallback(merchantId, payee.PrimaryKey, sCmd, sErrorCode, sTrxId, amount, cur, productId, orderId, userId, mp, bType, hmac))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                this.OnPaidToMerchant();
            }
        }
Exemple #6
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string str  = this.parameters["v_oid"];
            string str2 = this.parameters["v_pstatus"];
            string str3 = this.parameters["v_pstring"];
            string str4 = this.parameters["v_pmode"];
            string str5 = this.parameters["v_md5str"];
            string str6 = this.parameters["v_amount"];
            string str7 = this.parameters["v_moneytype"];
            string str8 = this.parameters["remark1"];

            if ((((str == null) || (str2 == null)) || ((str3 == null) || (str4 == null))) || (((str5 == null) || (str6 == null)) || ((str8 == null) || (str7 == null))))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!str2.Equals("20"))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!str5.Equals(FormsAuthentication.HashPasswordForStoringInConfigFile(str + str2 + str6 + str7 + payee.PrimaryKey, "MD5").ToUpper(CultureInfo.InvariantCulture)))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                this.OnPaidToMerchant();
            }
        }
Exemple #7
0
        public WeChatRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
        {
            if (gateway.DataList == null)
            {
                throw new ArgumentNullException("GATEWAYINFO:DATALIST IS NULL");
            }
            if (gateway.DataList.Count < 4)
            {
                throw new ArgumentNullException("GATEWAYINFO:DATALIST NO APPID|DATALIST.COUNT:" + gateway.DataList.Count);
            }

            this.appid   = gateway.DataList[3];
            this.token   = trade.Token;
            this.key     = payee.PrimaryKey;
            this.partner = payee.SellerAccount;
            //this.time_start = trade.Date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture);
            //this.body = Core.Globals.SubString(trade.Body, 62, "..");         //String(64)
            //this.body = trade.Subject;         //String(64)
            this.body         = trade.Body;
            this.out_trade_no = trade.OrderId;
            this.return_url   = gateway.ReturnUrl;
            this.notify_url   = gateway.NotifyUrl;
            this.total_fee    = Convert.ToInt32((decimal)(trade.TotalMoney * 100M)).ToString(CultureInfo.InvariantCulture);

            this.gatewayInfo = gateway;
        }
Exemple #8
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string str  = this.parameters["v_date"];
            string str2 = this.parameters["v_mid"];
            string str3 = this.parameters["v_oid"];
            string str4 = this.parameters["v_amount"];
            string str5 = this.parameters["v_status"];
            string str6 = this.parameters["v_md5"];

            if ((((str == null) || (str2 == null)) || ((str3 == null) || (str4 == null))) || ((str5 == null) || (str6 == null)))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!str5.Equals("00"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                string str7 = FormsAuthentication.HashPasswordForStoringInConfigFile(str + str2 + str3 + str4 + str5 + payee.PrimaryKey, "MD5").ToLower(CultureInfo.InvariantCulture);
                if (!str6.Equals(str7))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #9
0
        private void DoValidate()
        {
            PayConfiguration    config     = PayConfiguration.GetConfig();
            NameValueCollection parameters = new NameValueCollection();

            parameters.Add(this.Page.Request.Form);
            parameters.Add(this.Page.Request.QueryString);
            string tmpGatewayName = this.Page.Request.QueryString[Globals.GATEWAY_KEY];

            if (string.IsNullOrEmpty(tmpGatewayName))
            {
                this.ResponseStatus(true, "gatewaynotfound");
                return;
            }
            this.GatewayName = tmpGatewayName.ToLower();
            GatewayProvider provider = config.Providers[this.GatewayName] as GatewayProvider;

            if (provider == null)
            {
                this.ResponseStatus(true, "gatewaynotfound");
                return;
            }
            this.Notify = NotifyQuery.Instance(provider.NotifyType, parameters);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath(string.Format(Globals.PAYMENT_RETURN_URL, this.GatewayName));
            }
            this.RechargeId      = long.Parse(this.Notify.GetOrderId(), CultureInfo.InvariantCulture);
            this.Amount          = this.Notify.GetOrderAmount();
            this.RechargeRequest = PaymentModeManage.GetRechargeRequest(this.RechargeId);
            if (this.RechargeRequest == null)
            {
                this.ResponseStatus(true, "success");
            }
            else
            {
                this.Amount  = this.RechargeRequest.RechargeBlance;
                this.paymode = PaymentModeManage.GetPaymentModeByName(this.RechargeRequest.PaymentGateway);
                if (this.paymode == null)
                {
                    this.ResponseStatus(true, "gatewaynotfound");
                }
                else
                {
                    PayeeInfo payee = new PayeeInfo
                    {
                        EmailAddress  = this.paymode.EmailAddress,
                        Partner       = this.paymode.Partner,
                        Password      = this.paymode.Password,
                        PrimaryKey    = this.paymode.SecretKey,
                        SecondKey     = this.paymode.SecondKey,
                        SellerAccount = this.paymode.MerchantCode
                    };
                    this.Notify.PaidToIntermediary += new NotifyEventHandler(this.notify_PaidToIntermediary);
                    this.Notify.PaidToMerchant     += new NotifyEventHandler(this.notify_PaidToMerchant);
                    this.Notify.NotifyVerifyFaild  += new NotifyEventHandler(this.notify_NotifyVerifyFaild);
                    this.Notify.VerifyNotify(0x7530, payee);
                }
            }
        }
Exemple #10
0
        private string defaultbank = "CMB"; //默认招商银行

        public AlipayBankRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
        {
            this.partner      = payee.SellerAccount;
            this.key          = payee.PrimaryKey;
            this.seller_email = payee.EmailAddress;
            this.body         = trade.Body;
            this.out_trade_no = trade.OrderId;
            this.subject      = trade.Subject;
            this.total_fee    = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
            this.return_url   = gateway.ReturnUrl;
            this.notify_url   = gateway.NotifyUrl;
            this.show_url     = trade.Showurl;
            this.token        = trade.Token;

            if (gateway.DataList != null && gateway.DataList.Count >= 4)
            {
                /**
                 * Handlers.Shop.Pay.SendPaymentHandler
                 * 发起支付前先给用户一个选择银行的页面, 可利用现有的提交订单成功页面加入针对不同网关开启银行卡选择的功能
                 * VerifySendPayment方法中加入判断 paymentMode.Gateway == "alipaybank"
                 * 如果是alipaybank向网关[GatewayDatas]加入选择的银行编码
                 * this.GatewayDatas.Add(area); 代码后加入 this.GatewayDatas.Add([SelectBankCode]);
                 */
                this.defaultbank = gateway.DataList[3];
            }
        }
Exemple #11
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string str   = this._parameters["Amount"];
            string str2  = this._parameters["PayAmount"];
            string str3  = this._parameters["OrderNo"];
            string str4  = this._parameters["SerialNo"];
            string str5  = this._parameters["Status"];
            string str6  = this._parameters["MerchantNo"];
            string str7  = this._parameters["PayChannel"];
            string str8  = this._parameters["Discount"];
            string str9  = this._parameters["SignType"];
            string str10 = this._parameters["PayTime"];
            string str11 = this._parameters["CurrencyType"];
            string str12 = this._parameters["ProductNo"];
            string str13 = this._parameters["ProductDesc"];
            string str14 = this._parameters["Remark1"];
            string str15 = this._parameters["Remark2"];
            string str16 = this._parameters["ExInfo"];
            string str17 = this._parameters["MAC"];
            string str19 = FormsAuthentication.HashPasswordForStoringInConfigFile((str + "|" + str2 + "|" + str3 + "|" + str4 + "|" + str5 + "|" + str6 + "|" + str7 + "|" + str8 + "|" + str9 + "|" + str10 + "|" + str11 + "|" + str12 + "|" + str13 + "|" + str14 + "|" + str15 + "|" + str16) + "|" + payee.PrimaryKey, "MD5");

            if ((str5 != "01") || (str17 != str19))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                this.OnPaidToMerchant();
            }
        }
Exemple #12
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            this.parameters["key"] = payee.PrimaryKey;
            string notify_id      = this.parameters["notify_id"];      //通知id
            string partner        = this.parameters["partner"];        //商户号
            string trade_state    = this.parameters["trade_state"];    //支付结果
            string transaction_id = this.parameters["transaction_id"]; //财付通订单号
            string total_fee      = this.parameters["total_fee"];      //金额,以分为单位
            string out_trade_no   = this.parameters["out_trade_no"];   //商户订单号
            string trade_mode     = this.parameters["trade_mode"];     //交易模式,1即时到账,2中介担保
            string attach         = this.parameters["attach"];


            if ((((notify_id == null) || (partner == null) || (trade_state == null)) || ((transaction_id == null) ||
                                                                                         (total_fee == null))) || (((out_trade_no == null) || (trade_mode == null)) || (attach == null)))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!trade_mode.Equals("1") || !trade_state.Equals("0"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                if (!Globals.isTenpaySign(this.parameters, "utf-8"))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #13
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            this.parameters["key"] = payee.PrimaryKey;
            string notify_id   = this.parameters["notify_id"];   //通知id
            string partner     = this.parameters["partner"];     //商户号
            string trade_state = this.parameters["trade_state"]; //支付结果

            /**
             * 0付款成功
             * 1交易创建
             * 2收获地址填写完毕
             * 4卖家发货成功
             * 5买家收货确认,交易成功
             * 6交易关闭,未完成超时关闭
             * 7修改交易价格成功
             * 8买家发起退款
             * 9退款成功
             * 10退款关闭
             */
            string transaction_id = this.parameters["transaction_id"]; //财付通订单号
            string total_fee      = this.parameters["total_fee"];      //金额,以分为单位
            string out_trade_no   = this.parameters["out_trade_no"];   //商户订单号
            string trade_mode     = this.parameters["trade_mode"];     //交易模式,1即时到账,2中介担保

            string attach = this.parameters["attach"];

            this.parameters.Remove(Core.Globals.GATEWAY_KEY);

            if ((((notify_id == null) || (partner == null) || (trade_state == null)) || ((transaction_id == null) ||
                                                                                         (total_fee == null))) || (((out_trade_no == null) || (trade_mode == null)) || (attach == null)))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (trade_mode != "1" && trade_mode != "2")
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                if (Globals.isTenpaySign(this.parameters, "utf-8"))
                {
                    if (trade_mode == "1" && trade_state == "0")
                    {
                        this.OnPaidToMerchant();
                        return;
                    }
                    if (trade_mode == "2" && trade_state == "0")
                    {
                        this.OnPaidToIntermediary();
                        return;
                    }
                    if (trade_mode == "2" && trade_state == "5")
                    {
                        this.OnPaidToMerchant();
                        return;
                    }
                }
                this.OnNotifyVerifyFaild();
            }
        }
Exemple #14
0
 public PaypalRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.amount      = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.invoice     = trade.OrderId;
     this.item_number = trade.OrderId;
     this.return_url  = gateway.ReturnUrl;
     this.business    = payee.SellerAccount;
 }
Exemple #15
0
 public IpsExpressRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.Merchant    = payee.SellerAccount;
     this.BillNo      = trade.OrderId;
     this.Amount      = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.BackUrl     = gateway.ReturnUrl;
     this.MerPassword = payee.PrimaryKey;
 }
Exemple #16
0
 public ChinabankRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.v_oid    = trade.OrderId;
     this.v_amount = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.v_url    = gateway.ReturnUrl;
     this.v_mid    = payee.SellerAccount;
     this.key      = payee.PrimaryKey;
 }
Exemple #17
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            string paramValue = this.parameters["merchantAcctId"];
            string str2       = this.parameters["version"];
            string str3       = this.parameters["language"];
            string str4       = this.parameters["signType"];
            string str5       = this.parameters["payType"];
            string str6       = this.parameters["bankId"];
            string str7       = this.parameters["orderId"];
            string str8       = this.parameters["orderTime"];
            string str9       = this.parameters["orderAmount"];
            string str10      = this.parameters["dealId"];
            string str11      = this.parameters["bankDealId"];
            string str12      = this.parameters["dealTime"];
            string str13      = this.parameters["payAmount"];
            string str14      = this.parameters["fee"];
            string str15      = this.parameters["ext1"];
            string str16      = this.parameters["ext2"];
            string str17      = this.parameters["payResult"];
            string str18      = this.parameters["errCode"];
            string str19      = this.parameters["signMsg"].ToUpper();

            if (!str17.Equals("10"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                string returnStr = "";
                returnStr = this.appendParam(returnStr, "merchantAcctId", paramValue);
                returnStr = this.appendParam(returnStr, "version", str2);
                returnStr = this.appendParam(returnStr, "language", str3);
                returnStr = this.appendParam(returnStr, "signType", str4);
                returnStr = this.appendParam(returnStr, "payType", str5);
                returnStr = this.appendParam(returnStr, "bankId", str6);
                returnStr = this.appendParam(returnStr, "orderId", str7);
                returnStr = this.appendParam(returnStr, "orderTime", str8);
                returnStr = this.appendParam(returnStr, "orderAmount", str9);
                returnStr = this.appendParam(returnStr, "dealId", str10);
                returnStr = this.appendParam(returnStr, "bankDealId", str11);
                returnStr = this.appendParam(returnStr, "dealTime", str12);
                returnStr = this.appendParam(returnStr, "payAmount", str13);
                returnStr = this.appendParam(returnStr, "fee", str14);
                returnStr = this.appendParam(returnStr, "ext1", str15);
                returnStr = this.appendParam(returnStr, "ext2", str16);
                returnStr = this.appendParam(returnStr, "payResult", str17);
                returnStr = this.appendParam(returnStr, "errCode", str18);
                string str21 = FormsAuthentication.HashPasswordForStoringInConfigFile(this.appendParam(returnStr, "key", payee.PrimaryKey), "MD5").ToUpper();
                if (!str19.Equals(str21))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #18
0
 public AllbuyRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.merchant = payee.SellerAccount;
     this.key      = payee.PrimaryKey;
     this.BillNo   = trade.OrderId;
     this.Amount   = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.Date     = Convert.ToDateTime(trade.Date).ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo);
     this.BackUrl  = gateway.ReturnUrl;
 }
Exemple #19
0
 public CncardRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.c_order       = trade.OrderId;
     this.c_orderamount = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.c_ymd         = Convert.ToDateTime(trade.Date).ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo);
     this.c_returl      = gateway.ReturnUrl;
     this.c_mid         = payee.SellerAccount;
     this.c_pass        = payee.PrimaryKey;
 }
Exemple #20
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            bool flag;

            try
            {
                flag = bool.Parse(this.GetResponse(this.CreateUrl(payee), timeout));
            }
            catch
            {
                flag = false;
            }
            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //sb.AppendFormat("flag={0}|", flag);
            foreach (string tmpParameter in Core.Globals.AlipayOtherParamKeys)
            {
                if (!string.IsNullOrEmpty(tmpParameter))
                {
                    this.parameters.Remove(tmpParameter);
                }
            }
            string[] strArray2 = Globals.BubbleSort(this.parameters.AllKeys);
            string   s         = "";

            for (int i = 0; i < strArray2.Length; i++)
            {
                if ((!string.IsNullOrEmpty(this.parameters[strArray2[i]]) && (strArray2[i] != "sign")) && (strArray2[i] != "sign_type"))
                {
                    if (i == (strArray2.Length - 1))
                    {
                        s = s + strArray2[i] + "=" + this.parameters[strArray2[i]];
                        //sb.AppendFormat("{0}={1}|", strArray2[i], this.parameters[strArray2[i]]);
                    }
                    else
                    {
                        s = s + strArray2[i] + "=" + this.parameters[strArray2[i]] + "&";
                        //sb.AppendFormat("{0}={1}&", strArray2[i], this.parameters[strArray2[i]]);
                    }
                }
            }
            s    = s + payee.PrimaryKey;
            flag = flag && this.parameters["sign"].Equals(Globals.GetMD5(s, this.input_charset));
            string str2 = this.parameters["trade_status"];

            //sb.AppendFormat("|sign={0}|", this.parameters["sign"]);
            //sb.AppendFormat("|trade_status={0}|", this.parameters["trade_status"]);
            //Core.Globals.WriteText(sb);
            if (flag && ((str2 == "TRADE_SUCCESS") || (str2 == "TRADE_FINISHED")))
            {
                this.OnPaidToMerchant();
            }
            else
            {
                this.OnNotifyVerifyFaild();
            }
        }
Exemple #21
0
 public ShengPayRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this._merchantNo  = payee.SellerAccount;
     this._key         = payee.PrimaryKey;
     this._orderNo     = trade.OrderId;
     this._amount      = trade.TotalMoney.ToString("F2");
     this._postBackUrl = gateway.ReturnUrl;
     this._notifyUrl   = gateway.NotifyUrl;
     this._productUrl  = trade.Showurl;
     this._orderTime   = trade.Date.ToString("yyyyMMddHHmmss");
 }
Exemple #22
0
        public IpsRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
        {
            this.Mer_code    = payee.SellerAccount;
            this.Cert        = payee.PrimaryKey;
            this.Merchanturl = gateway.ReturnUrl;
            this.Billno      = trade.OrderId;
            this.Amount      = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
            DateTime date = trade.Date;

            this.Date = Convert.ToDateTime(trade.Date).ToString("yyyyMMdd", CultureInfo.InvariantCulture);
        }
Exemple #23
0
 public AlipayWapRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.partner      = payee.SellerAccount;
     this.key          = payee.PrimaryKey;
     this.seller_email = payee.EmailAddress;
     this.out_trade_no = trade.OrderId;
     this.subject      = trade.Subject;
     this.total_fee    = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.return_url   = gateway.ReturnUrl;
     this.notify_url   = gateway.NotifyUrl;
 }
Exemple #24
0
 public YeepayRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.merchantId          = payee.SellerAccount;
     this.keyValue            = payee.PrimaryKey;
     this.pid                 = payee.Partner;
     this.amount              = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
     this.orderId             = trade.OrderId;
     this.payerContact        = trade.BuyerEmailAddress;
     this.productDesc         = trade.Subject;
     this.cur                 = gateway.CurrencyType;
     this.merchantCallbackURL = gateway.ReturnUrl;
 }
Exemple #25
0
        //private string transaction_id = "";

        public TenpayAssureRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
        {
            this.key              = payee.PrimaryKey;
            this.partner          = payee.SellerAccount;
            this.time_start       = trade.Date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture);
            this.subject          = Core.Globals.SubString(trade.Subject, 30, ".."); //String(32)
            this.body             = Core.Globals.SubString(trade.Body, 30, "..");    //String(32)
            this.spbill_create_ip = getRealIp();
            //this.transaction_id = this.partner + trade.Date.ToString("yyyyMMdd", CultureInfo.InvariantCulture) + this.UnixStamp();
            this.out_trade_no = trade.OrderId;
            this.return_url   = gateway.ReturnUrl;
            this.notify_url   = gateway.NotifyUrl;
            this.total_fee    = Convert.ToInt32((decimal)(trade.TotalMoney * 100M)).ToString(CultureInfo.InvariantCulture);
        }
Exemple #26
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            if (param.Count < 1 ||
                string.IsNullOrWhiteSpace(gateway.Data) ||
                gateway.DataList.Count < 4)
            {
                this.OnNotifyVerifyFaild();
                log.AppendFormat(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " YSWL.Payment.PaymentInterface.WeChat.v3.WeChatNotify CHECK GATEWAY DATA 验证失败:" + gateway.DataList.Count);
                Core.Globals.WriteText(log);
                return;
            }

            //if ((((notify_id == null) || (partner == null) || (trade_state == null)) || ((transaction_id == null) ||
            //    (total_fee == null))) || (((out_trade_no == null) || (trade_mode == null))))
            //{
            //    this.OnNotifyVerifyFaild();

            //}
            //else if (!trade_mode.Equals("1") || !trade_state.Equals("0"))
            //{
            //    this.OnNotifyVerifyFaild();
            //}

            try
            {
                UnifiedWxPayModel model = UnifiedWxPayModel.CreateUnifiedModel(gateway.DataList[3], payee.Partner, payee.PrimaryKey);
                if (!model.ValidateMD5Signature(param, sign))
                {
                    log.AppendFormat(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " YSWL.Payment.PaymentInterface.WeChat.v3.WeChatNotify.OnNotifyVerifyFaild 验证失败:" + param + "|sign:" + sign);
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    //log.AppendFormat(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " YSWL.Payment.PaymentInterface.WeChat.v3.WeChatNotify.OnPaidToMerchant 处理通知成功!");
                    //处理通知
                    this.OnPaidToMerchant();
                }
            }
            catch (Exception ex)
            {
                //此处记录异常日志
                log.AppendFormat(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " YSWL.Payment.PaymentInterface.WeChat.v3.WeChatNotify.VerifyNotify 验证失败:" + ex.Message);
            }
            this.OnNotifyVerifyFaild();
            if (log.Length > 0)
            {
                Core.Globals.WriteText(log);
            }
        }
Exemple #27
0
 public Bill99Request(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
 {
     this.merchantAcctId = payee.SellerAccount;
     this.key            = payee.PrimaryKey;
     this.productName    = trade.OrderId;
     this.productNum     = "1";
     if (!string.IsNullOrEmpty(payee.Partner))
     {
         this.pid = payee.Partner;
     }
     this.bgUrl       = gateway.NotifyUrl;
     this.orderAmount = Convert.ToInt32((decimal)(trade.TotalMoney * 100M)).ToString(CultureInfo.InvariantCulture);
     this.orderId     = trade.OrderId;
     this.orderTime   = trade.Date.ToString("yyyyMMddhhmmss", CultureInfo.InvariantCulture);
 }
Exemple #28
0
        /// <summary>
        /// 获取收款人信息
        /// </summary>
        protected virtual PayeeInfo GetPayee(PaymentModeInfo paymode)
        {
            if (paymode == null)
            {
                return(null);
            }
            PayeeInfo info = new PayeeInfo();

            info.EmailAddress  = paymode.EmailAddress;
            info.Partner       = paymode.Partner;
            info.Password      = paymode.Password;
            info.PrimaryKey    = paymode.SecretKey;
            info.SecondKey     = paymode.SecondKey;
            info.SellerAccount = paymode.MerchantCode;
            return(info);
        }
Exemple #29
0
        public override void VerifyNotify(int timeout, PayeeInfo payee, GatewayInfo gateway)
        {
            this.parameters["key"] = payee.PrimaryKey;
            this.key2 = payee.SecondKey;

            string notify_id      = this.parameters["notify_id"];      //通知id
            string partner        = this.parameters["partner"];        //商户号
            string trade_state    = this.parameters["trade_state"];    //支付结果
            string transaction_id = this.parameters["transaction_id"]; //财付通订单号
            string total_fee      = this.parameters["total_fee"];      //金额,以分为单位
            string out_trade_no   = this.parameters["out_trade_no"];   //商户订单号
            string trade_mode     = this.parameters["trade_mode"];     //交易模式,1即时到账,2中介担保

            //string attach = this.parameters["attach"];


            if ((((notify_id == null) || (partner == null) || (trade_state == null)) || ((transaction_id == null) ||
                                                                                         (total_fee == null))) || (((out_trade_no == null) || (trade_mode == null))))
            {
                this.OnNotifyVerifyFaild();
            }
            else if (!trade_mode.Equals("1") || !trade_state.Equals("0"))
            {
                this.OnNotifyVerifyFaild();
            }
            else
            {
                if (!Globals.isTenpaySign(this.parameters, "utf-8"))
                {
                    this.OnNotifyVerifyFaild();
                }
                else
                {
                    try
                    {
                        this.AutoDeliverNotify();
                    }
                    catch (Exception)
                    {
                        //Core.Globals.WriteText(new System.Text.StringBuilder(ex.Message + "|" + ex.StackTrace));
                    }
                    this.OnPaidToMerchant();
                }
            }
        }
Exemple #30
0
        public StandardRequest(PayeeInfo payee, GatewayInfo gateway, TradeInfo trade)
        {
            this.return_url   = gateway.ReturnUrl;
            this.notify_url   = gateway.NotifyUrl;
            this.body         = trade.Body;
            this.out_trade_no = trade.OrderId;
            this.subject      = trade.Subject;
            this.price        = trade.TotalMoney.ToString("F", CultureInfo.InvariantCulture);
            this.show_url     = trade.Showurl;
            this.partner      = payee.SellerAccount;
            this.key          = payee.PrimaryKey;
            this.seller_email = payee.EmailAddress;

            this.receive_name    = string.IsNullOrWhiteSpace(trade.BuyerName) ? "BUYERNAMEISNULL" : trade.BuyerName;
            this.receive_address = trade.BuyerAddress;
            this.receive_phone   = trade.BuyerPhone;
            this.receive_mobile  = trade.BuyerMobile;
        }