I have installed the Paypal Direct Payment Module v1.2 from "http://www.postosc.com/" in Zen Cart v1.3.7 and I am having an issue with the orders completing after a failure response is returned from Paypal.
The orders are completing when the correct information is entered and sending a failure response when incorrect information is entered, but when a failure comes back to Zen Cart it is not being caught. The customer ends up going to the confirmation page and completing their order without having paid.
I have the debug feature turned on in the module so I am able to see all the information regarding each order and the failures appear to be comming back correctly from Paypal, but Zen Cart seems just to be moving forward. This poses a huge issue for my client and if anyone else is experiencing this issue or has some insight into a solution it would be a great help.
Looking through the Paypal Direct Payment Module (paypal_dp.php) and the functions after_order_create($insert_id) and before_process(). At the end of before_process() is the area which is setting the information about the order errors and it is listed below. Something is happening in this section where a transaction id is being generated even when the order fails and I do not know yet how to fix it.
if(Services_PayPal::isError($response)) {
if (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'No') {
$messageStack->add_session('checkout_payment', MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR . '<!-- ['.$this->code.'] -->', 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR), 'SSL', true, false));
} else {
$this->order_status = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
}
} elseif($response->getAck() != 'Success' && $response->getAck() != 'SuccessWithWarning') {
if (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'No') {
$messageStack->add_session('checkout_payment', MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE . '<!-- ['.$this->code.'] -->', 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
} else {
$this->order_status = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
}
} else {
//$details = $response->getDoDirectPaymentResponseDetails();
$this->trans_id = $response->getTransactionID();
$this->avs = $response->getAVSCode();
$this->cvv2 = $response->getCVV2Code();
}
Searches on the internet and within the forum have yielded no results for my particular problem. All issues I have uncovered have to do with Paypal communication and error codes.




