• Resolved chinjohn

    (@chinjohn)


    I can’t seem to get the IPN response sent to the address I specified on my paypal account. Instead I can only see the IPN on the “orders” section of the “wp-paypal” plugin.

    I want the ipn sent to the address I specified on m paypal account because I want to log the transaction on my database and give content access only to people who I have their details on my database.

    Is there a way I can do this?

    Thank You.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Noor Alam

    (@naa986)

    @chinjohn, The plugin overrides the default IPN URL so it can process the order. You can use the action hook that it triggers after processing the order. For example:

    
    function my_callback_function($ipn_response) {
        // do stuff
        
    }
    add_action('wp_paypal_ipn_processed', 'my_callback_function');
    
    Thread Starter chinjohn

    (@chinjohn)

    Ok Thank You for your response. I already tried something else and it worked fine.

    I edited your ipn file(between line 149 and 150) like this:

    wp_paypal_debug_log("Order information updated", true);
    // do stuff
    do_action('wp_paypal_order_processed', $post_id);

    It worked and the debug log still reached the last line “IPN processing completed”. Hope its still cool I did it like that right?

    Thank You.

    Plugin Author Noor Alam

    (@naa986)

    @chinjohn, This should work but the code will get overriden every time you update the plugin. It’s better to have a separate file where you listen to the hook and run additional tasks (as shown in my example).

    Thread Starter chinjohn

    (@chinjohn)

    Ok. Thank You I’ll see how I can handle this.

    I am trying to call a function using your example but it isn’t working.
    I have the following line in paypal-ipn.php (line 142) :
    add_action(‘wp_paypal_ipn_processed’, ‘my_callback’);

    Then in a separate file I have this (for testing)
    function my_callback() {
    $now=date(“Y-m-d H:i:s”);
    $fp = fopen(‘feedback.txt’, ‘a’);
    fwrite($fp, ‘Function triggered.’);
    fwrite($fp, “\n”);
    fwrite($fp, “$now”);
    fwrite($fp, “\n”);
    fclose($fp);
    }

    —————
    I have a include line at the top of paypal-ipn.php for the file I created.
    No Luck – any ideas would be appreciated.

    Update:
    I think I got it. I have created a plugin with the code and it seems to be working. This way my code should be untouched when the wp-paypal plugin is updated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘IPN’ is closed to new replies.