Thank you Frank. That did the trick! It helps if you know where to look...
Had a customer who paid for part of her order with a discount voucher. She paid for the remainder with her CR card via eWay.
However eWay did not deduct the discount voucher from the total and processed the full amount. I then had to refund her the value of the discount voucher.
I do not have this problem when customers pay via PayPal.
Any ideas why this is happening?
Just wanted to see if it is possible to pass on the CC charges to a customer, for example:
If you get charged 2% for Master/Visa and 3% for AMEX can this be added to the customers order total before payment is done?
Cheers
Jon
Extracting Transaction ID from the Order, for store report, via MySQL Query (custom report).
As an alternative, I had asked eWay if they would assist in amending their module to write their transaction data to it's own table, however as the dev team were winding down for Christmas / New Year, an 'emergency measure' in the meantime was emailed to me, the following code suggestions have been presented.
Ideally I would like to see the module write to it's own tables, is this something that someone in the community could do - or is this gateway an eWay only module??
I have been communicating with eWay regarding my options, however over Christmas/New Year it may be quicker coming and asking for some further advice here.
I am adding to my store monthly sales query which I run using a custom MySQL query in MySQL Workbench and I am trying to extract the Transaction ID from each order that has been purchased using eWay, which I then match up my eWay reports transaction history in excel.
I was given these 2 pieces of code to add to my query, both work, however they only return orders with the Transaction ID, and none of those where the 'Comments' are blank or contain 'PayPal' (which I also added as an 'OR'). If someone could please assist.
----------
eWay code
- Only returns eWay transactionsCode:select REPLACE(comments, 'eway TransactionID: ', '') from orders_status_history WHERE comments LIKE 'eway TransactionID%'
or
----------Code:select orders_id, REPLACE(comments, 'eway TransactionID: ', '') AS transaction_id from orders_status_history WHERE comments LIKE 'eway TransactionID%'
My code
This returns the Transaction ID, but I can't get it to return both eWay & PayPal OR eWay, blank & PayPal and if I tell it to return ALL comments, my query returns over 10,000 lines, 2/3 of which are duplicates as the customer and admins have added comments to orders.
----------Code:Select -- Get Order data -- T5.orders_id As OrdID, DATE_FORMAT(T5.date_purchased, '%Y-%m-%d') As OrdDate, T3.products_name As ProdName, -- Rest of query -- REPLACE(O2.comments, '%eway Transaction%', '') as OrdCom -- Extra query -- From /*PREFIX*/products T1 --other joins-- Left Join /*PREFIX*/orders_status_history O2 On (O2.orders_id = T2.orders_id)
I was wondering about using a CASE query, however I am unsure on how to write it.
How do I extract the whole string of what is in the comments (as below), except in the case of PayPal, example under "CASE"
** However, PayPal comments return as below, so would want to truncate them to only between "Transaction ID and P" (Payment), any ideas??:Code:CASE When(O2.comments = '%eway Transaction%') then 'eway TransactionID: xxxxxxxxx' -- eWay When(O2.comments = '%Transaction ID%') then 'Transaction ID: 02D32743CD990491Y' -- PayPal** When(O2.comments = ' ') then ' ' -- Blank comments When(O2.comments = 'everything else') then ' ' -- Blank comments End As OrdCom,
'Transaction ID: xxxxxxxxxxxxxxxxx
Payment Type: PayPal Express Checkout (instant)
Timestamp: 2013-09-26T18:48:09Z
Payment Status: Completed
Amount: 29.99 AUD '
In Excel I would use: =LEFT(A1,FIND("Payment",A1&"Payment")-1)
-----
Is this a lost cause, I'm sure I should be able to just extract the the TransID comments without all the other data, in a larger query, without having to run 2 separate reports and join then post run.
Thanks in advance.
Last edited by QueryEverything; 4 Jan 2016 at 08:09 AM. Reason: Added another line of code
Just installed this module a few weeks ago and principally I am very happy with. It has a few flaws though, one of them being that many merchant facilities only accept AUD as currency (if you are based in Australia).
Got around this issue by implementing this hack:
https://www.zen-cart.com/showthread....88#post1305188
The customer can still select their own currency when browsing and adding to the cart, but once they get to the checkout payment page the currency in the cart is forced to be the default currency and the order is recalculated in the default currency, namely AUD.
It would be good if the eWay devs could implement this in their module to invoke the default currency AUD only when this module is selected.
Frank
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.
Last edited by frank18; 6 Mar 2016 at 08:13 AM.
Bookmarks