Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var session = NHibernateFactory.OpenSession();
        var payPal  = new Przelewy24Handler(InternalBodyArchitectService.PaymentsManager);

        try
        {
            payPal.ProcessOrderRequest(session, Request.Form, Context);
            Response.Redirect("PaymentsFinished.aspx?Transferuj=1");
        }
        catch (Exception ex)
        {
            ExceptionHandler.Default.Process(ex);
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PayPalHandler payPal = new PayPalHandler(InternalBodyArchitectService.PaymentsManager);

        PowrotTransferujUrl = ApplicationSettings.ServerUrl + "V2/PaymentsFinished.aspx?Transferuj=1";
        PayPalNotifyUrl     = ApplicationSettings.ServerUrl + "V2/PayPalOrderProcessing.aspx";
        PayPalUrl           = payPal.PayPalUrl;
        PayPalButton30      = payPal.BAPoints_30_Button;
        PayPalButton120     = payPal.BAPoints_120_Button;
        //AmazonHandler amazon = new AmazonHandler(InternalBodyArchitectService.PaymentsManager);
        //AmazonNotifyUrl = ApplicationSettings.ServerUrl + "V2/AmazonOrderProcessing.aspx";
        //AmazonNotifyUrl = "http://test.bodyarchitectonline.com/V2/AmazonOrderProcessing.aspx";
        //amazon.AmazonNotifyUrl = AmazonNotifyUrl;
        //AmazonUrl = amazon.AmazonUrl;
        //TODO: Amazon credentials
        //AmazonAccessKey = "AKIAIPL5YHFX7JYBMJTA";   //obtain keys at https://portal.aws.amazon.com/gp/aws/securityCredentials
        //AmazonSecretKey = "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";

        MyRenderForm.RenderFormTag = false;

#if !DEBUG
        if (Request.QueryString["Token"] == null)
        {
            Response.Redirect("http://bodyarchitectonline.com");
        }
#else
        ProfileEmail = "*****@*****.**";
#endif
        ////now using specified token we must check if this token is authenticated and if yes then we take profile id
        if (Request.QueryString["Token"] != null)
        {
            Token token        = new Token(new Guid(Request.QueryString["Token"]));
            var   securityInfo = InternalBodyArchitectService.SecurityManager.EnsureAuthentication(token);
            ProfileId        = securityInfo.SessionData.Profile.GlobalId.ToString();
            ProfileEmail     = securityInfo.SessionData.Profile.Email;
            lblUserName.Text = securityInfo.SessionData.Profile.UserName;
            Language         = securityInfo.SessionData.Token.Language;
        }
        //payNowWidgetForm = ButtonGenerator.GenerateForm(AmazonAccessKey, AmazonSecretKey, "USD 5", "BAPoints_30",
        //    ProfileId, "0", null, null, "1", AmazonNotifyUrl, "0", "HmacSHA256", amazon.UseSandbox ? "sandbox" : "prod");

        TransferujHandler transferuj = new TransferujHandler(InternalBodyArchitectService.PaymentsManager);
        TransferujUrl              = transferuj.Url;
        TransferujNotifyUrl        = ApplicationSettings.ServerUrl + "V2/TransferujOrderProcessing.aspx";
        TransferujId               = transferuj.TransferujId;
        TransferujKwota            = "15";
        TransferujCrc              = string.Format("{0}|{1}", ProfileId, "BAPoints_30");
        TransferujKodPotwierdzajcy = transferuj.TransferujKodPotwierdzajcy;

        Transferuj120Opis = (string)this.GetGlobalResourceObject("Payments.aspx", "lbl120PointsPaymentDescription.value");
        TransferujOpis    = (string)this.GetGlobalResourceObject("Payments.aspx", "lbl30PointsPaymentDescription.value");
        TransferujMd5     = FormsAuthentication.HashPasswordForStoringInConfigFile(
            TransferujId + TransferujKwota + TransferujCrc + TransferujKodPotwierdzajcy, "MD5").ToLower();

        Transferuj120Kwota = "60";
        Transferuj120Crc   = string.Format("{0}|{1}", ProfileId, "BAPoints_120");
        Transferuj120Md5   = FormsAuthentication.HashPasswordForStoringInConfigFile(
            TransferujId + Transferuj120Kwota + Transferuj120Crc + TransferujKodPotwierdzajcy, "MD5").ToLower();



        Przelewy24Handler przelewy24 = new Przelewy24Handler(InternalBodyArchitectService.PaymentsManager);
        Przelewy24Id           = przelewy24.MyId;
        Przelewy24NotifyUrl    = przelewy24.NotifyUrl;
        Przelewy24Url          = przelewy24.Url;
        Przelewy24Kwota        = "1500";
        Przelewy24Kwota120     = "6000";
        Przelewy24SessionId    = string.Format("{0}|{1}|BAPoints_30", Guid.NewGuid().ToString(), ProfileId);
        Przelewy24SessionId120 = string.Format("{0}|{1}|BAPoints_120", Guid.NewGuid().ToString(), ProfileId);
        string value    = Przelewy24SessionId + "|" + Przelewy24Id + "|" + Przelewy24Kwota + "|" + przelewy24.KluczCRC;
        string value120 = Przelewy24SessionId120 + "|" + Przelewy24Id + "|" + Przelewy24Kwota120 + "|" + przelewy24.KluczCRC;
        Przelewy24Crc    = FormsAuthentication.HashPasswordForStoringInConfigFile(value, "MD5").ToLower();
        Przelewy24Crc120 = FormsAuthentication.HashPasswordForStoringInConfigFile(value120, "MD5").ToLower();


        hideControls();
    }