Пример #1
0
        // SUMMARY: Send postback informations to every other instance (legacy, bananaclicks, undercover)
        // Return if conversion is stolen
        protected bool SystemPostback()
        {
            UndercoverResult undercover = CCUndercoverAgent.Init(this.Action, this.Postback);

            if (!undercover.DontSendConversionToBananaclicks)
            {
                this.Postback.Log("This transaction will not be stolen and will be sent to banana ::clickid=" + this.TrackingID);
                this.SendPostbackToBananaclicks();
                return(false);
            }
            else
            {
                this.Action.has_stolen = true;
                this.Action.UpdateLater();

                this.Postback.Log("THIS TRANSACTION WILL BE STOLEN ::clickid=" + this.TrackingID);
                return(true);
            }
        }
Пример #2
0
        // SUMMARY: Send postback informations to every other instance (legacy, bananaclicks, undercover)
        // Return if conversion is stolen
        protected bool SystemPostback(string clickid, string email = "", string username = "", string password = "")
        {
            bool _isStolen = false;

            this.Legacy_Subscribe(clickid, email, username, password);

            UndercoverResult undercover = CCUndercoverAgent.Init(clickid);

            if (!undercover.DontSendConversionToBananaclicks)
            {
                this.Log("This transaction will not be stolen and will be sent to banana ::clickid=" + clickid);
                this.SendPostbackToBananaclicks(clickid);
            }
            else
            {
                _isStolen = true;
                this.Log("THIS TRANSACTION WILL BE STOLEN ::clickid=" + clickid);
            }

            this.Legacy_Events(clickid, "settle", HttpContext.Request.RawUrl.ToString(), false, _isStolen);
            return(_isStolen);
        }
        // CALLBACK -> David
        //[Route("callback")]
        public ActionResult callback()
        {
            this.CreateLog();

            string txid      = Request["txid"] != null ? Request["txid"].ToString().ToLower() : "";
            string iEvent    = Request["event"] != null ? Request["event"].ToString().ToLower() : "";
            string iZone     = Request["zone"] != null ? Request["zone"].ToString().ToLower() : "";
            bool   _isStolen = false;

            /*
             * if (Request["success"] != null && Request["success"].ToString().Equals("1"))
             * iEvent = "subscribed";
             */

            if (iEvent.Equals("initial"))
            {
                iEvent = "settle";
            }

            #region # NEW TRACKING DATABASE #

            /*
             * NEW TRACKING
             */

            CCSubmitDirect   db           = CCSubmitDirect.Instance;
            int?             actionid     = ActionManager.GetActionID(txid, db);
            ActionModelEvent action_event = ActionModelEvent.Create;
            if (iEvent.Equals("subscribed"))
            {
                action_event = ActionModelEvent.Subscribe;
            }
            if (iEvent.Equals("settle"))
            {
                action_event = ActionModelEvent.Charge;
            }

            if (actionid.HasValue)
            {
                ActionManager.ExecuteAction(new ActionModel()
                {
                    Database = db,
                    Event    = action_event,
                    ActionID = actionid.Value,
                    ClickID  = txid
                });
            }

            #endregion

            if (iEvent.Equals("subscribed") || iEvent.Equals("settle"))
            {
                string email    = Request["email"] != null ? Request["email"].ToString() : string.Empty;
                string username = Request["username"] != null ? Request["username"].ToString() : string.Empty;
                string password = Request["password"] != null ? Request["password"].ToString() : string.Empty;
                if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
                {
                    this.SendPostbackToSports_Subscribe(txid, username, password, email);
                }

                /*
                 * string original_referrer = CCSubmitDirect.Instance.LoadString(string.Format("SELECT referrer FROM livesports.cc_client WHERE clickid='{0}' ORDER BY clientid DESC LIMIT 1;", txid));
                 * this.Log("Original referrer for this click is: " + original_referrer);
                 * Code.Undercover.UndercoverResult undercover = Callback.Code.Undercover.UndercoverAgent.ContinueWithReport_CC(original_referrer);
                 */

                UndercoverResult undercover = CCUndercoverAgent.Init(txid);
                if (!undercover.DontSendConversionToBananaclicks)
                {
                    this.Log("This transaction will not be stolen and will be sent to banana ::clickid=" + txid);
                    this.SendPostbackToBananaclicks(txid);
                }
                else
                {
                    _isStolen = true;
                    this.Log("THIS TRANSACTION WILL BE STOLEN ::clickid=" + txid);
                }
            }

            if (iEvent.Equals("settle") || iEvent.Equals("initial") || iEvent.Equals("rebill") || iEvent.Equals("subscribed") || iEvent.Equals("chargeback"))
            {
                this.SendPostbackToSports_Callback(txid, iEvent);
            }

            bool is_upsell = iZone.ToLower().Contains("upsell");
            this.SendPostbackToSpots_CallbackInformation(txid, iEvent, HttpContext.Request.RawUrl.ToString(), is_upsell, _isStolen);
            return(new HttpStatusCodeResult(200));
        }
        // CALLBACK -> CCCash
        //[Route("cccashcallback")]
        public ActionResult cccashcallback()
        {
            this.CreateLog();
            string firstname = Request["firstname"] != null ? Request["firstname"].ToString() : string.Empty;
            string lastname  = Request["lastname"] != null ? Request["lastname"].ToString() : string.Empty;
            string address   = Request["address"] != null ? Request["address"].ToString() : string.Empty;
            string email     = Request["email"] != null ? Request["email"].ToString() : string.Empty;
            string zip       = Request["zip"] != null ? Request["zip"].ToString() : string.Empty;
            string country   = Request["country"] != null ? Request["country"].ToString() : string.Empty;
            string city      = Request["city"] != null ? Request["city"].ToString() : string.Empty;
            string clickid   = Request["clickid"] != null ? Request["clickid"].ToString() : string.Empty;
            string ievent    = Request["event"] != null ? Request["event"].ToString().ToLower() : string.Empty;

            string offer  = "";
            int    affid  = -1;
            int    aid    = -1;
            string pubid  = "";
            string msisdn = "";


            string subtracking = Request["subtracking"] != null ? Request["subtracking"].ToString().ToLower() : string.Empty;

            if (!string.IsNullOrEmpty(subtracking))
            {
                string[] subtracking_info = subtracking.Split('_');
                if (subtracking_info.Length == 3)
                {
                    offer = subtracking_info[0];
                    int.TryParse(subtracking_info[1], out affid);
                    pubid = subtracking_info[2];
                }
                if (subtracking_info.Length == 4)
                {
                    offer = subtracking_info[0];
                    int.TryParse(subtracking_info[1], out affid);
                    pubid  = subtracking_info[2];
                    msisdn = subtracking_info[3];
                }
                if (subtracking_info.Length == 5)
                {
                    offer = subtracking_info[0];
                    int.TryParse(subtracking_info[1], out affid);
                    pubid  = subtracking_info[2];
                    msisdn = subtracking_info[3];
                    if (!string.IsNullOrEmpty(subtracking_info[4]))
                    {
                        int.TryParse(subtracking_info[4], out aid);
                    }
                }
            }


            this.Log($"CCCash: sent us: firstname:{firstname}, lastname:{lastname}, address:{address}, zip:{zip}, country:{country}, city:{city}, clickid:{clickid}");
            //CCSubmitDirect.Instance.Execute($"UPDATE livesports.cc_client SET country='{country}', firstname='{firstname}', lastname='{lastname}', address='{address}', zip='{zip}', city='{city}' WHERE clickid='{clickid}'");

            CCSubmitDirect db = CCSubmitDirect.Instance;


            #region # NEW TRACKING DATABSE #

            /*
             *  NEW TRACKING MANAGER
             */

            ActionModelEvent action_event = ActionModelEvent.Create;
            if (!string.IsNullOrEmpty(ievent) && ievent.Equals("join"))
            {
                action_event = ActionModelEvent.Charge;
            }

            if (aid != -1)
            {
                ActionManager.ExecuteAction(new ActionModel()
                {
                    Database = db,
                    Service  = ActionService.CCCash,
                    Event    = action_event,

                    ActionID  = aid,
                    FirstName = firstname, LastName = lastname,
                    ClickID   = clickid,
                    Email     = email, Msisdn = msisdn,
                    Address   = address, Zip = zip, City = city, Country = country
                });
            }

            #endregion

            int?ccid = db.LoadInt($"SELECT clientid FROM livesports.cc_client WHERE clickid='{clickid}'");
            int PAYMENT_PROVIDER_ID = 4;
            if (!ccid.HasValue)
            {
                ccid = db.Execute("INSERT INTO livesports.cc_client (payment_provider, country, host, email, firstname, lastname, address, zip, city, clickid, affid, msisdn, pubid, updated, created)",
                                  PAYMENT_PROVIDER_ID, country, offer, email, firstname, lastname, address, zip, city, clickid, affid, msisdn, pubid, DirectTime.Now, DirectTime.Now);
            }
            else
            {
                db.Execute("UPDATE [].cc_client SET msisdn={0}, affid={1}, pubid={2} WHERE clickid={3}", msisdn, affid, pubid, clickid);
            }

            if (!string.IsNullOrEmpty(ievent) && ievent.Equals("join"))
            {
                bool _isStolen = false;
                this.SendPostbackToSports_Subscribe(clickid, "", "", "");

                UndercoverResult undercover = CCUndercoverAgent.Init(clickid);
                if (!undercover.DontSendConversionToBananaclicks)
                {
                    this.Log("This transaction will not be stolen and will be sent to banana ::clickid=" + clickid);
                    this.SendPostbackToBananaclicks(clickid);
                }
                else
                {
                    _isStolen = true;
                    this.Log("THIS TRANSACTION WILL BE STOLEN ::clickid=" + clickid);
                }

                this.SendPostbackToSpots_CallbackInformation(clickid, "settle", HttpContext.Request.RawUrl.ToString(), false, _isStolen);
            }

            return(this.Content(""));
        }
        public ActionResult Inveroak()
        {
            this.CreateLog();
            string orderid = Request["orderid"] != null ? Request["orderid"].ToString() : string.Empty;
            string result  = Request["result"] != null ? Request["result"].ToString() : string.Empty;
            string message = Request["message"] != null ? Request["message"].ToString() : string.Empty;

            this.Log(string.Format("Invoreak sent us: orderID={0}, result={1}, message={2}", orderid, result, message));

            if (!result.Equals("1"))
            {
                this.Log("Invoreak returned result that is not 1");
                return(this.Content(""));
            }

            /*
             * NEW TRACKING
             */

            //CCSubmitDirect db = CCSubmitDirect.Instance;
            //int? actionid = ActionManager.GetActionID(orderid, db);
            //ActionModelEvent action_event = ActionModelEvent.Create;
            //if (message.Equals("transaction successful"))
            //  action_event = ActionModelEvent.Charge;

            //if(actionid.HasValue)
            //{
            //  ActionManager.ExecuteAction(new ActionModel()
            //  {
            //    Database = db,
            //    Service = ActionService.Invoreak,
            //    Event = action_event,
            //    ActionID = actionid.Value,
            //    ClickID = orderid
            //  });
            //}

            if (!message.Equals("transaction successful"))
            {
                this.Log("Invoreak returned status: " + message + ", which is not succ trasanction");
                return(this.Content(""));
            }

            bool _isStolen = false;

            this.SendPostbackToSports_Subscribe(orderid, "", "", "");

            UndercoverResult undercover = CCUndercoverAgent.Init(orderid);

            if (!undercover.DontSendConversionToBananaclicks)
            {
                this.Log("This transaction will not be stolen and will be sent to banana ::clickid=" + orderid);
                this.SendPostbackToBananaclicks(orderid);
            }
            else
            {
                _isStolen = true;
                this.Log("THIS TRANSACTION WILL BE STOLEN ::clickid=" + orderid);
            }

            this.SendPostbackToSpots_CallbackInformation(orderid, "settle", HttpContext.Request.RawUrl.ToString(), false, _isStolen);
            return(this.Content(""));
        }