cancel
Showing results for 
Search instead for 
Did you mean: 

PayPal PayfloLink Shows "declined credit card" even though PayPal approved and captured funds

Re: PayPal PayfloLink Shows "declined credit card" even though PayPal approved and capture

I came across this very same issue recently and studied this post. My problem is similar to many others, specifically that our host is Siteground. In my case, we migrated a client account from Siteground Cloud to Siteground GoGeek shared hosting and all of a sudden started to get the Payment Declined message. After a day or two of looking into configurations, settings, SSL and a host of other things, I decided to change some code in the core, PayPal modules and this has solved the problem. Below is description of my problem, obersvations and how I solved the problem;

 

Problem:

1) Receiving "Payment Declined" message during onsite checkout (using PayPal Advanced)

2) This problem has never occurred before

3) Payment was indeed being received in PayPal Manager despite the transaction being cancelled in Magento

4) Looked into potential issues with IPN, no problems with IPN's

5) Checked SSL certificates for potential issue with changes to the server and IP address, no problems with SSL

 

Resolution:

1) Changed code in app/code/core/Mage/Paypal/controllers/payflowadvancedcontrollers.php (see code below - replaced code in else branch)

2) Tested valid CC transaction and no payment declined message

3) Tested with invalid CC transaction (random CC number) and received prompt that transaction failed

4) Order was incremented to "Processing" successfully in the order section of Magento admin

*** I am fearful of changing core code but this was a last resort tweak to get the process working. Many rounds of testing indicate it's working as expected HOWEVER I am anticipating some kind of future issue(s), not sure what to expect.

 

    public function returnUrlAction()
    {
        $redirectBlock = $this->_getIframeBlock()
            ->setTemplate('paypal/payflowadvanced/redirect.phtml');

        $session = $this->_getCheckout();
        if ($session->getLastRealOrderId()) {
            $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
            if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) {
                $allowedOrderStates = array(
                    Mage_Sales_Model_Order::STATE_PROCESSING,
                    Mage_Sales_Model_Order::STATE_COMPLETE
                );
                if (in_array($order->getState(), $allowedOrderStates)) {
                    $session->unsLastRealOrderId();
                    $redirectBlock->setGotoSuccessPage(true);
                } else {
                    $session->unsLastRealOrderId();
                    $redirectBlock->setGotoSuccessPage(true);
                    /**$gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG')));
                    $redirectBlock->setGotoSection($gotoSection);
		    $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.'));
                    $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again. - Order State: '.$order->getState()));*/
                }
            }
        }

 

 

Re: PayPal PayfloLink Shows "declined credit card" even though PayPal approved and capture

To give some background on this issue.   Payflow link (and Paypal Payments Advanced)  creates a small iframe, takes your information and posts it to paypal.  At this point in time the order has been created and set as Pending Payment.  The next step is a silent post is made back to your cart from paypal to silentPostAction().  That step is what actually creates the invoice and processes the order.  After this paypal then returns you to the returnUrlAction and completes the order and forwards you to the success page.

 

For me and I imagine most of the other people on this thread the step that is causing the issue is the silent post.   If the silent post never reaches back to your system then the order is never updated and when you get to the returnUrlAction the order is marked as canceled.  

 

There are many reasons that the silent post might not reach the system so the rest of this may not be applicable to everybody.  

 

The reason we started running into this issue was because we disabled TLS 1.0.  The silent post from payflow only supports TLS 1.0 at this point and will not be switched over to supporting higher versions until next year.  If you also are running into this same issue just contact paypal support and they can whitelist you for TLS 1.2 support.

Re: PayPal PayfloLink Shows "declined credit card" even though PayPal approved and capture

 
The post by crdruffy below is absolutely correct. I am a technical account manager in PayPal and came across the same issue around  PayPal advanced (supporting TLS 1.0 only) with another merchant that we whitelisted recently. We are looking to provide an update shortly which will allow the product to be TLS 1.1 and 1.2 compliant . I will update this thread once the update is out. Please do let me know if you need help getting whitelisted, while we wait for the updates to be released on our end. 
 
------------- Post by cdruffy posted on Tuesday -----------------------------------------

To give some background on this issue.   Payflow link (and Paypal Payments Advanced)  creates a small iframe, takes your information and posts it to paypal.  At this point in time the order has been created and set as Pending Payment.  The next step is a silent post is made back to your cart from paypal to silentPostAction().  That step is what actually creates the invoice and processes the order.  After this paypal then returns you to the returnUrlAction and completes the order and forwards you to the success page.

 

For me and I imagine most of the other people on this thread the step that is causing the issue is the silent post.   If the silent post never reaches back to your system then the order is never updated and when you get to the returnUrlAction the order is marked as canceled.  

 

There are many reasons that the silent post might not reach the system so the rest of this may not be applicable to everybody.  

 

The reason we started running into this issue was because we disabled TLS 1.0.  The silent post from payflow only supports TLS 1.0 at this point and will not be switched over to supporting higher versions until next year.  If you also are running into this same issue just contact paypal support and they can whitelist you for TLS 1.2 support.

Re: PayPal PayfloLink Shows "declined credit card" even though PayPal approved and capture

Please email me at eagarwal@paypal.com if you need your account white-listed, and you match the criteria of the bug as called out, and i will try and help. "cutupguy", you sent a message, but I am not able to access it on the forum. If you can email me at the paypal email address, will try and help as best as possible.

 

Thanks,

-Ekta