// create a new order and redirect to a payment page protected void checkoutButton_Click(object sender, EventArgs e) { // Store the total amount because the cart // is emptied when creating the order decimal amount = Convert.ToDecimal(totalAmountLabel.Text); // Create the order and store the order ID string orderId = ShoppingCartAccess.CreateOrder(); // Obtain the site name from the configuration settings string siteName = BalloonShopConfiguration.SiteName; // Create the PayPal redirect location string redirect = ""; redirect += "https://www.paypal.com/xclick/[email protected]"; redirect += "&item_name=" + siteName + " Order " + orderId; redirect += "&item_number=" + orderId; redirect += "&amount=" + String.Format("{0:0.00} ", amount); redirect += "¤cy=USD"; redirect += "&return=http://www." + siteName + ".com"; redirect += "&cancel_return=http://www." + siteName + ".com"; // Redirect to the payment page Response.Redirect(redirect); }
protected void Checkout_Click(object sender, EventArgs e) { // Get the total amount decimal amount = ShoppingCartAccess.GetTotalAmount(); // Create the order and store the order ID int orderId = ShoppingCartAccess.CreateOrder(); // string ordername = DatabaseConfiguration.PayPal + " Order " + orderId; // Go to PayPal checkout // string destination = Link.ToPayPalCheckout(ordername, amount); Response.Redirect("https://www.paypal.com/"); }
// create a new order and redirect to a payment page protected void checkoutButton_Click(object sender, EventArgs e) { // Get the total amount decimal amount = ShoppingCartAccess.GetTotalAmount(); // Create the order and store the order ID string orderId = ShoppingCartAccess.CreateOrder(); string ordername = BalloonShopConfiguration.SiteName + " Order " + orderId; // Go to PayPal Checkout string destination = Link.ToPayPalCheckout(ordername, amount); Response.Redirect(destination); }
protected void placeOrderButton_Click(object sender, EventArgs e) { // Store the total amount because the cart // is emptied when creating the order decimal amount = ShoppingCartAccess.GetTotalAmount(); // Create the order and store the order ID string orderId = ShoppingCartAccess.CreateOrder(); // Create the PayPal redirect location string redirect = ""; redirect += "https://www.paypal.com/xclick/[email protected]"; redirect += "&item_name=BallonShopOrder " + orderId; redirect += "&item_number=" + orderId; redirect += "&amount=" + String.Format("{0:c} ", amount); redirect += "&return=http://www.YourWebSite.com"; redirect += "&cancel_return=http://www.YourWebSite.com"; // Redirect to the payment page Response.Redirect(redirect); }