protected override void BuildPostForm(Order order, IndividualOrderCollection indOrders, decimal price, decimal shipping, Customer customer)
        {
            var remotePostHelper = new RemotePost { FormName = "AssistForm", Url = GetPaymentServiceUrl() };
            remotePostHelper.Add("Merchant_ID", "706403");
            remotePostHelper.Add("OrderNumber", order.OrderID.ToString());
            remotePostHelper.Add("OrderAmount", Math.Round(price + shipping).ToString());
            remotePostHelper.Add("OrderCurrency", ConvertToUsd ? "USD" : CurrencyId);
            remotePostHelper.Add("TestMode", IsTestMode? "1": "0");
            if (!String.IsNullOrEmpty(customer.BillingAddress.LastName))
            {
                remotePostHelper.Add("Lastname", customer.BillingAddress.LastName);
            }
            if (!String.IsNullOrEmpty(customer.BillingAddress.FirstName))
            {
                remotePostHelper.Add("Firstname", customer.BillingAddress.FirstName);
            }
            if (!String.IsNullOrEmpty(customer.BillingAddress.Email))
            {
                remotePostHelper.Add("Email", customer.BillingAddress.Email);
            }

            remotePostHelper.Add("URL_RETURN_OK", SettingManager.GetSettingValue("PaymentMethod.Assist.OkUrl"));
            remotePostHelper.Add("URL_RETURN_NO", SettingManager.GetSettingValue("PaymentMethod.Assist.NoUrl"));

            remotePostHelper.Post();
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        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;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(HostedPaymentSettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "PayPoint";
            post.Url = gatewayUrl.ToString();

            post.Add("merchant", HostedPaymentSettings.MerchantId);
            post.Add("trans_id", order.OrderId.ToString());
            post.Add("currency", order.CustomerCurrencyCode);
            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("callback", String.Format("{0}PayPointHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("digest", PayPointHelper.CalcRequestSign(post));

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(SimplePaySettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "SimplePay";
            post.Url = gatewayUrl.ToString();
            post.Method = "POST";

            post.Add("immediateReturn", "1");
            post.Add(AmazonHelper.SIGNATURE_VERSION_KEYNAME, AmazonHelper.SIGNATURE_VERSION_2);
            post.Add(AmazonHelper.SIGNATURE_METHOD_KEYNAME, AmazonHelper.HMAC_SHA256_ALGORITHM);
            post.Add("accessKey", SimplePaySettings.AccessKey);
            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "USD {0:0.00}", order.OrderTotal));
            post.Add("description", string.Format("{0}, {1}", IoC.Resolve<ISettingManager>().StoreName, order.OrderId));
            post.Add("amazonPaymentsAccountId", SimplePaySettings.AccountId);
            post.Add("returnUrl", String.Format("{0}AmazonSimplePayReturn.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("processImmediate", (SimplePaySettings.SettleImmediately ? "1" : "0"));
            post.Add("referenceId", order.OrderId.ToString());
            post.Add(AmazonHelper.SIGNATURE_KEYNAME, AmazonHelper.SignParameters(post.Params, SimplePaySettings.SecretKey, post.Method, gatewayUrl.Host, gatewayUrl.AbsolutePath));

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(HostedPaymentSettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "BeanstreamHostedPayment";
            post.Url = gatewayUrl.ToString();
            post.Method = "POST";

            post.Add("requestType", "BACKEND");
            post.Add("merchant_id", HostedPaymentSettings.MerchantId);
            post.Add("trnOrderNumber", order.OrderId.ToString());
            post.Add("trnAmount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("errorPage", String.Format("{0}BeanstreamHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation()));
            post.Add("approvedPage", String.Format("{0}BeanstreamHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation()));

            post.Add("ordName", order.BillingFullName);
            post.Add("ordEmailAddress", order.BillingEmail);
            post.Add("ordPhoneNumber", order.BillingPhoneNumber);
            post.Add("ordAddress1", order.BillingAddress1);
            post.Add("ordPostalCode", order.BillingZipPostalCode);
            post.Add("ordCity", order.BillingCity);
            Country billCountry = CountryManager.GetCountryById(order.BillingCountryId);
            if(billCountry != null)
            {
                post.Add("ordCountry", billCountry.TwoLetterIsoCode);
            }
            StateProvince billState = StateProvinceManager.GetStateProvinceById(order.BillingStateProvinceId);
            if(billState != null)
            {
                post.Add("ordProvince", billState.Abbreviation);
            }

            if(order.ShippingStatus != ShippingStatusEnum.ShippingNotRequired)
            {
                post.Add("shipName", order.ShippingFullName);
                post.Add("shipEmailAddress", order.ShippingEmail);
                post.Add("shipPhoneNumber", order.ShippingPhoneNumber);
                post.Add("shipAddress1", order.ShippingAddress1);
                post.Add("shipPostalCode", order.ShippingZipPostalCode);
                post.Add("shipCity", order.ShippingCity);
                Country shipCountry = CountryManager.GetCountryById(order.ShippingCountryId);
                if(shipCountry != null)
                {
                    post.Add("shipCountry", shipCountry.TwoLetterIsoCode);
                }
                StateProvince shipState = StateProvinceManager.GetStateProvinceById(order.ShippingStateProvinceId);
                if(shipState != null)
                {
                    post.Add("shipProvince", shipState.Abbreviation);
                }
            }

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            string returnURL = CommonHelper.GetStoreLocation(false) + "TwoCheckoutReturn.aspx";

            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "TwoCheckoutForm";
            remotePostHelper.Url = serverURL;

            remotePostHelper.Add("id_type", "1");

            OrderProductVariantCollection orderProductVariants = order.OrderProductVariants;
            for (int i = 0; i < orderProductVariants.Count; i++)
            {
                int pNum = i + 1;
                OrderProductVariant opv = orderProductVariants[i];
                ProductVariant pv = orderProductVariants[i].ProductVariant;
                Product product = pv.Product;

                string c_prod = string.Format("c_prod_{0}", pNum);
                string c_prod_value = string.Format("{0},{1}", pv.SKU, opv.Quantity);
                remotePostHelper.Add(c_prod, c_prod_value);
                string c_name = string.Format("c_name_{0}", pNum);
                string c_name_value = pv.FullProductName;
                string c_attributes = opv.AttributeDescription;
                if (!String.IsNullOrEmpty(c_attributes))
                {
                    c_name_value += c_attributes;
                    c_name_value = c_name_value.Replace("<br />", ". ");
                }
                remotePostHelper.Add(c_name, c_name_value);

                string c_description = string.Format("c_description_{0}", pNum);
                string c_description_value = pv.FullProductName;
                c_description_value = c_description_value.Replace("<br />", ". ");
                remotePostHelper.Add(c_description, c_description_value);

                string c_price = string.Format("c_price_{0}", pNum);
                string c_price_value = opv.UnitPriceInclTax.ToString("####.00", new CultureInfo("en-US", false).NumberFormat);
                remotePostHelper.Add(c_price, c_price_value);

                string c_tangible = string.Format("c_tangible_{0}", pNum);
                string c_tangible_value = "Y";
                if (pv.IsDownload)
                {
                    c_tangible_value = "N";
                }
                remotePostHelper.Add(c_tangible, c_tangible_value);
            }

            remotePostHelper.Add("x_login", vendorID);
            remotePostHelper.Add("x_amount", order.OrderTotal.ToString("####.00", new CultureInfo("en-US", false).NumberFormat));
            //TODO add primary store currency to parameters
            remotePostHelper.Add("x_invoice_num", order.OrderID.ToString());
            //remotePostHelper.Add("x_receipt_link_url", returnURL);
            //remotePostHelper.Add("x_return_url", returnURL);
            //remotePostHelper.Add("x_return", returnURL);
            if (useSandBox)
                remotePostHelper.Add("demo", "Y");
            remotePostHelper.Add("x_First_Name", order.BillingFirstName);
            remotePostHelper.Add("x_Last_Name", order.BillingLastName);
            remotePostHelper.Add("x_Address", order.BillingAddress1);
            remotePostHelper.Add("x_City", order.BillingCity);
            StateProvince billingStateProvince = StateProvinceManager.GetStateProvinceByID(order.BillingStateProvinceID);
            if (billingStateProvince != null)
                remotePostHelper.Add("x_State", billingStateProvince.Abbreviation);
            else
                remotePostHelper.Add("x_State", order.BillingStateProvince);
            remotePostHelper.Add("x_Zip", order.BillingZipPostalCode);
            Country billingCountry = CountryManager.GetCountryByID(order.BillingCountryID);
            if (billingCountry != null)
                remotePostHelper.Add("x_Country", billingCountry.ThreeLetterISOCode);
            else
                remotePostHelper.Add("x_Country", order.BillingCountry);

            remotePostHelper.Add("x_EMail", order.BillingEmail);
            remotePostHelper.Add("x_Phone", order.BillingPhoneNumber);
            remotePostHelper.Post();
            return string.Empty;
        }
        /// <summary>
        /// Sends POST request to the DIBS server with order info
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>String.Empty</returns>
        public string PostProcessPayment(Order order)
        {
            RemotePost post = new RemotePost();

            post.FormName = "FlexWin";
            post.Url = FlexWinSettings.GatewayUrl;
            if(FlexWinSettings.UseSandbox)
            {
                post.Add("test", "yes");
            }
            post.Add("uniqueoid", "yes");

            Language lang = LanguageManager.GetLanguageById(order.CustomerLanguageId);
            int currency = DibsHelper.GetCurrencyNumberByCode(CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
            int amount = (int)((double)order.OrderTotal * 100);
            int merhcantID = FlexWinSettings.MerchantId;

            post.Add("lang", DibsHelper.GetLanguageCodeByLanguageCulture(lang.LanguageCulture));
            post.Add("currency", currency.ToString());
            post.Add("color", FlexWinSettings.ColorTheme);
            post.Add("decorator", FlexWinSettings.Decorator);
            post.Add("merchant", merhcantID.ToString());
            post.Add("orderid", order.OrderId.ToString());
            post.Add("amount", amount.ToString());
            post.Add("md5key", FlexWinHelper.CalcMD5Key(merhcantID, order.OrderId, currency, amount));
            post.Add("accepturl", String.Format("{0}DibsFlexWinReturn.aspx?x={1}", CommonHelper.GetStoreHost(false), order.OrderId));
            post.Add("cancelurl", String.Format("{0}shoppingcart.aspx", CommonHelper.GetStoreHost(false)));
            post.Add("delivery1.Name", order.ShippingFullName);
            post.Add("delivery2.Address", order.ShippingAddress1);

            post.Add("ordline0-1", "SKU");
            post.Add("ordline0-2", "Description");
            post.Add("ordline0-3", "Quantity");
            post.Add("ordline0-4", "Price");

            var products = order.OrderProductVariants;
            for (int i = 0; i < products.Count; i++)
            {
                string lineName = String.Format("ordline{0}", (i + 1));
                ProductVariant pv = products[i].ProductVariant;

                post.Add(lineName + "-1", HttpUtility.HtmlEncode(pv.SKU));
                post.Add(lineName + "-2", HttpUtility.HtmlEncode(pv.LocalizedName));
                post.Add(lineName + "-3", HttpUtility.HtmlEncode(products[i].Quantity.ToString()));
                post.Add(lineName + "-4", pv.Price.ToString(NumberFormatInfo.CurrentInfo));
            }

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            RemotePost post = new RemotePost();

            post.FormName = "CyberSource";
            post.Url = HostedPaymentSettings.GatewayUrl;
            post.Method = "POST";

            post.Add("merchantID", HostedPaymentSettings.MerchantId);
            post.Add("orderPage_timestamp", HostedPaymentHelper.OrderPageTimestamp);
            post.Add("orderPage_transactionType", "authorization");
            post.Add("orderPage_version", "4");
            post.Add("orderPage_serialNumber", HostedPaymentSettings.SerialNumber);

            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("currency", order.CustomerCurrencyCode);
            post.Add("orderNumber", order.OrderId.ToString());

            post.Add("billTo_firstName", order.BillingFirstName);
            post.Add("billTo_lastName", order.BillingLastName);
            post.Add("billTo_street1", order.BillingAddress1);
            Country billCountry = CountryManager.GetCountryById(order.BillingCountryId);
            if(billCountry != null)
            {
                post.Add("billTo_country", billCountry.TwoLetterIsoCode);
            }
            StateProvince billState = StateProvinceManager.GetStateProvinceById(order.BillingStateProvinceId);
            if(billState != null)
            {
                post.Add("billTo_state", billState.Abbreviation);
            }
            post.Add("billTo_city", order.BillingCity);
            post.Add("billTo_postalCode", order.BillingZipPostalCode);
            post.Add("billTo_phoneNumber", order.BillingPhoneNumber);
            post.Add("billTo_email", order.BillingEmail);

            if (order.ShippingStatus != ShippingStatusEnum.ShippingNotRequired)
            {
                post.Add("shipTo_firstName", order.ShippingFirstName);
                post.Add("shipTo_lastName", order.ShippingLastName);
                post.Add("shipTo_street1", order.ShippingAddress1);
                Country shipCountry = CountryManager.GetCountryById(order.ShippingCountryId);
                if (shipCountry != null)
                {
                    post.Add("shipTo_country", shipCountry.TwoLetterIsoCode);
                }
                StateProvince shipState = StateProvinceManager.GetStateProvinceById(order.ShippingStateProvinceId);
                if (shipState != null)
                {
                    post.Add("shipTo_state", shipState.Abbreviation);
                }
                post.Add("shipTo_city", order.ShippingCity);
                post.Add("shipTo_postalCode", order.ShippingZipPostalCode);
            }

            post.Add("orderPage_receiptResponseURL", String.Format("{0}CheckoutCompleted.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("orderPage_receiptLinkText", "Return");

            post.Add("orderPage_signaturePublic", HostedPaymentHelper.CalcRequestSign(post.Params));

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            string validUntil = DateTime.UtcNow.ToString("o", new CultureInfo("en-us"));
            RemotePost remotePostHelper = new RemotePost
            {
                FormName = "IdealCheckoutForm",
                Url = iDealBasicPaymentSettings.Url
            };

            remotePostHelper.Add("urlCancel", CommonHelper.GetStoreLocation(false) + "idealreturn.aspx?s=1&o=" + order.OrderId);
            remotePostHelper.Add("urlSuccess", CommonHelper.GetStoreLocation(false) + "checkoutcompleted.aspx");
            remotePostHelper.Add("urlError", CommonHelper.GetStoreLocation(false) + "idealreturn.aspx?s=2&o=" + order.OrderId);

            remotePostHelper.Add("merchantID", iDealBasicPaymentSettings.MerchantId);
            remotePostHelper.Add("subID", iDealBasicPaymentSettings.SubId);
            remotePostHelper.Add("description", "Order " + order.OrderId);

            remotePostHelper.Add("language", "nl");
            remotePostHelper.Add("currency", CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
            remotePostHelper.Add("paymentType", "ideal");

            remotePostHelper.Add("purchaseID", order.OrderId.ToString());
            remotePostHelper.Add("amount", ((int)(order.OrderTotal * 100)).ToString());
            remotePostHelper.Add("validUntil", validUntil);

            StringBuilder hasString = new StringBuilder(iDealBasicPaymentSettings.HashKey);
            hasString.Append(iDealBasicPaymentSettings.MerchantId);
            hasString.Append(iDealBasicPaymentSettings.SubId);
            hasString.Append(((int)(order.OrderTotal * 100)).ToString());
            hasString.Append(order.OrderId.ToString());
            hasString.Append("ideal");
            hasString.Append(validUntil);
            ulong aantal = 0;
            int price = 0;
            int i = 1;
            foreach (OrderProductVariant product in order.OrderProductVariants)
            {
                hasString.Append(product.ProductVariantId.ToString());
                remotePostHelper.Add("itemNumber" + i, product.ProductVariantId.ToString());

                if (!string.IsNullOrEmpty(product.ProductVariant.Product.LocalizedShortDescription))
                {
                    string shortDescription = HttpUtility.UrlEncode(product.ProductVariant.Product.LocalizedShortDescription);
                    remotePostHelper.Add("itemDescription" + i, shortDescription);
                    hasString.Append(shortDescription);
                }
                else
                {
                    string fullProductName = HttpUtility.UrlEncode(product.ProductVariant.LocalizedFullProductName);
                    remotePostHelper.Add("itemDescription" + i, fullProductName);
                    hasString.Append(fullProductName);
                }
                int itemPrice = ((int)(product.PriceExclTax * 100)) / product.Quantity;
                remotePostHelper.Add("itemQuantity" + i, product.Quantity.ToString());
                remotePostHelper.Add("itemPrice" + i, itemPrice.ToString());

                hasString.Append(product.Quantity.ToString());
                hasString.Append(itemPrice.ToString());

                aantal += (ulong)product.Quantity;
                price += (int)(product.PriceExclTax * 100);
                i++;
            }

            decimal orderShippingPrice = order.OrderShippingExclTax;
            if (orderShippingPrice > 0)
            {
                price += (int)(orderShippingPrice * 100);

                remotePostHelper.Add("itemNumber" + i, "zending");
                remotePostHelper.Add("itemDescription" + i, "Verzend kosten");
                remotePostHelper.Add("itemQuantity" + i, "1");
                remotePostHelper.Add("itemPrice" + i, ((int)(orderShippingPrice * 100)).ToString());

                hasString.Append("zending");
                hasString.Append("Verzend kosten");
                hasString.Append(1);
                hasString.Append(((int)(orderShippingPrice * 100)).ToString());
                aantal++;
                i++;
            }

            // Add additional handling fee
            if (order.PaymentMethodAdditionalFeeExclTax > 0)
            {
                price += (int)(order.PaymentMethodAdditionalFeeExclTax * 100);

                remotePostHelper.Add("itemNumber" + i, "administratiekosten");
                remotePostHelper.Add("itemDescription" + i, "Administratiekosten");
                remotePostHelper.Add("itemQuantity" + i, "1");
                remotePostHelper.Add("itemPrice" + i, ((int)(order.PaymentMethodAdditionalFeeExclTax * 100)).ToString());

                hasString.Append("administratiekosten");
                hasString.Append("Administratiekosten");
                hasString.Append(1);
                hasString.Append(((int)(order.PaymentMethodAdditionalFeeExclTax * 100)).ToString());
                aantal++;
                i++;
            }

            // Add Taxes
            if (order.OrderTax > 0)
            {
                price += (int)(order.OrderTax * 100);

                remotePostHelper.Add("itemNumber" + i, "belasting");
                remotePostHelper.Add("itemDescription" + i, "Belasting");
                remotePostHelper.Add("itemQuantity" + i, "1");
                remotePostHelper.Add("itemPrice" + i, ((int)(order.OrderTax * 100)).ToString());

                hasString.Append("belasting");
                hasString.Append("Belasting");
                hasString.Append(1);
                hasString.Append(((int)(order.OrderTax * 100)).ToString());
                aantal++;
                i++;
            }

            if ((int)(order.OrderTotal * 100) != price)
            {
                int currencyconversion = (int)(order.OrderTotal * 100) - price;

                remotePostHelper.Add("itemNumber" + i, "currencyconversion");
                remotePostHelper.Add("itemDescription" + i, "currencyConversion");
                remotePostHelper.Add("itemQuantity" + i, "1");
                remotePostHelper.Add("itemPrice" + i, currencyconversion.ToString());

                hasString.Append("currencyconversion");
                hasString.Append("currencyConversion");
                hasString.Append(1);
                hasString.Append(currencyconversion.ToString());
                aantal++;
            }

            // Generate Sha1
            hasString = hasString.Replace(" ", string.Empty).Replace("\t", string.Empty).Replace("\n", string.Empty);
            string hashString = BitConverter.ToString(SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes(hasString.ToString())));
            hashString = hashString.Replace("-", string.Empty).ToLower();
            remotePostHelper.Add("hash", hashString);

            // Do post if needed
            if (aantal != 0 && price != 0)
            {
                remotePostHelper.Post();
            }

            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            string returnURL = CommonHelper.GetStoreLocation(false) + "WorldpayReturn.aspx";

            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "WorldpayForm";
            remotePostHelper.Url = GetWorldpayUrl();

            remotePostHelper.Add("instId", instanceID);
            remotePostHelper.Add("cartId", order.OrderId.ToString());

            if (!string.IsNullOrEmpty(IoC.Resolve<ISettingManager>().GetSettingValue(WorldpayConstants.SETTING_CREDITCARD_CODE_PROPERTY)))
            {
                remotePostHelper.Add("paymentType", IoC.Resolve<ISettingManager>().GetSettingValue(WorldpayConstants.SETTING_CREDITCARD_CODE_PROPERTY));
            }

            if (!string.IsNullOrEmpty(IoC.Resolve<ISettingManager>().GetSettingValue(WorldpayConstants.SETTING_WorldPayCSSName)))
            {
                remotePostHelper.Add("MC_WorldPayCSSName", IoC.Resolve<ISettingManager>().GetSettingValue(WorldpayConstants.SETTING_WorldPayCSSName));
            }

            remotePostHelper.Add("currency", IoC.Resolve<ICurrencyService>().PrimaryStoreCurrency.CurrencyCode);
            remotePostHelper.Add("email", order.BillingEmail);
            remotePostHelper.Add("hideContact", "true");
            remotePostHelper.Add("noLanguageMenu", "true");
            remotePostHelper.Add("withDelivery", "true");
            remotePostHelper.Add("fixContact", "false");
            remotePostHelper.Add("amount", order.OrderTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
            remotePostHelper.Add("desc", IoC.Resolve<ISettingManager>().StoreName);
            remotePostHelper.Add("M_UserID", order.CustomerId.ToString());
            remotePostHelper.Add("M_FirstName", order.BillingFirstName);
            remotePostHelper.Add("M_LastName", order.BillingLastName);
            remotePostHelper.Add("M_Addr1", order.BillingAddress1);
            remotePostHelper.Add("tel", order.BillingPhoneNumber);
            remotePostHelper.Add("M_Addr2", order.BillingAddress2);
            remotePostHelper.Add("M_Business", order.BillingCompany);

            CultureInfo cultureInfo = new CultureInfo(NopContext.Current.WorkingLanguage.LanguageCulture);
            remotePostHelper.Add("lang", cultureInfo.TwoLetterISOLanguageName);

            StateProvince billingStateProvince = IoC.Resolve<IStateProvinceService>().GetStateProvinceById(order.BillingStateProvinceId);
            if (billingStateProvince != null)
                remotePostHelper.Add("M_StateCounty", billingStateProvince.Abbreviation);
            else
                remotePostHelper.Add("M_StateCounty", order.BillingStateProvince);
            if (!useSandBox)
                remotePostHelper.Add("testMode", "0");
            else
                remotePostHelper.Add("testMode", "100");
            remotePostHelper.Add("postcode", order.BillingZipPostalCode);
            Country billingCountry = IoC.Resolve<ICountryService>().GetCountryById(order.BillingCountryId);
            if (billingCountry != null)
                remotePostHelper.Add("country", billingCountry.TwoLetterIsoCode);
            else
                remotePostHelper.Add("country", order.BillingCountry);

            remotePostHelper.Add("address", order.BillingAddress1 + "," + order.BillingCountry);
            remotePostHelper.Add("MC_callback", returnURL);
            remotePostHelper.Add("name", order.BillingFirstName + " " + order.BillingLastName);

            if (order.ShippingStatus != ShippingStatusEnum.ShippingNotRequired)
            {
                remotePostHelper.Add("delvName", order.ShippingFullName);
                string delvAddress = order.ShippingAddress1;
                delvAddress += (!string.IsNullOrEmpty(order.ShippingAddress2)) ? " " + order.ShippingAddress2 : string.Empty;
                remotePostHelper.Add("delvAddress", delvAddress);
                remotePostHelper.Add("delvPostcode", order.ShippingZipPostalCode);
                Country shippingCountry = IoC.Resolve<ICountryService>().GetCountryById(order.ShippingCountryId);
                remotePostHelper.Add("delvCountry", shippingCountry.TwoLetterIsoCode);
            }

            remotePostHelper.Post();
            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            CultureInfo cultureInfo = new CultureInfo(NopContext.Current.WorkingLanguage.LanguageCulture);

            string language = cultureInfo.TwoLetterISOLanguageName;
            string amount = (order.OrderTotal * 100).ToString("0", CultureInfo.InvariantCulture); //NOTE: Primary store should be changed to DKK, if you do not have internatinal agreement with pbs and quickpay. Otherwise you need to do currency conversion here.

            string currencyCode = CurrencyManager.PrimaryStoreCurrency.CurrencyCode; //NOTE: Primary store should be changed to DKK, if you do not have internatinal agreement with pbs and quickpay. Otherwise you need to do currency conversion here.
            string protocol = "3";
            string autocapture = "0";
            string cardtypelock = SettingManager.GetSettingValue(QuickPayConstants.SETTING_CREDITCARD_CODE_PROPERTY, "dankort");
            bool useSandBox = SettingManager.GetSettingValueBoolean(QuickPayConstants.SETTING_USE_SANDBOX);
            string testmode = (useSandBox) ? "1" : "0";
            string continueurl = CommonHelper.GetStoreLocation(false) + "CheckoutCompleted.aspx";
            string cancelurl = CommonHelper.GetStoreLocation(false) + "QuickpayCancel.aspx";
            string callbackurl = CommonHelper.GetStoreLocation(false) + "QuickpayReturn.aspx";
            string merchant = SettingManager.GetSettingValue(QuickPayConstants.SETTING_MERCHANTID);
            string ipaddress = NopContext.Current.UserHostAddress;
            string msgtype = "authorize";
            string md5secret = SettingManager.GetSettingValue(QuickPayConstants.SETTING_MD5SECRET);
            string ordernumber = FormatOrderNumber(order.OrderId.ToString());

            string stringToMd5 = string.Concat(protocol, msgtype, merchant,
                language, ordernumber, amount, currencyCode, continueurl,
                cancelurl, callbackurl, autocapture, cardtypelock,
                ipaddress, testmode, md5secret);
            string md5check = GetMD5(stringToMd5);

            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "QuickPay";
            remotePostHelper.Url = "https://secure.quickpay.dk/form/";
            remotePostHelper.Add("protocol", protocol);
            remotePostHelper.Add("msgtype", msgtype);
            remotePostHelper.Add("merchant", merchant);
            remotePostHelper.Add("language", language);
            remotePostHelper.Add("ordernumber", ordernumber);
            remotePostHelper.Add("amount", amount);
            remotePostHelper.Add("currency", currencyCode);
            remotePostHelper.Add("continueurl", continueurl);
            remotePostHelper.Add("cancelurl", cancelurl);
            remotePostHelper.Add("callbackurl", callbackurl);
            remotePostHelper.Add("autocapture", autocapture);
            remotePostHelper.Add("cardtypelock", cardtypelock);
            remotePostHelper.Add("testmode", testmode);
            remotePostHelper.Add("ipaddress", ipaddress);
            remotePostHelper.Add("md5check", md5check);

            remotePostHelper.Post();
            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            //string gateway = "https://www.alipay.com/cooperate/gateway.do?";
            string service = "create_direct_pay_by_user";

            string seller_email = IoC.Resolve<ISettingManager>().GetSettingValue("PaymentMethod.Alipay.SellerEmail");
            string sign_type = "MD5";
            string key = IoC.Resolve<ISettingManager>().GetSettingValue("PaymentMethod.Alipay.Key");
            string partner = IoC.Resolve<ISettingManager>().GetSettingValue("PaymentMethod.Alipay.Partner");
            string input_charset = "utf-8";

            string show_url = "http://www.alipay.com/";

            string out_trade_no = order.OrderId.ToString();
            string subject = IoC.Resolve<ISettingManager>().StoreName;
            string body = "Order from " + IoC.Resolve<ISettingManager>().StoreName;
            string total_fee = order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);

            string notify_url = CommonHelper.GetStoreLocation() + "Alipay_Notify.aspx";
            string return_url = CommonHelper.GetStoreLocation() + "Alipay_Return.aspx";
            string[] para ={
                               "service="+service,
                               "partner=" + partner,
                               "seller_email=" + seller_email,
                               "out_trade_no=" + out_trade_no,
                               "subject=" + subject,
                               "body=" + body,
                               "total_fee=" + total_fee,
                               "show_url=" + show_url,
                               "payment_type=1",
                               "notify_url=" + notify_url,
                               "return_url=" + return_url,
                               "_input_charset=" + input_charset
                           };

            string aliay_url = CreatUrl(
                para,
                input_charset,
                key
                );
            RemotePost post = new RemotePost();
            post.FormName = "alipaysubmit";
            post.Url = "https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8";
            post.Method = "POST";

            post.Add("service", service);
            post.Add("partner", partner);
            post.Add("seller_email", seller_email);
            post.Add("out_trade_no", out_trade_no);
            post.Add("subject", subject);
            post.Add("body", body);
            post.Add("total_fee", total_fee);
            post.Add("show_url", show_url);
            post.Add("return_url", return_url);
            post.Add("notify_url", notify_url);
            post.Add("payment_type", "1");
            post.Add("sign", aliay_url);
            post.Add("sign_type", sign_type);

            post.Post();

            return String.Empty;
        }
 public static string CalcRequestSign(RemotePost post)
 {
     return CalcMD5Hash(String.Format("{0}{1}{2}", post.Params["trans_id"], post.Params["amount"], HostedPaymentSettings.RemotePassword));
 }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(HostedPaymentSettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "ChronoPay";
            post.Url = gatewayUrl.ToString();
            post.Method = "POST";

            post.Add("product_id", HostedPaymentSettings.ProductId);
            post.Add("product_name", HostedPaymentSettings.ProductName);
            post.Add("product_price", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("product_price_currency", order.CustomerCurrencyCode);
            post.Add("cb_url", String.Format("{0}ChronoPayIPNHandler.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("cb_type", "P");
            post.Add("cs1", order.OrderId.ToString());
            post.Add("f_name", order.BillingFirstName);
            post.Add("s_name", order.BillingLastName);
            post.Add("street", order.BillingAddress1);
            post.Add("city", order.BillingCity);
            post.Add("zip", order.BillingZipPostalCode);
            post.Add("phone", order.BillingPhoneNumber);
            post.Add("email", order.BillingEmail);

            StateProvince state = StateProvinceManager.GetStateProvinceById(order.BillingStateProvinceId);
            if(state != null)
            {
                post.Add("state", state.Abbreviation);
            }

            Country country = CountryManager.GetCountryById(order.BillingCountryId);
            if(country != null)
            {
                post.Add("country", country.ThreeLetterIsoCode);
            }

            post.Add("sign", HostedPaymentHelper.CalcRequestSign(post.Params));

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            Uri gatewayUrl = new Uri(EPaymentFormSettings.GatewayUrl);

            RemotePost post = new RemotePost();

            post.FormName = "ePaymentForm";
            post.Url = gatewayUrl.ToString();
            post.Method = "POST";

            post.Add("UMkey", EPaymentFormSettings.SourceKey);
            post.Add("UMcommand", (EPaymentFormSettings.AuthorizeOnly ? "authonly" : "sale"));
            post.Add("UMamount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("UMcurrency", CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
            post.Add("UMinvoice", String.Format("{0:0000000000}", order.OrderId));
            post.Add("UMredirApproved", String.Format("{0}USAePayEPaymentFormReturn.aspx", CommonHelper.GetStoreLocation(false)));
            post.Add("UMemail", order.BillingEmail);

            post.Add("UMbillfname", order.BillingFirstName);
            post.Add("UMbilllname", order.BillingLastName);
            post.Add("UMbillcompany", order.BillingCompany);
            post.Add("UMbillstreet", order.BillingAddress1);
            post.Add("UMbillstreet2", order.BillingAddress2);
            post.Add("UMbillcity", order.BillingCity);
            post.Add("UMbillstate", order.BillingStateProvince);
            post.Add("UMbillzip", order.BillingZipPostalCode);
            post.Add("UMbillcountry", order.BillingCountry);
            post.Add("UMbillphone", order.BillingPhoneNumber);

            post.Add("UMshipfname", order.ShippingFirstName);
            post.Add("UMshiplname", order.ShippingLastName);
            post.Add("UMshipcompany", order.ShippingCompany);
            post.Add("UMshipstreet", order.ShippingAddress1);
            post.Add("UMshipstreet2", order.ShippingAddress2);
            post.Add("UMshipcity", order.ShippingCity);
            post.Add("UMshipstate", order.ShippingStateProvince);
            post.Add("UMshipzip", order.ShippingZipPostalCode);
            post.Add("UMshipcountry", order.ShippingCountry);
            post.Add("UMshipphone", order.ShippingPhoneNumber);

            if(EPaymentFormSettings.UsePIN)
            {
                post.Add("UMhash", EPaymentFormHelper.CalcRequestSign(post.Params));
            }

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            //Notificación On-Line
            string strDs_Merchant_MerchantURL = Common.Utils.CommonHelper.GetStoreLocation(false) + "SermepaReturn.aspx";

            //URL OK
            string strDs_Merchant_UrlOK = Common.Utils.CommonHelper.GetStoreLocation(false) + "CheckoutCompleted.aspx";

            //URL KO
            string strDs_Merchant_UrlKO = Common.Utils.CommonHelper.GetStoreLocation(false) + "SermepaError.aspx";

            //Numero de pedido
            string strDs_Merchant_Order = order.OrderId.ToString();

            //Nombre del comercio
            string strDs_Merchant_MerchantName = SettingManager.GetSettingValue("PaymentMethod.Sermepa.NombreComercio");

            //Importe
            string amount = ((int)Convert.ToInt64(order.OrderTotal * 100)).ToString();
            string strDs_Merchant_Amount = amount;

            //Código de comercio
            string strDs_Merchant_MerchantCode = SettingManager.GetSettingValue("PaymentMethod.Sermepa.FUC");

            //Moneda
            string strDs_Merchant_Currency = SettingManager.GetSettingValue("PaymentMethod.Sermepa.Moneda");

            //Terminal
            string strDs_Merchant_Terminal = SettingManager.GetSettingValue("PaymentMethod.Sermepa.Terminal");

            //Tipo de transaccion (0 - Autorización)
            string strDs_Merchant_TransactionType = "0";

            //Clave
            string clave = "";
            if (pruebas)
            {
                clave = SettingManager.GetSettingValue("PaymentMethod.Sermepa.ClavePruebas");
            }
            else
            {
                clave = SettingManager.GetSettingValue("PaymentMethod.Sermepa.ClaveReal");
            };

            //Calculo de la firma
            string SHA = string.Format("{0}{1}{2}{3}{4}{5}{6}",
                strDs_Merchant_Amount,
                strDs_Merchant_Order,
                strDs_Merchant_MerchantCode,
                strDs_Merchant_Currency,
                strDs_Merchant_TransactionType,
                strDs_Merchant_MerchantURL,
                clave);

            byte[] SHAresult;
            SHA1 shaM = new SHA1Managed();
            SHAresult = shaM.ComputeHash(System.Text.Encoding.Default.GetBytes(SHA));
            string SHAresultStr = BitConverter.ToString(SHAresult).Replace("-", "");

            //Creamos el POST
            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "form1";
            remotePostHelper.Url = GetSermepaUrl();

            remotePostHelper.Add("Ds_Merchant_Amount", strDs_Merchant_Amount);
            remotePostHelper.Add("Ds_Merchant_Currency", strDs_Merchant_Currency);
            remotePostHelper.Add("Ds_Merchant_Order", strDs_Merchant_Order);
            remotePostHelper.Add("Ds_Merchant_MerchantCode", strDs_Merchant_MerchantCode);
            remotePostHelper.Add("Ds_Merchant_TransactionType", strDs_Merchant_TransactionType);
            remotePostHelper.Add("Ds_Merchant_MerchantURL", strDs_Merchant_MerchantURL);
            remotePostHelper.Add("Ds_Merchant_MerchantSignature", SHAresultStr);
            remotePostHelper.Add("Ds_Merchant_Terminal", strDs_Merchant_Terminal);
            remotePostHelper.Add("Ds_Merchant_MerchantName", strDs_Merchant_MerchantName);
            remotePostHelper.Add("Ds_Merchant_UrlOK", strDs_Merchant_UrlOK);
            remotePostHelper.Add("Ds_Merchant_UrlKO", strDs_Merchant_UrlKO);

            remotePostHelper.Post();

            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            RemotePost post = new RemotePost();

            post.FormName = "AssistPaymentForm";
            post.Url = HostedPaymentSettings.GatewayUrl;
            post.Method = "POST";

            post.Add("Shop_IDP", HostedPaymentSettings.ShopId);
            post.Add("Order_IDP", order.OrderId.ToString());
            post.Add("Subtotal_P", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));

            post.Add("Currency", IoC.Resolve<ICurrencyService>().PrimaryStoreCurrency.CurrencyCode);
            post.Add("Delay", HostedPaymentSettings.AuthorizeOnly ? "1" : "0");
            post.Add("URL_RETURN", CommonHelper.GetStoreLocation(false));
            post.Add("URL_RETURN_OK", String.Format("{0}AssistHostedPaymentReturn.aspx", CommonHelper.GetStoreLocation(false)));

            post.Add("FirstName", order.BillingFirstName);
            post.Add("LastName", order.BillingLastName);
            post.Add("Email", order.BillingEmail);
            post.Add("Address", order.BillingAddress1);
            post.Add("City", order.BillingCity);
            post.Add("Zip", order.BillingZipPostalCode);
            post.Add("Phone", order.BillingPhoneNumber);

            StateProvince state = IoC.Resolve<IStateProvinceService>().GetStateProvinceById(order.BillingStateProvinceId);
            if(state != null)
            {
                post.Add("State", state.Abbreviation);
            }

            Country country = IoC.Resolve<ICountryService>().GetCountryById(order.BillingCountryId);
            if(country != null)
            {
                post.Add("Country", country.ThreeLetterIsoCode);
            }

            if(HostedPaymentSettings.TestMode)
            {
                post.Add("DemoResult", "AS000");
            }

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            InitSettings();

            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "CCAvenueForm";
            remotePostHelper.Url = _payURI;
            remotePostHelper.Add("Merchant_Id", _merchantID.ToString());
            remotePostHelper.Add("Amount", order.OrderTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
            remotePostHelper.Add("Currency", CurrencyManager.PrimaryStoreCurrency.CurrencyCode);
            remotePostHelper.Add("Order_Id", order.OrderId.ToString());
            remotePostHelper.Add("Redirect_Url", CommonHelper.GetStoreLocation(false) + "CCAvenueReturn.aspx");
            remotePostHelper.Add("Checksum", _myUtility.getchecksum(_merchantID.ToString(), order.OrderId.ToString(), order.OrderTotal.ToString(), CommonHelper.GetStoreLocation(false) + "CCAvenueReturn.aspx", _key));

            //Billing details
            remotePostHelper.Add("billing_cust_name", order.BillingFirstName);
            remotePostHelper.Add("billing_cust_address", order.BillingAddress1);
            remotePostHelper.Add("billing_cust_tel", order.BillingPhoneNumber);
            remotePostHelper.Add("billing_cust_email", order.BillingEmail);
            remotePostHelper.Add("billing_cust_city", order.BillingCity);
            StateProvince billingStateProvince = StateProvinceManager.GetStateProvinceById(order.BillingStateProvinceId);
            if (billingStateProvince != null)
                remotePostHelper.Add("billing_cust_state", billingStateProvince.Abbreviation);
            else
                remotePostHelper.Add("billing_cust_state", order.BillingStateProvince);
            remotePostHelper.Add("billing_zip_code", order.BillingZipPostalCode);
            Country billingCountry = CountryManager.GetCountryById(order.BillingCountryId);
            if (billingCountry != null)
                remotePostHelper.Add("billing_cust_country", billingCountry.ThreeLetterIsoCode);
            else
                remotePostHelper.Add("billing_cust_country", order.BillingCountry);

            //Delivery details

            if (order.ShippingStatus != ShippingStatusEnum.ShippingNotRequired)
            {
                remotePostHelper.Add("delivery_cust_name", order.ShippingFirstName);
                remotePostHelper.Add("delivery_cust_address", order.ShippingAddress1);
                remotePostHelper.Add("delivery_cust_notes", string.Empty);
                remotePostHelper.Add("delivery_cust_tel", order.ShippingPhoneNumber);
                remotePostHelper.Add("delivery_cust_city", order.ShippingCity);
                StateProvince deliveryStateProvince = StateProvinceManager.GetStateProvinceById(order.ShippingStateProvinceId);
                if (deliveryStateProvince != null)
                    remotePostHelper.Add("delivery_cust_state", deliveryStateProvince.Abbreviation);
                else
                    remotePostHelper.Add("delivery_cust_state", order.ShippingStateProvince);
                remotePostHelper.Add("delivery_zip_code", order.ShippingZipPostalCode);
                Country deliveryCountry = CountryManager.GetCountryById(order.ShippingCountryId);
                if (deliveryCountry != null)
                    remotePostHelper.Add("delivery_cust_country", deliveryCountry.ThreeLetterIsoCode);
                else
                    remotePostHelper.Add("delivery_cust_country", order.ShippingCountry);
            }

            remotePostHelper.Add("Merchant_Param", _merchantParam);
            remotePostHelper.Post();
            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            if (string.IsNullOrEmpty(vendorName))
                throw new NopException("SagePay VendorDescription is not set");
            if (string.IsNullOrEmpty(vendorDescription))
                throw new NopException("SagePay VendorDescription is not set");

            RemotePost remotePostHelper = new RemotePost();
            remotePostHelper.FormName = "SagePayForm";
            remotePostHelper.Url = GetSagePayUrl();

            remotePostHelper.Add("VPSProtocol", protocolNumber);
            remotePostHelper.Add("TxType", transactionType);
            remotePostHelper.Add("Vendor", vendorName);
            remotePostHelper.Add("Crypt", GenerateCryptField(order));
            remotePostHelper.Post();
            return string.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        public string PostProcessPayment(Order order)
        {
            RemotePost post = new RemotePost();

            post.FormName = "MonerisHostedPayment";
            post.Url = HostedPaymentSettings.GatewayUrl;
            post.Method = "POST";

            post.Add("hpp_id", HostedPaymentSettings.HppId);
            post.Add("hpp_key", HostedPaymentSettings.HppKey);
            post.Add("amount", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", order.OrderTotal));
            post.Add("order_no", order.OrderGuid.ToString());

            post.Post();

            return String.Empty;
        }
        /// <summary>
        /// Post process payment (payment gateways that require redirecting)
        /// </summary>
        /// <param name="order">Order</param>
        /// <returns>The error status, or String.Empty if no errors</returns>
        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", IoC.Resolve<ISettingManager>().StoreName);
            remotePostHelper.Add("transaction_id", order.OrderId.ToString());
            remotePostHelper.Add("cancel_url", CommonHelper.GetStoreLocation(false));
            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)
            remotePostHelper.Add("language", "EN");
            remotePostHelper.Add("amount", order.OrderTotal.ToString(new CultureInfo("en-US", false).NumberFormat));
            remotePostHelper.Add("currency", IoC.Resolve<ICurrencyService>().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 = IoC.Resolve<IStateProvinceService>().GetStateProvinceById(order.BillingStateProvinceId);
            if (billingStateProvince != null)
                remotePostHelper.Add("state", billingStateProvince.Abbreviation);
            else
                remotePostHelper.Add("state", order.BillingStateProvince);
            Country billingCountry = IoC.Resolve<ICountryService>().GetCountryById(order.BillingCountryId);
            if (billingCountry != null)
                remotePostHelper.Add("country", billingCountry.ThreeLetterIsoCode);
            else
                remotePostHelper.Add("country", order.BillingCountry);
            remotePostHelper.Post();
            return string.Empty;
        }