Zen Cart Logo
Forums / Addon Payment Modules / Paypal Direct Payment - Order Still Completes After Failure - postosc

Paypal Direct Payment - Order Still Completes After Failure - postosc

Locked

Views: 3,140

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
29 Jun 2007, 10:22 PM
#1
jaunt avatar

jaunt

New Zenner

Join Date:
Jun 2007
Posts:
2
Plugin Contributions:
0

Paypal Direct Payment - Order Still Completes After Failure - postosc

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.

29 Jun 2007, 11:34 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,608
Plugin Contributions:
0

Re: Paypal Direct Payment - Order Still Completes After Failure - postosc

You are going to have to talk to the folks you got the module from as it is NOT supported by Zen Cart. Sorry.

9 Aug 2007, 3:58 AM
#3
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Paypal Direct Payment - Order Still Completes After Failure - postosc

jaunt:

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.

That module works great for me. Are you SURE you did not turn on, in the module -> payments screen for direct payment, "manual processing if failed"? If you set that to yes, it will do what you say.

9 Aug 2007, 7:29 AM
#4
jaunt avatar

jaunt

New Zenner

Join Date:
Jun 2007
Posts:
2
Plugin Contributions:
0

Re: Paypal Direct Payment - Order Still Completes After Failure - postosc

Yes you are correct that is how the module was supposed to act and I did not understand that from the option in the Admin. I thought it would just send an email after each failed attempt then return the user to the payment page. Once i more thoroughly read the code I figured out how to make it go back to the payment page after the email was sent. You can just copy the code from the "if (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'No')" section to the "else" section and you will get an email and a redirect to the payment page.

The client did not want to have to contact the user in the case of a failed payment, but they wanted an email for failed transactions.

10 Aug 2007, 10:48 PM
#5
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Paypal Direct Payment - Order Still Completes After Failure - postosc

Yes, I know it was an older message. So, did the client use the module? We are, and love it. Are they happy?