Needs to redirect users on UNPROCESSABLE_ENTITY > PAYER_ACTION_REQUIRED - No checkout possible

Created on 26 November 2024, 26 days ago

Problem/Motivation

Using PayPal Checkout with the buttons in cart can sometimes lead to a PayPal error with
name: UNPROCESSABLE_ENTITY
details: issue: PAYER_ACTION_REQUIRED

You can find more details here:
https://www.paypal-community.com/t5/Sandbox-Environment/PAYER-ACTION-REQ...

Steps to reproduce

Use PayPal with Checkout buttons in the cart
Click the checkout buttons, enter your PayPal data and proceed with the checkout.
When trying to finish the checkout, see an error message. In background an exception is thrown like the one described in the paypal community.

Proposed resolution

If this kind of error appears, redirect the user to the given URL (where rel="payer-action")
Check if there can be any root cause, like described in https://www.paypal-community.com/t5/Sandbox-Environment/PAYER-ACTION-REQ...

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

PayPal Checkout

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    Maybe the reason for paypal to check again could be different order totals in the cart (because no shipping could be calculated yet) and checkout (with shipping collected)? Any other ideas why PayPal might ask for confirmation?

    Regular checkout, not using the Checkout buttons in cart, selecting PayPal as regular payment method, works correctly!

  • 🇮🇱Israel jsacksick

    This is no longer fresh for me, would be great if you could investigate and report back.

  • 🇩🇪Germany Anybody Porta Westfalica

    Yeah I'll try to do my best, first I'd like to find out the root cause - sadly PayPal returns no details, why it wants re-confirmation. It doesn't only happen for my PayPal account (thought maybe rate limit for my tests), but any PayPal account using the Smart Checkout buttons.

    Should you have any idea, please let me know.

    Here's the ERROR returned:

    {
       "name":"UNPROCESSABLE_ENTITY",
       "details":[
          "@""issue":"PAYER_ACTION_REQUIRED",
          "description":"Payer needs to perform the following action before proceeding with payment."
       ],
       "message":"The requested action could not be performed, semantically incorrect, or failed business validation.",
       "debug_id":"0e90efd2abb2d",
       "links":[
          "@""href":"https://developer.paypal.com/api/rest/reference/orders/v2/errors/#PAYER_ACTION_REQUIRED",
          "rel":"information_link",
          "method":"GET",
          "@""href":"https://www.paypal.com/checkoutnow?token=XXXXXXXXXXXXXXX",
          "rel":"payer-action",
          "method":"GET"
       ]
    }
    
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica

    @jsacksick do you know any project where Show Smart Payment Buttons on the cart page is working in production and Checkout completes correctly?

    I really can't get it working due to the response from PayPal given above. Regular checkout works, but sadly the message from PayPal doesn't explain any details why the user needs to re-confirm the order.
    I already tried pre-calculating the total amount, as I thought maybe the problem is that the final amount is different, but it still fails with the same error.
    Furthermore I'm not sure how we should implement that redirect then, because it wouldn't be nice to redirect the main page, I think?
    Guess typically that's done in the popup.

    But first I'd really like to know what's this caused by and if it works somewhere. Maybe we can circumvent this problem...

Production build 0.71.5 2024