Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Icepay payment module with osCommerce 2.3.4


ArjanS

Recommended Posts

Hello fellow users,

 

After a full update from my shop to ver. 2.3.4, the payment module of ICEPAY (and perhaps other PSPs) are working not good.

 

The problem is the order status after a correct payment. A confirmation email with "Paid" just coming in. But in the admin the order state has "Preparing payment" and not paid.

 

 

I contacted Icepay about it and this was dismissed by saying that I only have to use an older version of osCommerce. Because they had yet no time to update the module for osCommerce.

 

 

Well, it is true that the current Icepay module is until version 2.3.3. Perhaps someone has an idea what might be the difference in oscommerce, between 2.3.3.x and 2.3.4 what gives this problem?

 

 

Any help or comments are welcome!

 

 

regards,

 

ArjanS

Link to comment
Share on other sites

Hello

 

Looking at http://addons.oscommerce.com/info/8568 ???

I've not used this at all but looking at the code - there are two files in the folder ext/modules/payment/icepay - one is notify.php and the other result.php

 

If a customer is getting sent to checkout_success OK then we can assume the folder is readable - if not then that may be your problem. If they are then your problem lies within the file notify.php.

Try opening it directly in a browser - it should display 'Postback script properly installed'

 

If you get that then it means Icepay can send data to your server so just start working down through the code. The module seems to weave in and out of osCommerce code a lot probably as it has been ported over from icepay standard code so it is tricky to pin down what's where - what is visible is a line at line 54

 

$payment_module->doLogging("IP not in range");

 

I'd use that throughout the file to log any screw ups e.g.

 

line 58

    //Check postback
    if (!$payment_module->OnPostback()) die("Invalid postback data");

change to

    //Check postback
    if (!$payment_module->OnPostback()) {

        $payment_module->doLogging("Invalid postback data);

        die("Invalid postback data");

}

or you could wrap each chunk of code in try{} catch{} pairs and use $payment_module->doLogging in the catch{} to log the exception

Link to comment
Share on other sites

Thank you Bob,

 

Yes that is the right Icepay module.

I think you are right that the problem has to be in the file "notify.php"

But your line of code did not solve the problem.

 

I don't understand what you mean with

"or you could wrap each chunk of code in try{} catch{} pairs and use $payment_module->doLogging in the catch{} to log the exception"

 

Strange thing is that the same module did work well in the older osCommerce version, so what can be changed in 2.3.4 that causes the problem?

 

Anyway, thanks!!

Link to comment
Share on other sites

Hi there

 

have a look at something like:

http://stackoverflow.com/questions/17549584/how-to-efficiently-use-try-catch-blocks-in-php

 

there's some try{} catch{}examples there - if you use the icepay logger function within the catch block (I have no idea how the logger is utilised/activated but it looks like there's something in the code that logs someplace) then you may be able to throw up the problem.

 

(Each try{} and catch{} set needs to be independent - you can't nest them)

 

I can't see anything in 2.3.4 that should break that file - if there's nothing in the PHP error log then see if you cannot get the logger thing running and scatter calls to it in the code - something like this:

	// Set ICEPAY class
	require(DIR_WS_CLASSES . "payment.php");
	$payment_modules = new payment("icepay");
	$payment_module = $GLOBALS[$payment_modules->selected_module];
	$payment_module->setMerchant();
    // try logging
	    $payment_module->doLogging("Got to line 52");
    //end logging
    //assuming the logger is working - if nothing gets logged then the error lies above line 52 
	//line 49 possible
	//Check IP
	if (!$payment_module->ipCheck($_SERVER['REMOTE_ADDR'])) {
		$payment_module->doLogging("IP not in range");
		die("IP not in range");
	}
	
	//Check postback

	if (!$payment_module->OnPostback()) die("Invalid postback data");
	try{
	$paymentIDs			= 	$_POST['StatusCode'] . " ( ".
							"OrderID:".			$referenceOrderID.
							", Reference:".		$_POST['Reference'].
							", TransactionID:".	$_POST['TransactionID'].
							", PaymentID:".		$_POST['PaymentID'].
							" )";
	$orderInfo			= 	$referenceOrderID.
							" ( Reference:".	$_POST['Reference'].
							", TransactionID:".	$_POST['TransactionID'].
							", PaymentID:".		$_POST['PaymentID'].
							" )";
	define(ICEPAY_EMAIL_TEXT_PM,		$_POST['PaymentMethod']);
	define(ICEPAY_EMAIL_TEXT_ORDER,		$orderInfo);
	$payment_module->doLogging("Try block 1 OK");
	}
	
	catch (Exception $e) {
      $payment_module->doLogging("Try block 1 failed". $e);
     }
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...