Hi Folks,
In my website, I'm using moneybooker payment gateway, the problem is return to Merchant link does not work.
Any clue regarding this issue?
Best regards,
Mohammed Ebaid.
public string PostProcessPayment(Order order)
{
RemotePost remotePostHelper = new RemotePost();
remotePostHelper.FormName = "MoneybookersForm";
remotePostHelper.Url = GetMoneybookersUrl();
remotePostHelper.Add("pay_to_email", payToEmail);
remotePostHelper.Add("recipient_description", SettingManager.StoreName);
remotePostHelper.Add("transaction_id", order.OrderID.ToString());
remotePostHelper.Add("cancel_url", CommonHelper.GetStoreLocation(false) + "Default.aspx");
remotePostHelper.Add("status_url", CommonHelper.GetStoreLocation(false) + "MoneybookersReturn.aspx");
//supported moneybookers languages (EN, DE, ES, FR, IT, PL, GR, RO, RU, TR, CN, CZ or NL)
//TODO Check if customer working language is supported by Moneybookers.
remotePostHelper.Add("language", "EN");
remotePostHelper.Add("amount", order.OrderTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
//TODO Primary store currency should be set to USD now (3-letter codes)
remotePostHelper.Add("currency", CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
remotePostHelper.Add("detail1_description", "Order ID:");
remotePostHelper.Add("detail1_text", order.OrderID.ToString());
remotePostHelper.Add("firstname", order.BillingFirstName);
remotePostHelper.Add("lastname", order.BillingLastName);
remotePostHelper.Add("address", order.BillingAddress1);
remotePostHelper.Add("phone_number", order.BillingPhoneNumber);
remotePostHelper.Add("postal_code", order.BillingZipPostalCode);
remotePostHelper.Add("city", order.BillingCity);
StateProvince billingStateProvince = StateProvinceManager.GetStateProvinceByID(order.BillingStateProvinceID);
if (billingStateProvince != null)
remotePostHelper.Add("state", billingStateProvince.Abbreviation);
else
remotePostHelper.Add("state", order.BillingStateProvince);
Country billingCountry = CountryManager.GetCountryByID(order.BillingCountryID);
if (billingCountry != null)
remotePostHelper.Add("country", billingCountry.ThreeLetterISOCode);
else
remotePostHelper.Add("country", order.BillingCountry);
remotePostHelper.Post();
return string.Empty;
}
protected void Page_Load(object sender, EventArgs e)
{
Response.CacheControl = "private";
Response.Expires = 0;
Response.AddHeader("pragma", "no-cache");
//TODO implement, validate order
//Response.Redirect("~/Default.aspx");
if (!Page.IsPostBack)
{
string pay_to_email = HttpContext.Current.Request.Form["pay_to_email"];
string pay_from_email = HttpContext.Current.Request.Form["pay_from_email"];
string merchant_id = HttpContext.Current.Request.Form["merchant_id"];
string mb_transaction_id = HttpContext.Current.Request.Form["mb_transaction_id"];
string mb_amount = HttpContext.Current.Request.Form["mb_amount"];
string mb_currency = HttpContext.Current.Request.Form["mb_currency"];
string status = HttpContext.Current.Request.Form["status"];
string md5sig = HttpContext.Current.Request.Form["md5sig"];
string amount = HttpContext.Current.Request.Form["amount"];
string currency = HttpContext.Current.Request.Form["currency"];
if (status == "2")
{
//TODO test
//TODO validate amount and etc
Order order = OrderManager.GetOrderByID(Convert.ToInt32(mb_transaction_id));
OrderManager.MarkOrderAsPaid(order.OrderID);
Response.Redirect("~/CheckoutCompleted.aspx");
}
else
Response.Redirect("~/Default.aspx");
}
}
remotePostHelper.Add("return_url", CommonHelper.GetStoreLocation(false) + "MoneybookersReturn.aspx");
remotePostHelper.Add("cancel_url", CommonHelper.GetStoreLocation(false) + "Default.aspx");
remotePostHelper.Add("status_url", CommonHelper.GetStoreLocation(false) + "MoneybookersReturn.aspx");