Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    These callbacks have not changed in 2.4 I don’t think – we use them in our gateways. Is your class loaded?

    Thread Starter Musilda

    (@musilda)

    Yes, its loaded, i tied call url directly in browser and display -1

    Plugin Contributor Mike Jolley

    (@mikejolley)

    If its -1 your class is not loaded/constructed.

    Thread Starter Musilda

    (@musilda)

    Ok, here is my code:

    In plugin root file including file with class

    require_once( plugin_dir_path( __FILE__ ) . 'includes/fakturoid-notify.php' );
    $fakturoid_callback = new Fakturoid_Notify;

    and in class

    class Fakturoid_Notify {
    
      /**
       * Construct
       *
       */
      public function __construct() {
    
       add_action('woocommerce_api_fakturoid_notify', array($this, 'check_response')); 
    
      }
    
      public function check_response(){
        //Do something
    }

    And this worked minimally 10 months.
    I dont understand, what i doing wrong.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    That much looks ok. I assume in check_response you’ve tried echoing something followed by exit?

    And what is the endpoint URL?

    Thread Starter Musilda

    (@musilda)

    Endpoint url is shopurl.com/?wc-api=Fakturoid_Notify

    I tried echoing something, but i still getting -1
    Weird is, that this way worked for me, but now is returned 404 for every request.

    I have eight plugins, on 500+ eshops, which not working properly now.
    Exist other way, how check response?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Maybe obvious.. but is that plugin active? And do you get output via ?wc-api=WC_Gateway_Paypal

    Thread Starter Musilda

    (@musilda)

    Yes, plugin is active and PayPal returns IPN failure, dont using Paypal, now is only active, without settings.

    Ok, i will create my own endpoint for plugin, this must work.

    Thread Starter Musilda

    (@musilda)

    Issue isnt resolved, but i fix it with new rewrite endpoint for plugin.

    Thanks for your help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Api request url not working’ is closed to new replies.