• Resolved ts0n

    (@ts0n)


    I am developing a custom payment gateway.

    I am trying to add a notice in gateway’s webhook function like

    public function webhook() {
    if ( $_REQUEST[“status”] !== “success” ) {
    wc_add_notice( __( ‘Payment failed.’, ‘gateway’ ), ‘error’ );
    wp_safe_redirect( wc_get_checkout_url() );
    }
    }

    The code above redirects to checkout page but notice does not appear.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Hi @ts0n

    Thanks for reaching out!

    I understand that you are developing a custom payment gateway using the code snippet above, however, it is not working as expected.

    This is a bit of a complicated topic that would need some customization to address. Unfortunately, custom coding is not something we can assist with directly. However, I’ll keep this thread open for a bit to see if anyone from the community can lend a hand.

    If you have any other questions related to development or custom coding, don’t hesitate to reach out to some of the great resources we have available for support. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Create notice in custom gateway webhook’ is closed to new replies.