Hi!
Can anyone help me with the right way to remove PayPal from TBH website? I want to proceed with the order, but without any payments. As a result I want the order to be e-mailed to admin, and updated in the database as a completed order.
Programlanguage is c#
This is the App_Code/BLL/Store/Order.cs
public bool Update()
{
return Order.UpdateOrder(this.ID, this.StatusID, this.ShippedDate, this.TransactionID, this.TrackingID);
}
public string GetPayPalPaymentUrl()
{
string serverUrl = (Globals.Settings.Store.SandboxMode ?
"https://www.sandbox.paypal.com/us/cgi-bin/webscr" :"https://www.paypal.com/us/cgi-bin/webscr");
string amount = this.SubTotal.ToString("N2").Replace(',', '.');string shipping = this.Shipping.ToString("N2").Replace(',', '.');
string baseUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(HttpContext.Current.Request.Url.PathAndQuery, "") + HttpContext.Current.Request.ApplicationPath;
if (!baseUrl.EndsWith("/")) baseUrl += "/";
string notifyUrl = HttpUtility.UrlEncode(baseUrl + "PayPal/Notify.aspx");string returnUrl = HttpUtility.UrlEncode(baseUrl + "PayPal/OrderCompleted.aspx?ID=" + this.ID.ToString());
string cancelUrl = HttpUtility.UrlEncode(baseUrl + "PayPal/OrderCancelled.aspx");string business = HttpUtility.UrlEncode(Globals.Settings.Store.BusinessEmail);
string itemName = HttpUtility.UrlEncode("Order #" + this.ID.ToString());StringBuilder url = new StringBuilder();
url.AppendFormat(
"{0}?cmd=_xclick&upload=1&rm=2&no_shipping=1&no_note=1¤cy_code={1}&business={2}&item_number={3}&custom={3}&item_name={4}&amount={5}&shipping={6}¬ify_url={7}&return={8}&cancel_return={9}",serverUrl, Globals.Settings.Store.CurrencyCode, business, this.ID, itemName,
amount, shipping, notifyUrl, returnUrl, cancelUrl);
return url.ToString();
And this is ShoppingCart.aspx.cs
// check that the user is still logged in (the cookie may have expired)
// and if not redirect to the login pageif (this.User.Identity.IsAuthenticated)
{
string shippingMethod = ddlShippingMethods.SelectedItem.Text;
shippingMethod = shippingMethod.Substring(0, shippingMethod.LastIndexOf(
'('));
// saves the order into the DB, and clear the shopping cart in the profileint orderID = Order.InsertOrder(this.Profile.ShoppingCart, shippingMethod, Convert.ToDecimal(ddlShippingMethods.SelectedValue),
txtFirstName.Text, txtLastName.Text, txtStreet.Text, txtPostalCode.Text, txtCity.Text,
txtState.Text, ddlCountries.SelectedValue, txtEmail.Text, txtPhone.Text, txtFax.Text, "");
this.Profile.ShoppingCart.Clear();
// redirect to PayPal for the credit-card paymentOrder order = Order.GetOrderByID(orderID);this.Response.Redirect(order.GetPayPalPaymentUrl(), false);
}
elsethis.RequestLogin();
}
I understand the codes, but I dont know how to safely change them...
Hope anyone can help me!