Instead of modifying ZC core code (as shown in my last post), a more elegant way of overcoming the currency symbol issue is this hack:
In the file includes/modules/payment/eway_rapid.php find this code
Immediately after that insertPHP Code:/**
* Build the data and actions to process when the "Submit" button is pressed on the order-confirmation screen.
* This sends the data to the payment gateway for processing.
* (These are hidden fields on the checkout confirmation page)
*
* @return string
*/
function process_button() {
global $db, $order, $currencies, $currency, $messageStack;
To show the customer what and how they are being charged, in the same file findPHP Code:
// bof force change currency code to AUD -- frank18 20160306
$show_charged_amount = false;
if (!in_array($order->info['currency'], array('AUD'))) {
// we are not in default currency so we need to change currency code to default AUD as eWay only accepts AUD
$order->info['currency'] = zen_currency_exists(DEFAULT_CURRENCY, false);
// now show the customer what they are being charged in $AUD
$show_charged_amount = true;
$displayed_amount = number_format($order->info['total'], 2, '.', '');
}
// eof force change currency code to AUD -- frank18 20160306
Just before that code insertPHP Code:echo '<!-- Begin eWAY Linking Code -->
PHP Code:// bof heading added -- frank18 20160306
echo '<h2>eWAY Payment Details</h2>';
if ($show_charged_amount) {
echo '<div id="ewayRapidPayment">Your payment will be processed in Australian Dollars ($AUD)</div>';
echo 'Amount charged in $AUD ' . $displayed_amount;
}
echo '<h3>(Payment will appear on your Credit Card Statement as <b>WHATEVER YOU WANT TO SAY HERE</b>)</h3>';
// eof heading added -- frank18 20160306
With this modification we are only passing the currency code AUD instead of the customer selected currency code (eg USD, EUR, NZD etc), the functionality of the original eWay code is not changed at all.
All shopping cart and checkout pages continue to show the customer chosen currency and values.


Reply With Quote

