♥stubbsy Posted May 17, 2006 Share Posted May 17, 2006 Hi Steve, just having a go at the coding and i understand what you mean by your firt 2 segments of code e.g. find this // Let's send the merchant a record of the transaction if($status == "Success") { $mailheaders = 'MIME-Version: 1.0' . "\r\n"; $mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheaders .= 'From: ' . STORE_ABBR . ' ePDQ Transaction <' . STORE_OWNER_EMAIL_ADDRESS . '>' . "\r\n"; // [SEE HERE - ePDQ] Change e-mail address, subject & from at will $email_message .= "cid = $cid\n$status_update_query\nResult = $result\n\nErr = $status_update_error\n"; mail ("ePDQ Transaction <" . STORE_OWNER_EMAIL_ADDRESS . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); and replace with this // Let's send the merchant a record of the transaction if($status == "Success") { $mailheaders = 'MIME-Version: 1.0' . "\r\n"; $mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheaders .= 'From: ' . STORE_ABBR . ' ePDQ Transaction <' . STORE_OWNER_EMAIL_ADDRESS . '>' . "\r\n"; // [SEE HERE - ePDQ] Change e-mail address, subject & from at will $email_message .= "cid = $cid\n$status_update_query\nResult = $result\n\nErr = $status_update_error\n"; mail ("ePDQ Transaction <" . STORE_OWNER_EMAIL_ADDRESS . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); } do you mean to find this around line 433 $mailheaders = 'MIME-Version: 1.0' . "\r\n"; $mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheaders .= 'From: ' . STORE_ABBR . ' ePDQ Transaction <' . STORE_OWNER_EMAIL_ADDRESS . '>' . "\r\n"; // [SEE HERE - ePDQ] Change e-mail address, subject & from at will $email_message .= "cid = $cid\n$selstr\n$err\n"; mail ("ePDQ Transaction <" . STORE_OWNER_EMAIL_ADDRESS . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); print "Called manually - notice reported to webmaster"; } and insert the same code as before so that it looks like this } else { if($status == "Success") { $mailheaders = 'MIME-Version: 1.0' . "\r\n"; $mailheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $mailheaders .= 'From: ' . STORE_ABBR . ' ePDQ Transaction <' . STORE_OWNER_EMAIL_ADDRESS . '>' . "\r\n"; // [SEE HERE - ePDQ] Change e-mail address, subject & from at will $email_message .= "cid = $cid\n$selstr\n$err\n"; mail ("ePDQ Transaction <" . STORE_OWNER_EMAIL_ADDRESS . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); print "Called manually - notice reported to webmaster"; } } I think thats what you mean, but can you confirm cheers Dave ps, good news about it not be vulnerable to the panick going on in the general forum. Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 17, 2006 Share Posted May 17, 2006 Hi Dave I think thats what you mean, but can you confirm cheers Dave ps, good news about it not be vulnerable to the panick going on in the general forum. Sorry, just re-read my instructions and they weren't clear. The if statement covers the whole section of code relating to stock deduction and email confirmation sending, so you shouldn't have the ' } ' after the line: mail ("ePDQ Transaction <" . STORE_OWNER_EMAIL_ADDRESS . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); ... it should come way down near just before the ' } else { ' statement you quote, i.e. } } else { So it's actually a pretty simple mod... I just made a hash of describing it! :lol: Hope that makes sense now... PM me if you have any problems. Steve Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 17, 2006 Share Posted May 17, 2006 (edited) Sorry, that also means that you don't need the second if($status == "Success") { that you've put in. Steve Edited May 17, 2006 by mj_superfly Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 18, 2006 Share Posted May 18, 2006 Thanks Steve, I'll have a go at that tomorrow now - will keep you posted. cheers Dave Quote Link to comment Share on other sites More sharing options...
tamlyn Posted May 18, 2006 Share Posted May 18, 2006 This is an alternative method which seems to work for me: Instead of wrapping the if around the email code, replace this (around line 240 of complete.php) // Let's send the merchant a record of the transaction $email_message .= "cid = $cid\n$status_update_query\nResult = $result\n\nErr = $status_update_error\n"; tep_mail (STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, STORE_ABBR . " EPDQ Transaction", $email_message, STORE_ABBR . ' ePDQ Transaction', STORE_OWNER_EMAIL_ADDRESS); with this // If there was a problem send the merchant a record of the transaction then stop if($new_status < STATUS_PAYMENT_AUTHORISED) { $email_message .= "cid = $cid\n$status_update_query\nResult = $result\n\nErr = $status_update_error\n"; tep_mail (STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, STORE_ABBR . " EPDQ Transaction", $email_message, STORE_ABBR . ' ePDQ Transaction', STORE_OWNER_EMAIL_ADDRESS); exit; } That way the merchant only gets the cpi variables email if there was a problem and the script then exits without sending any more emails or adjusting stock or whatever. The order history is still updated because that all happens before. Quote Link to comment Share on other sites More sharing options...
tamlyn Posted May 18, 2006 Share Posted May 18, 2006 New problem: I don't use ssl for my oscommerce checkout process. That's all fine except that when the customer gets returned to epdq_success.php the oscommerce session isn't available because we're now on a different host (the ssl host) and hence if there's an error it doesn't get displayed once we reach the checkout page. I can't make it return to epdq_process.php on the non-ssl host because that will cause a 'non-secure redirect' warning while still on the barclays page which will scare customers. Any ideas? Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 18, 2006 Share Posted May 18, 2006 Hi Tamlyn, I don't have SSL at all with mine as epdq handles all that. All I did was remove the code to display an image on epdq so there is no warning there and i just changed my return line in epdq to tep_draw_hidden_field('returnurl', HTTP_SERVER . '/' . FILENAME_EPDQ_PROCESS) . "\n" . // NEW! I have a default install of IE as i'm using a new dell machine and i didn't get any popup warnings. Hope that helps Dave Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 18, 2006 Share Posted May 18, 2006 Hi Tamlyn Yep - a different way of doing the same thing... looks good. I've heavily modded the complete.cpi and the method that I posted was the easiest way of doing things for me. On the other issue, if you have SSL available, why aren't you using it for the transmission of personal data? People are looking out for the padlock more and more nowadays for reassurance. Steve Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 19, 2006 Share Posted May 19, 2006 Steve, just to let you know that I made the alterations and it all works great. Thanks for your help with this. cheers Dave Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 19, 2006 Share Posted May 19, 2006 Any ideas how to get email sent to the send extra order emails to working? I've added this into complete mail ("ePDQ Transaction <" . SEND_EXTRA_ORDER_EMAILS_TO . ">", STORE_ABBR . " EPDQ Transaction", $email_message, $mailheaders); just after the // Let's send the merchant a record of the transaction code but that doesn't work (as you have probably guessed i can't write php, more stumble around until something works :) ) Any ideas? Cheers Dave Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 19, 2006 Share Posted May 19, 2006 Hi Dave No problem :thumbsup: Find this right near the end of complete.php: tep_mail(EMAIL_TEXT_MERCHANT_EMAIL_TO, STORE_OWNER_EMAIL_ADDRESS, sprintf(EMAIL_TEXT_MERCHANT_EMAIL_SUBJECT, ucfirst($order->customer['name']), STORE_ABBR, (int)$oid), $message, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); and try adding this straight after it: // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } Works OK for me :) Steve Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 20, 2006 Share Posted May 20, 2006 Thanks again Steve, much appreciated :) Quote Link to comment Share on other sites More sharing options...
cujimmy Posted May 25, 2006 Share Posted May 25, 2006 Thanks to everyone involved here. Up to this point, I thought I was doing fine. I have the live transaction being processed. The EPDQ logs say that the POST is OK. The order is stored in the database but the status is not being updated from "awaiting card transaction" (still set to orders_status_id 4) and following from that, the emails can't be sent either to the customer or the merchant. The only email being sent out is from the EPDQ site. Basically, I'm no longer going round in circles. I'm completely stuck. I won't be offended if someone asks me to check that the computer is plugged in at the mains socket; I'll be grateful for the suggestion (and I'll check). Quote Link to comment Share on other sites More sharing options...
tamlyn Posted May 25, 2006 Share Posted May 25, 2006 Seems like epdq isn't getting through to your cpi/complete.php script. Things to check: You have set the correct url in the post section of the cpi admin You have set the correct username and password in the post section of the cpi admin You have used the same username and password to generate your htpasswd file The htpasswd file is actually being used properly. This step cost me several hours of headache. Check it by trying to access the complete.php file directly iin your browser. You should get a password prompt and once you enter the correct password you should get a message about not being allowed to call the script directly and also an email about it. Apparently complete.php has to return a valid html file or epdq may think that an error has occurred. In my experience this isn't true but just in case... If you've made any changes to complete.php make sure you haven't made any errors because a page displaying a php error message looks like a valid page to epdq and it won't warn you about it (I hit this snag too) probably other stuff that I can't remember at 5.30am :P Quote Link to comment Share on other sites More sharing options...
cujimmy Posted May 25, 2006 Share Posted May 25, 2006 Seems like epdq isn't getting through to your cpi/complete.php script. Things to check:You have set the correct url in the post section of the cpi admin You have set the correct username and password in the post section of the cpi admin You have used the same username and password to generate your htpasswd file The htpasswd file is actually being used properly. This step cost me several hours of headache. Check it by trying to access the complete.php file directly iin your browser. You should get a password prompt and once you enter the correct password you should get a message about not being allowed to call the script directly and also an email about it. Apparently complete.php has to return a valid html file or epdq may think that an error has occurred. In my experience this isn't true but just in case... If you've made any changes to complete.php make sure you haven't made any errors because a page displaying a php error message looks like a valid page to epdq and it won't warn you about it (I hit this snag too) probably other stuff that I can't remember at 5.30am :P Quote Link to comment Share on other sites More sharing options...
cujimmy Posted May 25, 2006 Share Posted May 25, 2006 Thanks Tamlyn - spot on - I'm no longer stuck. Now back to normal... going round in circles :) It looks like the problem in complete.php is in the includes: includes/functions/html_output.php is producing an error relating to Ultimate SEO but my understanding of what's going on there is too wooly. In functions/html_output there's this line (in the HTML href link wrapper function): if ( !is_object($seo_urls) ){ if ( !class_exists('SEO_URL') ){ include_once(DIR_WS_CLASSES . 'seo.class.php'); but, calling complete.php in the browser, I get (saw this right at the start then completely forgot about it): Warning: tep_href_link(includes/classes/seo.class.php): failed to open stream: No such file or directory in /home/xxxxxx/public_html/catalog/includes/functions/html_output.php on line 20 Warning: tep_href_link(): Failed opening 'includes/classes/seo.class.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxxx/public_html/catalog/includes/functions/html_output.php on line 20 Fatal error: Cannot instantiate non-existent class: seo_url in /home/xxxxxx/public_html/catalog/includes/functions/html_output.php on line 23 (includes/classes/seo.class.php does exist). I suppose most people using EPDQ will also have SEO URLs installed but I haven't seen anyone else getting this error. 5.30am!!? Is that an early morning or a very late night? (I usually give up before 3.00am - even on this one)! Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 25, 2006 Share Posted May 25, 2006 (edited) Can anyone help with the extra order emails? I need some advice on how to format the extra order email addresses? In the configuration it used to be Send extra order emails to the following email addresses, in this format: Name 1 <email@address1>, Name 2 <email@address2> But using this format they get returned as being incorrectly structured. Any ideas? Cheers Dave Edited May 25, 2006 by stubbsy Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 26, 2006 Share Posted May 26, 2006 I had a similar problem so just use comma separated email addresses (no names). It's a bodge, but it seems to work OK. Steve Quote Link to comment Share on other sites More sharing options...
mj_superfly Posted May 26, 2006 Share Posted May 26, 2006 Thanks Tamlyn - spot on - I'm no longer stuck. Now back to normal... going round in circles :) It looks like the problem in complete.php is in the includes: includes/functions/html_output.php is producing an error relating to Ultimate SEO but my understanding of what's going on there is too wooly. In functions/html_output there's this line (in the HTML href link wrapper function): if ( !is_object($seo_urls) ){ if ( !class_exists('SEO_URL') ){ include_once(DIR_WS_CLASSES . 'seo.class.php'); but, calling complete.php in the browser, I get (saw this right at the start then completely forgot about it): (includes/classes/seo.class.php does exist). I suppose most people using EPDQ will also have SEO URLs installed but I haven't seen anyone else getting this error. 5.30am!!? Is that an early morning or a very late night? (I usually give up before 3.00am - even on this one)! Hi cujimmy It looks to me like this section in complete.php ... /* Ultimate SEO URLs v2.1 include_once('../includ3s/class3s/seo.class.php'); $seo_urls = new SEO_URL($languages_id); */ ...has somehow had the comment tags removed. Either remove this block of code entirely, or ensure there is a // at the start of each line. I'd recommend the former... it isn't needed so you're better off without it. Good luck Steve Quote Link to comment Share on other sites More sharing options...
cujimmy Posted May 26, 2006 Share Posted May 26, 2006 Hi cujimmy It looks to me like this section in complete.php ... /* Ultimate SEO URLs v2.1 include_once('../includ3s/class3s/seo.class.php'); $seo_urls = new SEO_URL($languages_id); */ ...has somehow had the comment tags removed. Either remove this block of code entirely, or ensure there is a // at the start of each line. I'd recommend the former... it isn't needed so you're better off without it. Good luck Steve Hi Steve, thank you for that; it was a good, logical thought, but the comment tags were still in place. What's interesting is the fact that that line was in there in the first place. I have a hunch that Joe was maybe having a problem with the same thing at one point and that it's arising because complete.php doesn't include application_top and the includes have to be hardcoded. I was going to post again, anyway, because... (suddenly figured out this painfully obvious workaround at 4.00am this morning ) :blush: I think I have it sorted so, for anyone else coming up against the same issue, here's what was happening: complete.php starts out with a list of included files and the one that's causing the fatal error is includes/functions/html_output.php. In my setup, the "HTML href link wrapper function" in html_output.php has been modded for the Ultimate SEO URLs contribution; effectively, it's going to be looking for includes/classes/seo.class.php and, when application_top is used (which it can't be)!, that happens seamlessly. For some reason that I haven't yet sussed, the hardcoded-included html_output fails to find seo.class.php and produces the error, thus breaking the transaction-complete process. The transaction status doesn't get upgraded ergo, the emails don't get sent out by the cart (only by the EPDQ server). Here's the sticking-plaster-and-string solution: SEO URLs don't matter a monkey's to the EPDQ; it's just sending back data to complete.php so we can't possibly need that mod in html_output.php at that moment. So... :blush: I made a copy of html_output.php and replaced the HTML href link wrapper function that had been modded by SEO URLs with the original (stock osC) version of the function. I called the new file "html_output_4epdq.php" and changed the hardcoded include in complete.php to include('../includes/functions/html_output_4epdq.php'); and Bob (Easland)'s yer uncle. :rolleyes: Then I took the dog out and still got 5 hours sleep. Quote Link to comment Share on other sites More sharing options...
JoeMcManus Posted May 26, 2006 Share Posted May 26, 2006 (edited) Not just yer unclue, a god, almost. :) The SEO class isn't a necessity indeed, I came across similar issues because the class modified the tep_href_link() function and indeed broke this script. I do have that class inclusion uncommented and works fine in my setup. Forgot exactly why I kept it, probably because I wanted to use the tep_href_link. I'll try and catch up with the other posts. Edited May 26, 2006 by JoeMcManus Quote Johan a.k.a. T0PS3O elsewhere. Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though... Link to comment Share on other sites More sharing options...
cujimmy Posted May 26, 2006 Share Posted May 26, 2006 Not just yer unclue, a god, almost. :) I'll second that! And, for Harald, we can just do without the "almost" eh? But it's true; the osC forum's like a different planet without that guy's (almost) limitless reserves of patience. Ironic, and tragic for the rest of us, that he got banned the way it happened. How about a Bring Back Chemo signature file petition? - lol Anyway, big thanks for the EPDQ contrib - much appreciated! I'm personally still not out of the woods yet - emails are not yet getting sent from the shop - but the transaction status is now getting updated so must be getting close. :) Quote Link to comment Share on other sites More sharing options...
JoeMcManus Posted May 26, 2006 Share Posted May 26, 2006 I couldn't quite follow the previous posts so if you post your troubles concisely again I may be able to help you out. Quote Johan a.k.a. T0PS3O elsewhere. Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though... Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 26, 2006 Share Posted May 26, 2006 Thanks Steve, I'll give that a whirl and see how i get on. cheers Dave Quote Link to comment Share on other sites More sharing options...
♥stubbsy Posted May 27, 2006 Share Posted May 27, 2006 (edited) Nearly there with it, I can get one extra order email to send but not the 2, get this error A message that you sent contained one or more recipient addresses that wereincorrectly constructed: ePDQ Transaction <[email protected],[email protected]>: malformed address: ,[email protected]> may not follow ePDQ Transaction <[email protected] This address has been ignored. There were no other addresses in your message, and so no attempt at delivery was possible. cheers stubbsy Edited May 27, 2006 by stubbsy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.