Beispiel #1
0
        protected void PaymentButton_Click(object sender, EventArgs e)
        {
            PaymentRequest paymentRequest = new PaymentRequest();
            decimal        amount;

            decimal.TryParse(lblTotal.Text, out amount);
            int cvc;

            int.TryParse(CVCText.Text, out cvc);
            paymentRequest.Amount      = amount;
            paymentRequest.CardName    = NameText.Text;
            paymentRequest.CardNumber  = NumberText.Text;
            paymentRequest.CVC         = cvc;
            paymentRequest.Description = "Test payment";
            paymentRequest.Expiry      = DateTime.Parse(ExpiryText.Text);
            PaymentAction payment = new PaymentAction(paymentRequest);

            payment.StartPayment();
            if (paymentRequest != null)
            {
                Response.Redirect("~/Checkout/CheckoutError.aspx");
            }
            else
            {
                Session["ActivePayment"] = payment;
                Response.Redirect("~/Checkout/CheckoutComplete.aspx");
            }
        }
        protected void PaymentButton_Click(object sender, EventArgs e)
        {
            PaymentRequest paymentRequest = new PaymentRequest();
            decimal        amount;

            decimal.TryParse(AmountText.Text, out amount);
            int cvc;

            int.TryParse(CVCText.Text, out cvc);
            paymentRequest.Amount      = amount;
            paymentRequest.CardName    = NameText.Text;
            paymentRequest.CardNumber  = NumberText.Text;
            paymentRequest.CVC         = cvc;
            paymentRequest.Description = "Test payment";
            paymentRequest.Expiry      = DateTime.Parse(ExpiryText.Text);
            PaymentAction payment = new PaymentAction(paymentRequest);

            payment.StartPayment();
            Session["ActivePayment"] = payment;
            Response.Redirect("Thankyou.aspx");
        }