示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            var srv = new com.pecco24.www.EShopService();

            string authorityStr = Request.Params["au"];
            string Status = Request.Params["rs"];


            // if response is succesful, eShops have to check it again
            if (Status == "0" && authorityStr != null)
            {
                long au = long.Parse(authorityStr);

                byte st = 0;

                srv.PinPaymentEnquiry("hu1PP77d1x3227oU4A78", au, ref st);



                CreditOnlineBank cob = new CreditOnlineBank();
                int RecordId = cob.changeStatus(Convert.ToInt32(st), Convert.ToInt64(au));

                Response.Redirect("~/Credit.aspx?Mode=TransactionSuccessful&TransactionId=" + RecordId.ToString());

                // if this method failed, eShop has to call the following method
                // service.Reversal(authority, ref status);
                // to be sure about payment reversal
                if (st != 0)
                {

                }
            }
            else
            {
                long au = long.Parse(authorityStr);

                CreditOnlineBank cob = new CreditOnlineBank();
                int OrderlId = cob.addRecord(0, 0, " ", -2, Convert.ToInt64(au));
                int OrderReversalId = cob.getRecordIdByRefId(Convert.ToInt64(au));

                byte st = 0;

                srv.PinReversal("hu1PP77d1x3227oU4A78", OrderlId, OrderReversalId, ref st);

                Response.Redirect("~/Credit.aspx?Mode=TransactionFailed&TransactionId=" + OrderReversalId.ToString());
            }
        }
        catch (Exception)
        {
            throw;
        }

    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            var srv = new com.pecco24.www.EShopService();

            string authorityStr = Request.Params["au"];
            string Status       = Request.Params["rs"];


            // if response is succesful, eShops have to check it again
            if (Status == "0" && authorityStr != null)
            {
                long au = long.Parse(authorityStr);

                byte st = 0;

                srv.PinPaymentEnquiry("hu1PP77d1x3227oU4A78", au, ref st);



                CreditOnlineBank cob = new CreditOnlineBank();
                int RecordId         = cob.changeStatus(Convert.ToInt32(st), Convert.ToInt64(au));

                Response.Redirect("~/Credit.aspx?Mode=TransactionSuccessful&TransactionId=" + RecordId.ToString());

                // if this method failed, eShop has to call the following method
                // service.Reversal(authority, ref status);
                // to be sure about payment reversal
                if (st != 0)
                {
                }
            }
            else
            {
                long au = long.Parse(authorityStr);

                CreditOnlineBank cob = new CreditOnlineBank();
                int OrderlId         = cob.addRecord(0, 0, " ", -2, Convert.ToInt64(au));
                int OrderReversalId  = cob.getRecordIdByRefId(Convert.ToInt64(au));

                byte st = 0;

                srv.PinReversal("hu1PP77d1x3227oU4A78", OrderlId, OrderReversalId, ref st);

                Response.Redirect("~/Credit.aspx?Mode=TransactionFailed&TransactionId=" + OrderReversalId.ToString());
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
示例#3
0
    protected void ImageButtonOnline_Click(object sender, ImageClickEventArgs e)
    {
        if (!captchaOnline.Decide())
        {
            captchaOnline.message = "پاسخ اشتباه است!";
        }
        else
        {
            try
            {
                if (Convert.ToInt32(TextBoxOnlineCredit.Text) < 1000)
                {
                    LabelAddMinimum.Visible = true;
                    Response.End();
                }
            }
            catch (Exception)
            {
                throw;
            }

            int Credit = Convert.ToInt32(TextBoxOnlineCredit.Text);

            CreditOnlineBank cob = new CreditOnlineBank();
            int OrderId          = cob.addRecord(Convert.ToInt32(Session["UserId"]), (Credit / 10), RadioButtonListOnlineBank.SelectedValue, -1, 0);

            //Parsian Web Sevice

            var srv = new com.pecco24.www.EShopService();

            try
            {
                long au = 0;
                byte st = 0;
                srv.PinPaymentRequest("hu1PP77d1x3227oU4A78", Credit, OrderId, "http://www.salestan.ir/Transaction.aspx", ref au, ref st);
                if (st == 0)
                {
                    cob.setRefId(OrderId, Convert.ToInt64(au));

                    Response.Redirect("https://www.pecco24.com/pecpaymentgateway/?au=" + au.ToString(), true);
                }
            }
            catch (Exception)
            {
            }
        }
    }
示例#4
0
    protected void ImageButtonOnline_Click(object sender, ImageClickEventArgs e)
    {
        if (!captchaOnline.Decide())
        {
            captchaOnline.message = "پاسخ اشتباه است!";
        }
        else
        {
            try
            {
                if (Convert.ToInt32(TextBoxOnlineCredit.Text) < 1000)
                {
                    LabelAddMinimum.Visible = true;
                    Response.End();
                }
            }
            catch (Exception)
            {
                throw;
            }

            int Credit = Convert.ToInt32(TextBoxOnlineCredit.Text);

            CreditOnlineBank cob = new CreditOnlineBank();
            int OrderId = cob.addRecord(Convert.ToInt32(Session["UserId"]), (Credit / 10), RadioButtonListOnlineBank.SelectedValue, -1, 0);

            //Parsian Web Sevice

            var srv = new com.pecco24.www.EShopService();

            try
            {
                long au = 0;
                byte st = 0;
                srv.PinPaymentRequest("hu1PP77d1x3227oU4A78", Credit, OrderId, "http://www.salestan.ir/Transaction.aspx", ref au, ref st);
                if (st == 0)
                {
                    cob.setRefId(OrderId, Convert.ToInt64(au));

                    Response.Redirect("https://www.pecco24.com/pecpaymentgateway/?au=" + au.ToString(), true);
                }
            }
            catch (Exception)
            {

            }
        }
    }