Jump to content

Worldpay response -order completed


Moshe Nitzani

Recommended Posts

Hi

Does anyone know how to set the order status to Order Completed when Worldpay sends back the response after a successful transaction. I am trying to avoid having to log in to Cubecart admin and manually flag the order as Completed. My accounts department lady will eat me alive if she has to do that on top of everything else she does.

Thanks

Moshe

Link to comment
Share on other sites

In modules/gateway/WorldPay/ there is a file called call.inc.php

On line 45 there is this code:

$order->orderStatus(3,$_POST['cartId']);


Change the 3 to a 4 and I think that should do it. Backup before changing.
After many emails fyling between myself and Cubecart support (which was very fast and very helpful), the conclusion was that the only way for the order status to be flagged as Order Complete was to modify the code in classes/cart/order.php so that when the status is set to 3 it doesn't check to see if the product is digital or not and put the status back to 2. Find:

This will just comment out the functionality to drop back to status 2.

I have tested this fix and can confirm that regardless of the product type (digital or tangible) a Successful Transaction response from Worldpay automatically sets the order status to Order Complete and triggers the corresponding email.

Moshe

if (!$this->orderInv[$i]['digital'] && !$force) {

	$this->orderStatus(2, $cart_order_id);

	$statusId = 2; ## Safeguard

	$breakStatus = true;  ## Stops email sending below no way to stop this case ?!

	break;

}


Replace with:




/*

if (!$this->orderInv[$i]['digital'] && !$force) {

	$this->orderStatus(2, $cart_order_id);

	$statusId = 2; ## Safeguard

	$breakStatus = true;  ## Stops email sending below no way to stop this case ?!

	break;

}

*/
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
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...