When a customer of your website makes a payment, all payments are issued in the default currency of your site. Even if the customer selected a custom currency, when the payment is issued, it is in the default currency. The conversion between the selected currency and the default currency is calculated according to the exchange rates you set when you configure currencies. For more information, see Currencies.
To enable your customers to make payments in a currency other than the default one, you do so by overriding the way a payment request is created.
NOTE: If you, as a merchant, want to receive 10 USD for an item and configured the Euro as a currency with exchange rate 0.9 (1 USD = 0.9 Euro), then, if you enable customers to pay in the selected Euro currency, a payment request for 9 euro is issued. If you request afterwards this amount from the payment provider in USD, it is possible that the currency is converted using a different exchange rate, which may be lower – for example, 0.88 (1 USD = 0.92 Euro). As a result, you receive only 9.78 USD instead of the desired 10 USD. Therefore, you need to be aware of these currency deviations when configuring currencies and determining the exchange rate you set for a currency.
IMPORTANT: Some payment providers may not support all kind of currencies used for the particular payment operation. This is risky, as these transactions will be issued with the default currency and not with the default amount price of the order. Before performing any payment transaction, you must verify that the selected payment provider supports the selected currency. For more information, see Change currency in payment requests for PayPal Standard and WorldPay providers.
To enable customers to make payments in non-default currencies, you override the default payment currency. The following example demonstrates how to override the default way a payment request is created.
Create a class, inheriting from the default OrderProcessor class:
CustomCurrencyOrderProcessor : OrderProcessor
Since the OrderProcessor class has only one public constructor accepting an instance of the OrdersManager, you create a constructor that accepts this instance and passes it to the base class. Next, you override the method that is responsible for creating a payment request:
PaymentRequest InitializePaymentRequest(Order order, CreditCardInfo creditCardInfo, Customer customer, Guid? paymentMethodId,
var payment =
.InitializePaymentRequest(order, creditCardInfo, customer, paymentMethodId, gatewayRedirectSuccessUrl, gatewayRedirectCancelUrl, gatewayNotificationUrl);
payment.CurrencyCode = order.Currency;
payment.Amount = order.ExchangeRateTotal;
payment.ShippingAmount = order.ExchangeRateShippingTotal;
payment.SubtotalAmount = order.ExchangeRateSubTotalDisplay;
payment.TaxAmount = order.ExchangeRateTax;
var countries = Config.Get<LocationsConfig>().Countries;
var country = countries.Values.FirstOrDefault(x => x.CurrencyIsoCode == payment.CurrencyCode);
payment.CurrencyCodeNumeric = country !=
? country.CurrencyIsoNumericCode.ToString() :
The method above accepts the order, for which a payment is created. The order has the following 5 sets of properties in both the default and the currently selected currency:
By default, for each of properties above, the first set of properties is used. For example, Total and Tax. To create the payment request in the custom currency, you need to use the second set of sub-properties since each order has different values for both the default and the currently selected currency. For example, ExchangeRateTotal and ExchangeRateTax. Values are calculated based on the exchange rate you configured for this currency. The following method creates a payment request in the custom currency, that is, the currency you selected. To do so, you register the CustomCurrencyOrderProcessor as the default OrderProcessor using the ObjectFactory:
Global : System.Web.HttpApplication
sender, EventArgs e)
Bootstrapper.Initialized += Bootstrapper_Initialized;
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
In case you select PayPal Standard or WorldPay providers for payment methods, you need to apply additional code transformations because the parameters constructed for these two providers are updated if the selected currency is different than the default one. You are not required to apply these code changes when working with any of the other payment providers.
To apply the code changes, add the following code snippet into your SitefinityWebApp project:
MultiCurrencyPayPalStandardProvider : PayPalStandardProvider
NameValueCollection GetPostValues(IPaymentRequest data)
var baseValues =
, baseValues, data);
MultiCurrencyWorldPayProvider : WorldPayProvider
key, NameValueCollection baseValues, IPaymentRequest data)
NumberFormatInfo nfi =
var order = OrdersManager.GetManager().GetOrder(data.OrderID);
itemNumber = 0;
i = 0; i < order.Details.Count; i++)
itemNumber = i + 1;
(order.DefaultCurrency != order.Currency)
var exchangedPrice = ConvertAndRoundPrice(order.Details[i].Price);
baseValues[key + itemNumber] = exchangedPrice.ToString(
EcommerceExchangeRateConverter().ConvertPrice(amount), 2, MidpointRounding.AwayFromZero);
In the code above, you set the proper price amount of the order as per the currency value of the selected payment provider.
As a final step, you need to register the providers listed above in the Sitefinity system.
IMPORTANT: To register the provider, you need to build your project first.
To register your provider:
Back To Top