Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Urgent Help Needed with ePDQ Payments


rickhudson

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 388
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)!

Link to comment
Share on other sites

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 by stubbsy
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by JoeMcManus

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

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. :)

Link to comment
Share on other sites

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 were

incorrectly 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 by stubbsy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...