Worldpay Currency Issue

Hello,

I have a shop with two available currency (USD anf GBP) and I'm experiencing a problem with Worldpay for two reasons :

1) In the cs-cart payment page for worldpay I can set just one currency (in my case GBP), so if a customer buy in USD a sort of conversion is made by Worldpay, whereas I would like to process the orders using my own conversion rate

2)In the Worldpay payment page the customer can change the currency using a drop down list.

I have found this article from Worlpay to make the drop down list invisible (to solve the sencond issue).

They say to add this hidden field

http://support.worldpay.com/support/kb/bg/customisingadvanced/custa7604.html

I have opened the worldpay.php script, but I'm not sure how to pass this parameter.

Add a field in the data array like this ?

'hideCurrency' => true,

Another interesting line of code is the $signature where there is the code $processor_data['processor_params']['currency']. Probably it is possible to change the currency with the order curency ?

Anyone have already solved this issue ?

Thanks

Hello,

I have a shop with two available currency (USD anf GBP) and I'm experiencing a problem with Worldpay for two reasons :

1) In the cs-cart payment page for worldpay I can set just one currency (in my case GBP), so if a customer buy in USD a sort of conversion is made by Worldpay, whereas I would like to process the orders using my own conversion rate

2)In the Worldpay payment page the customer can change the currency using a drop down list.

I have found this article from Worlpay to make the drop down list invisible (to solve the sencond issue).

They say to add this hidden field

http://support.worldpay.com/support/kb/bg/customisingadvanced/custa7604.html

I have opened the worldpay.php script, but I'm not sure how to pass this parameter.

Add a field in the data array like this ?

'hideCurrency' => true,

Another interesting line of code is the $signature where there is the code $processor_data['processor_params']['currency']. Probably it is possible to change the currency with the order curency ?

Anyone have already solved this issue ?

The currency selected on the payment method settings page should be equal your base currency. No recalculations are made on the CS-Cart side. It always sends all amounts in the base currency only even the secondary currency is selected.

This setting is required due to the reason that different payment systems use different currency formats. For example, you use USD for the dollars in the store, but payment system my require 840 value for this currency.

And yes, this code is correct:

'hideCurrency' => true, 

The system will generate form from this array with order data

Hi,

yes I have just added the hideCurrency parameter and works well.

Then I tried to get inspiration from a piece of code I found here in the forum to force USD for the USD orders but it doesn't work on 4.3.3. The amount is always shown in GBP as set in the cs-cart payment options.

The code is:

$currencies = Registry::get('currencies');
$currency = $currencies[CART_SECONDARY_CURRENCY];
$coefficient = db_get_field("SELECT coefficient FROM ?:currencies WHERE currency_code = 'USD'");
if ($currency['currency_code'] == "USD") {
$order_info['total'] = fn_format_price($order_info['total']/$coefficient);
//$processor_data['params']['currency'] = $currency['currency_code'];
$processor_data['params']['currency'] = "USD";
}

As far as I understand, the base currency in your store is GBP, right? Try to place this code right after the following line:

if (!defined('BOOTSTRAP')) { die('Access denied'); }

In 4.3.5 we release a paypal mod that allows customer to pay on PayPal side not only in primary currency. In other words we added a currency conversion feature to the payment script.

Probably in the near future we will apply this mod to other payments.

If there will be several requests for Worldpay, we will do this.

I am working on 4.6.2. (File: worldpay.php)

I have a shop with two available currency (GBP & EUR) and I'm experiencing a problem with Worldpay.

My default currency is GBP. That works fine.

If customer choose to shop with EUR currency, checkout total shows in EUR, when he goes to Worldpay window, it shows amount in GBP only. I want to display only EUR.

I followed the code here but doesn't work. Any advice is appreciated.

Mentioned code should work. Try to replace

if (!defined('BOOTSTRAP')) { die('Access denied'); }

with

if (!defined('BOOTSTRAP')) { die('Access denied'); }
if (CART_SECONDARY_CURRENCY != CART_PRIMARY_CURRENCY) {
    $processor_data['processor_params']['currency'] = CART_SECONDARY_CURRENCY;
    $order_info['total'] = fn_format_price_by_currency($order_info['total']);
}

Mentioned code should work. Try to replace

if (!defined('BOOTSTRAP')) { die('Access denied'); }

with

if (!defined('BOOTSTRAP')) { die('Access denied'); }
if (CART_SECONDARY_CURRENCY != CART_PRIMARY_CURRENCY) {
    $processor_data['processor_params']['currency'] = CART_SECONDARY_CURRENCY;
    $order_info['total'] = fn_format_price_by_currency($order_info['total']);
}

Many thanks eComLabs. That worked. I appreciate your great help.

You are welcome!