Support » Plugin: PayPal IPN for WordPress » Updating WordPress table with hook not working..

  • Resolved schmutly

    (@schmutly)


    Hello,
    not sure why my function isn’t working. Im triggering on payment status ‘Completed’ to paste the data in the array below into a new table.
    Can you see what i have done wrong?
    Thank you,
    Rob

    add_action(‘paypal_ipn_for_wordpress_payment_status_completed’, ‘post_to_my_ipn_tbl’, 10, 1);
    function post_to_my_ipn_tbl($posted)
    {
    global $wpdb;
    $table_name = $wpdb->prefix .”ipn_data_tbl”;
    $wpdb->insert( $table_name, array(‘payer_email’=>$payer_email,’first_name’ => $first_name,’last_name’ => $last_name ) );
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • Oliver

    (@angelleyesupport)

    Hi @schmutly

    Thanks for your feedback, We are looking into this and will get back to you soon.

    Thanks!

    Oliver

    (@angelleyesupport)

    Hi @schmutly ,

    The issue seems that you are trying to insert values which you have not assigned to those variables, nor they are available inside the function.
    try this https://pastebin.com/vPpUMqEZ and it will work fine.

    Let me know if you have any other questions or concerns.
    Thanks!

    schmutly

    (@schmutly)

    Thanks muchly Oliver.
    I will try that shortly. While waiting i went looking and came up with this (which works too) but now i need to process yours to see what i did wrong (to learn and understand)
    I came up with https://pastebin.com/LLnJcPAJ but i will go with your paste 🙂
    Thank you..will leave a review after this.
    Rob
    ps where’s the “leave a support review” link again?

    • This reply was modified 8 months ago by  schmutly.
    Oliver

    (@angelleyesupport)

    Sounds great.
    Happy to help , Please mark the issue as resolved and we will really appreciate your feedback here.

    Thanks!

    schmutly

    (@schmutly)

    Oliver and Angell have always been extremely helpful even if we ask dumb questions.
    It’d be nice to borrow their brains for a day, I’d get a lot done.
    If you have issues with PayPal plugins or just PayPal in general these are the guys to goto 🙂
    Thanks again for the clean code
    Rob.

    Plugin Contributor angelleye

    (@angelleye)

    Thanks for that awesome feedback! If you have a moment to leave it in the reviews section that would be great. 🙂

    https://wordpress.org/support/plugin/paypal-ipn/reviews/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Updating WordPress table with hook not working..’ is closed to new replies.