You could alter the code where the currency and amount are submitted to the gateway by adding this function and calling it and reading the returned array for revised currency-code and amount:
Code:
/**
* Check whether user-selected currency is valid for this payment module, and apply any applicable currency conversions.
*/
function getConvertedCurrencyAndAmount($amount, $applyFormatting = FALSE) {
$gatewaySupportedCurrencies = array('USD');
$gatewayPrimaryCurrency = 'USD';
$myCurrency = $_SESSION['currency'];
if (!in_array($myCurrency, $gatewaySupportedCurrencies)) {
$myCurrency = $gatewayPrimaryCurrency;
}
global $currencies;
$amount = ($amount) * $currencies->get_value($myCurrency);
if ($applyFormatting) {
$amount = number_format($amount, $currencies->get_decimal_places($myCurrency));
}
return array('currency' => $myCurrency, 'amount' => $amount);
}
Bookmarks