• On https://crowdyhouse.com/ we currently have an error causing the status of an order changing from pending payment to processing twice on about 80% of our orders. This is causing duplicate order confirmations emails to be sent to our seller, which I believe is causing neither to be sent or turning them both into spam.

    I have disable our theme defaulting to storefront and all none essential plugins have been disabled but still the problems exist 80% of times on identical orders.

    I have added and extra order note in WC_Order::status_transition() hoping to find the source of the problem.
    woocommerce/includes/class-wc-order.php line 338

    $this->add_order_note( $this->get_id() . “–ORder Info–” . print_r($status_transition, true) . ” Debug trace ” . print_r( wp_debug_backtrace_summary() , true) );

    The resulting order notes are as follows;

    Order status changed from Pending payment to Processing.

    added on October 22, 2018 at 12:01 pm Delete note

    Order status changed from Pending payment to Processing.

    added on October 22, 2018 at 12:01 pm Delete note

    438672–ORder Info–Array
    (
    [from] => pending
    [to] => processing
    [note] =>
    [manual] =>
    )
    Debug trace require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/storefront/template-fullwidth.php’), get_template_part, locate_template, load_template, require(‘/themes/storefront/content-page.php’), do_action(‘storefront_page’), WP_Hook->do_action, WP_Hook->apply_filters, storefront_page_content, the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, WC_Shortcodes::checkout, WC_Shortcodes::shortcode_wrapper, WC_Shortcode_Checkout::output, WC_Shortcode_Checkout::order_received, wc_get_template, include(‘/plugins/woocommerce/templates/checkout/thankyou.php’), do_action(‘woocommerce_thankyou’), WP_Hook->do_action, WP_Hook->apply_filters, mangopayWCMain->order_received, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition

    added on October 22, 2018 at 12:01 pm Delete note

    438672–ORder Info–Array
    (
    [from] => pending
    [to] => processing
    [note] =>
    [manual] =>
    )
    Debug trace require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, mangopayWCWebHooks->parseRequests, mangopayWCWebHooks->handleRequest, mangopayWCWebHooks->handlePayinSuccess, mangopayWCWebHooks->validate_order, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition

    added on October 22, 2018 at 12:01 pm Delete note

    This problem does not exist on local machine, but does on live and staging website running on a aws ec2 with an elastic load balancer.

    Have you seen anything like this before? any ideas? Do you think the mangopay plugin could be the cause of this?

    Thanks

    Michael Compton

Viewing 1 replies (of 1 total)
  • Plugin Author Yann at WP&Co

    (@ydubois)

    @mjamescompton one possible reason that comes to mind for the duplicate validation of payments would be a webhook that triggers a second validation. Webhooks are necessary for the validation of bank transfers only: please make sure that you did not manually setup any webhook in the MANGOPAY dashboard for anything else.

    The plugin will register the necessary webhooks if payment by bank transfer is enabled, and you should avoid adding any other webhook URL to the configuration.

    I see that mangopayWCWebHooks is mentionned in your debug trace, so this would strongly indicate that an incoming webhook is indeed the source of the redundant payment validation.

    Now, if this is the case you will see notes about the webhook in the order notes.

    The peculiar thing is that once the order has been upgraded to “processing”, it should not go back to “pending”. So even if an incoming webhook triggers the order validation process again, it should not fire up another e-mail.

    We did not notice duplicate e-mails on our tests platforms, however it should be easy for us to improve the code and completely avoid this duplicate validation. We will check on that, thank you for the detailed report!

Viewing 1 replies (of 1 total)
  • The topic ‘Duplicated Order Status Change from pending payment to processing’ is closed to new replies.