Worldpay - Status Failed

We have a problem with Worldpay gateway.



The orders made by Worldpay are marked as:



Status: Failed



even though the transaction is ok.



This does not occur with non-card payments.



Any suggestions?

Indy,



We also had the same issue, CS Cart support made some modifications to my worldpay.php file to fix this. Unfortunately I’m not exactly sure about the exact changes but below is the code from my worldpay.php file for you to look at or to use. Hope this helps.


```php

/***************************************************************************
* *
* Copyright (c) 2009 Simbirsk Technologies Ltd. All rights reserved. *
* *
* This is commercial software, only users who have purchased a valid *
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/


//
// $Id: worldpay.php 8163 2009-10-30 14:46:13Z lexa $
//

$avs_res = array(
"0" => "Not Supported",
"1" => "Not Checked",
"2" => "Matched",
"4" => "Not Matched",
"8" => "Partially Matched"
);
$mode_test_declined = 101;
$mode_test = 100;
$mode_live = 0;
$card_holder_for_declined_test = "REFUSED";

if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'notify') {
fn_order_placement_routines($_REQUEST['order_id']);
}

} elseif (!empty($_REQUEST['cartId']) && !empty($_REQUEST['transStatus'])) {

DEFINE ('AREA', 'C');
DEFINE ('AREA_NAME' ,'customer');
require './../prepare.php';
require './../init.php';

$order_id = (strpos($_REQUEST['cartId'], '_')) ? substr($_REQUEST['cartId'], 0, strpos($_REQUEST['cartId'], '_')) : $_REQUEST['cartId'];

$payment_id = db_get_field("SELECT ?:orders.payment_id FROM ?:orders WHERE ?:orders.order_id = ?i", $order_id);
$processor_data = fn_get_payment_method_data($payment_id);

$pp_response['order_status'] = ($_REQUEST['transStatus'] == 'Y' /*&& (!empty($processor_data['params']['callback_password']) ? (!empty($_REQUEST['callbackPW']) && $_REQUEST['callbackPW'] == $processor_data['params']['callback_password']) : true)*/) ? 'P' : 'F';

if ($_REQUEST['transStatus'] == 'Y') {
$pp_response["reason_text"] = $_REQUEST['rawAuthMessage'];
$pp_response["transaction_id"] = $_REQUEST['transId'];
$pp_response['descr_avs'] = ("CVV (Security Code): " . $avs_res[substr($_REQUEST['AVS'], 0, 1)] . "; Postcode: " . $avs_res[substr($_REQUEST['AVS'], 1, 1)] . "; Address: " . $avs_res[substr($_REQUEST['AVS'], 2, 1)] . "; Country: " . $avs_res[substr($_REQUEST['AVS'], 3)]);
}

if (!empty($_REQUEST['testMode'])) {
$pp_response["reason_text"] .= "; This a TEST Transaction";
}

fn_finish_payment($order_id, $pp_response, false);
echo "";

} else {

if ( !defined('AREA') ) { die('Access denied'); }

$_order_id = ($order_info['repaid']) ? ($order_id . '_' . $order_info['repaid']) : $order_id;
$s_id = Session::get_id();
$sess_name = SESS_NAME;
$card_holder = $processor_data['params']['test'] == $mode_test_declined ? $card_holder_for_declined_test : $order_info['b_firstname'] . ' ' . $order_info['b_lastname'];
$test_mode_id = $processor_data['params']['test'] == $mode_test_declined ? $mode_test : $processor_data['params']['test'];
echo <<















EOT;
$msg = fn_get_lang_var('text_cc_processor_connection');
$msg = str_replace('[processor]', 'World Pay server', $msg);
echo <<


EOT;
exit;
}

?>

```



Regards,

Aleks

Hi AleksB,



thank you very much. We will try it out.



Bye



UPDATE: Yes, it’s working. Thanks AleksB.

Guy's we are having the same issues as detailed above, but can't find where the worldpay.php file is located.



Please could you advise.



Thanks

[quote name='The Joker' timestamp='1315145888' post='120949']

Guy's we are having the same issues as detailed above, but can't find where the worldpay.php file is located.



Please could you advise.



Thanks

[/quote]



Should be in payments directory which is in your root



John

[quote name='johnbol1' timestamp='1315221876' post='121006']

Should be in payments directory which is in your root



John

[/quote]



John,



Thanks for that.

I seem to be having the same problem[font=“Times”][size=“3”][color=“#000000”] with my cs-cart shop. Worldpay is authenticating the transaction and I am receiving an email stating this but it then goes into my orders saying it has failed.[/color][/size][/font]



[font=“Times”][size=“3”][color=“#000000”]My cs-cart version is[/color][/size][/font][color=#000000][font=Times][size=1] [/size][/font][/color]2.2.4 PROFESSIONAL



Any help would be greatly appreciated.



Jason

Is anybody else still experiencing this and would I still be ok in copying the above code into the worldpay.php even though it's 2 years old compared to the latest cs-cart release?