Support » Plugin: PayPal IPN for WordPress » Basic hook content to show response

  • Resolved ionian

    (@ionian)


    Hi,
    Basically I just want to know what is the simplest bit of code I can add to the hook to show it is being fired.

    I have looked in the IPN logs on Paypal and in my own SSL server logs and it look like things are working.

    Just that the hook doesn’t seem to be firing.

    function jj_paypal(){
    echo “*************** TRANSACTION COMPLETE *********************”;
    }
    add_action( ‘paypal_ipn_for_wordpress_ipn_response_handler’, ‘jj_paypal’);

    Any help would be appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor angelleye

    (@angelleye)

    These hooks won’t be firing within a browser, so echoing to the screen isn’t going to help. Instead, you should send yourself a basic email. For example, this would send you an email with a dump of the data for every IPN that hits the system.

    function paypal_ipn_for_wordpress_ipn_response_handler($posted)
    {
        $to = 'my@email.com';
        $subject = 'Email from PayPal IPN';
        $message = 'The IPN was hit';
        $message .= "\n" . print_r($posted,true);
        wp_mail( $to, $subject, $message );
    }
    add_action('paypal_ipn_for_wordpress_ipn_response_handler', 'paypal_ipn_for_wordpress_ipn_response_handler', 10, 1);

    Ah right,
    So to get the details printed to the auto return screen I would save them first in a database and then retrieve them to show user. Creating my self a record of the transaction in the process.

    Thank you

    ps.

    I did notice that your add action section the first an second parts are the same. Will this not cause problems?
    add_action(‘paypal_ipn_for_wordpress_ipn_response_handler’, ‘paypal_ipn_for_wordpress_ipn_response_handler’, 10, 1);

    Hi, I mustn’t be getting sent to data because it looks like the ‘paypal_ipn_for_wordpress_ipn_response_handler’ isn’t being run.

    I ran the email sender in another hook and it worked for that.

    Cheers
    Ian.

    Oliver

    (@angelleyesupport)

    @ionian No, it will not, but If you like to change the function name, you can. Just make sure you handout the function to this hook and everything will work as expected.

    We would love to know what you think of our product and customer support. If you have a moment to [ leave a review ] it would be greatly appreciated.

    Thanks!

    My IPN history says that they have been sent but there is nothing in the plugin log (located in the uploads folder.)

    I have checked that the IPN url (taken from plugin page) is correct.

    Out of ideas just now but will go through this again from the beginning.
    Thanks for the comments
    Cheers
    Ian

    When I look at one of the items in the IPN history it gives notification URL has domainname.co.uk/index.php?wpeppsub-listener=IPN

    Is this correct?
    Thanks
    Ian.

    I see that the button is set as having
    <input type=”hidden” name=”notify_url” value=”https://www.domainname.co.uk/index.php?wpeppsub-listener=IPN”&gt;

    Should this be https://www.domainname.co.uk/?AngellEYE_Paypal_Ipn_For_Wordpress&action=ipn_handler

    Thank you
    Ian

    Plugin Contributor angelleye

    (@angelleye)

    Yes, if you are using notify_url in the button you would need to change that to the URL our plugin provides. Alternatively, you could remove that parameter from the button altogether and it would then fall back to the URL you have set in the PayPal account profile.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Basic hook content to show response’ is closed to new replies.