5

Here is high level overview of how the paypal error 10486 is occurring in our magento store.

1. User adds items into our magento cart
2. select paypal as the payment method
3. user is directed to the paypal page. if the user inputs an expired credit card or just incorrect information...
4. user is redirected back to our magento store

The error that the user sees is:

"This transaction couldn't be completed. Please redirect your customer to PayPal (#10486: This transaction couldn't be completed)."

according to the paypal documentation Paypal Documentation available here, we should be able to redirect our user back into the paypal experience. However, I cannot seem to find any location in the magento backend to set up this parameter, and know that I should never, ever have to touch core files. Unsure where I need to go with in magento to resolve this.

3
  • Which magento version are you using? are you using the default paypal module?
    – lloiacono
    Commented Jun 2, 2015 at 13:46
  • am using the EE .14 with the default PP module Commented Jun 2, 2015 at 13:49
  • I have had this 2 times so far on Magento CE 1.9.1.0. The info in the order shows Customer name = Guest which is impossible because guest checkout is completely disabled on the site and it has always been this way. One must be logged in in order to pay. So perhaps there is also a bug in Magento related to when 10486 happens. Have you reported that?
    – george
    Commented Feb 18, 2016 at 12:03

4 Answers 4

2

This provides better logic for PayPal Express redirect codes https://github.com/thinklikeamage/Stabilis_PaypalExpressRedirect

1

I strongly suspect that Magento 2 (as of 2.4.4) is missing the redirection that must be done on PayPal error 10486, during normal checkout and with "skip payment review" enabled. Notice that this is an error usually originated in PayPal, due to some problem with the selected source of funds (although there are some other possible reasons...), and therefore it can be some times solved by the user just by selecting another source of funds (therefore, we should really try to redirect).

My proposal would be to add in vendor/magento/module-paypal/Controller/Express/OnAuthorization.php:, within and by the end of the ApiProcessableException catch the following 5 lines of code (to inform the frontend where to redirect, since this is the backend running in the context of an ajax request):

        // ...
        } catch (ApiProcessableException $e) {
            $responseContent['success'] = false;
            $responseContent['error_message'] = $e->getUserMessage();
            if (ApiProcessableException::API_UNABLE_TRANSACTION_COMPLETE === (int)$e->getCode()) {
                $responseContent['error_message'] = __('The transaction could not be completed. Redirecting to PayPal to review details.');
                $responseContent['error_code'] = (string)(int)$e->getCode();
                $responseContent['redirectUrl'] = $this->_config->getExpressCheckoutStartUrl($this->_initToken());
            }
        }
        // ...

To trigger the redirect in the frontend, I would then add the following 8 lines or so, before the return reject(...), in the afterOnAuthorize method, in vendor/magento/module-paypal/view/frontend/web/js/view/payment/method-renderer/in-context/checkout-express.js:

        // ...
        if (
            typeof res['error_code'] !== 'undefined'
            && typeof res['redirectUrl'] !== 'undefined'
            && res['error_code'] === '10486'
            && res['redirectUrl']
        ) {
            return actions.redirect(res['redirectUrl']);
        }
        // ...

I cannot certify how stable is my suggestion, so use it at your own risk.

1

This issue is related to Magento's PayPal Payflow Pro Express Checkout payment method. Magento does not redirect customer back to PayPal, and just displays that error message instead: "This transaction couldn't be completed. Please redirect your customer to PayPal (#10486: This transaction couldn't be completed)."

There is no way to configure this redirection with Magento's backend settings.

However, there is a (paid) extension which helps your store to recover from funding failure with error code 10486. It improves Magento's functionality, redirecting a customer to PayPal automatically when error #10486 occured. PayPal then gives customer the option to select an alternate funding source or add a new one.

Here is the extension, it costs $ 10: Redirect to PayPal at error #10486

0

I had maganeto 1.9.3.2 and had the same problem. I solved it by:

copying

 app\code\core\Mage\Paypal\Model\Api\Nvp.php

to local folder: 

app\code\local\Mage\Paypal\Model\Api\Nvp.php

and changed the public function call($methodName, array $request) so that it does not throw exception for 10486 when validate response:

    if (!$this->_validateResponse($methodName, $response)) {
        if(isset($response["L_ERRORCODE0"]) && $response["L_ERRORCODE0"]=='10486'){
        }
        else{
            Mage::logException(new Exception(
                Mage::helper('paypal')->__("PayPal response hasn't required fields.")
            ));
            Mage::throwException(Mage::helper('paypal')->__('There was an error processing your order. Please contact us or try again later.'));
        }
    }

Instead of that now it throws exception in _handleCallErrors call, it will get redirected automatically by the magento logic.

If you want, you can add logic in _handleCallErrors function to not log exception if 10486 exception code is met.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.