• Resolved skinperforator

    (@skinperforator)


    Hello,
    we have problems with some orders and the PayPal payment. Customers can’t finish the payment. As far as I can see the orders are being created but there is no payment received (status staying at awaiting payment).
    In the plugin’s logs there are no errors but also I noticed that by far not all orders/payments are even captured in that log. Even some successful payments are not in there. Besides that it’s only CHECKOUT.ORDER.APPROVED and PAYMENT.CAPTURE.COMPLETED in there.
    Unpaid orders than automatically get cancelled because of timeout.
    One customer send us that error message he received:

    Any idea how to resolve this? Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @skinperforator

    Besides that it’s only CHECKOUT.ORDER.APPROVED and PAYMENT.CAPTURE.COMPLETED in there.

    Those are the main events that the webhook listens for so that’s normal.

    The PayPal plugin uses the WordPress core request API to communicate with PayPal. You likely have some 3rd party plugin that’s using filter http_request_args to manipulate the body property of the request, setting it to a boolean value, which results in that validation error.

    The PayPal plugin wouldn’t be sending that boolean value.

    Kind Regards

    Thread Starter skinperforator

    (@skinperforator)

    Hi, thanks for the response!
    I was thinking: in that case you describe, wouldn’t it be that all the orders don’t work? In our case it’s sometimes so sometimes so. And can you explain why not all orders are in the log at all?

    Plugin Author Payment Plugins

    (@mrclayton)

    I was thinking: in that case you describe, wouldn’t it be that all the orders don’t work? In our case it’s sometimes so sometimes so.

    That depends on the logic of the plugin or code that’s using filter http_request_args. The reason I know it’s not caused by the PayPal plugin is because it doesn’t populate the body property unless the HTTP method requires it. If that property isn’t populated, WordPress defaults it to empty strings.

    But in your case, it’s being set to a boolean of false which means it’s being manipulated.

    Kind Regards

    Thread Starter skinperforator

    (@skinperforator)

    If I list you our plugins, would you know which one is most likely to cause this?

    Plugin Author Payment Plugins

    (@mrclayton)

    No, it would be impossible to tell just by looking at your list of active plugins.

    If you don’t find the plugin that’s causing that, then your best option is to user the filter http_request_args and ensure that the body property is never a boolean. Example:

    add_filter('http_request_args', function($args){
        if(array_key_exists('body', $args)){
            if(is_bool($args['body'])){
                $args['body'] = '';
            }
        }
        return $args;
    });

    Kind Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Payments fail, order cancelled’ is closed to new replies.