Payments With Non-Default Currency

Hi there,

I have 2 currencies in my web (Dollar and Euro). The default currency is Dollar. When the user changes the currency from Dollar to Euro, all prices are in Euros, the cart is in Euros, but when the user checkouts the amount sent to the payment gateway is in Dollars instead of Euros.

So, if the user is buying in Euros, how can I send the amount in Euros to the payment gateway?

Thank you.

use this function to convert price :

fn_format_price_by_currency($order_info[‘total’],CART_PRIMARY_CURRENCY,CART_SECONDARY_CURRENCY);

Hi there,

I have 2 currencies in my web (Dollar and Euro). The default currency is Dollar. When the user changes the currency from Dollar to Euro, all prices are in Euros, the cart is in Euros, but when the user checkouts the amount sent to the payment gateway is in Dollars instead of Euros.

So, if the user is buying in Euros, how can I send the amount in Euros to the payment gateway?

Thank you.

It is required to change the script of the payment method which you use for online payments. Please specify your payment processor

For Paypal here is the solution: link

It is required to change the script of the payment method which you use for online payments. Please specify your payment processor

The payment processor: ServiRed

use this function to convert price :

fn_format_price_by_currency($order_info[‘total’],CART_PRIMARY_CURRENCY,CART_SECONDARY_CURRENCY);

I have tried to insert this code in "ServiRed.php" but I get the same amount.

app/payments/servired.php

add

$order_info['total'] = fn_format_price_by_currency($order_info['total']);

before this line:

$amount = ($currency == '978') ? ($order_info['total'] * 100) : $order_info['total'];

app/payments/servired.php

add

$order_info['total'] = fn_format_price_by_currency($order_info['total']);

before this line:

$amount = ($currency == '978') ? ($order_info['total'] * 100) : $order_info['total'];

It's works! Thank you.

use this function to convert price :

fn_format_price_by_currency($order_info[‘total’],CART_PRIMARY_CURRENCY,CART_SECONDARY_CURRENCY);

This also works, sorry, I forget set € in the test.

OK, now I can convert Dollars to Euros to send to the payment gateway, I have to do this when the user is navigating in Euros, BUT how I know that the user is navigating in Euros?

Thank you.

Will above solution work for 4.3.6 version, PayPal & PayPal express?



Right, non working solution, waist of money…

For Paypal here is the solution: link

OK, now I can convert Dollars to Euros to send to the payment gateway, I have to do this when the user is navigating in Euros, BUT how I know that the user is navigating in Euros?

If the selected currency is equal to the primary currency, the total amount will not be changed.

Will above solution work for 4.3.6 version, PayPal & PayPal express?

We cannot guarantee that. The system sends to PayPal total order amount and cost of each product, discount value, etc. If order total amount is not equal to sum of products cost + discount + value, you can receive error messages from PayPal. It can be caused due to rounding in currency conversion

If the selected currency is equal to the primary currency, the total amount will not be changed.

What is the variable of "selected currency"? As you can see in the code, we have this:

$currency = $processor_data['processor_params']['currency'];

So, $currency is get from the parameters configurated in the payment gateway, this is not the "selected currency".

Thank you

If the selected currency is equal to the primary currency, the total amount will not be changed.

Ok, I get what you mean:

$v_temp = $order_info['total'];

$order_info['total'] = fn_format_price_by_currency($order_info['total']);

if $v_temp == $order_info['total'] then

//User navigates in Dollars

else

//User navigates in Euros

end if

RIght?

You can use the following data:

$processor_data['processor_params']['currency'] - currency selected in the payment method settings

CART_PRIMARY_CURRENCY - primary currency of the store-front

CART_SECONDARY_CURRENCY - currency selected by the customer

You can use the following data:

$processor_data['processor_params']['currency'] - currency selected in the payment method settings

CART_PRIMARY_CURRENCY - primary currency of the store-front

CART_SECONDARY_CURRENCY - currency selected by the customer

Nice! Thank you.

Another question, in the file servired.php, I need get the Billing COUNTRY of the buyer, how I get this datum in servired.php?

Nice! Thank you.

Another question, in the file servired.php, I need get the Billing COUNTRY of the buyer, how I get this datum in servired.php?

It is is required to check their integration manual. For example, if the name of the corresponding parameter is Ds_Merchant_Country, just add:

'Ds_Merchant_Country' => $order_info['b_country'],

after this line of code

'Ds_Merchant_MerchantSignature' => $signature,

Also check if the country should be used in the security hash generation

It is is required to check their integration manual. For example, if the name of the corresponding parameter is Ds_Merchant_Country, just add:

'Ds_Merchant_Country' => $order_info['b_country'],

after this line of code

'Ds_Merchant_MerchantSignature' => $signature,

Also check if the country should be used in the security hash generation

Thank you ;)