• Resolved michstar

    (@michstar)


    I’m trying to use this function:

    add_action(‘wpspc_paypal_ipn_processed’, ‘wspsc_my_custom_ipn_tasks’);

    function wspsc_my_custom_ipn_tasks($ipn_data) {
    $firstname = $ipn_data[‘first_name’];
    $lastname = $ipn_data[‘last_name’];
    $email = $ipn_data[‘payer_email’];
    $item_sold = $ipn_data[‘payment_status’];
    //Do something with the data
    return $item_sold;
    }

    However when I call this function in a template (the thank you page) I receive the following warning and notice:

    Warning: Missing argument 1 for wspsc_my_custom_ipn_tasks(), called in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\completed.php on line 21 and defined in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\functions.php on line 537

    Notice: Undefined variable: ipn_data in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\functions.php on line 538

    Notice: Undefined variable: ipn_data in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\functions.php on line 539

    Notice: Undefined variable: ipn_data in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\functions.php on line 540

    Notice: Undefined variable: ipn_data in C:\Users\Michiel Starrenburg\Documents\My Web Sites\naturelartbyroger\wp-content\themes\naturalartbyroger\functions.php on line 541

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter michstar

    (@michstar)

    Sorry, I managed to remove the first warning:

    but still receiving:
    Notice: Undefined variable: item_sold in /home/%user%/public_html/wp-content/themes/%sitename%/completed.php on line 21

    Notice: Undefined variable: email in /home/%user%/public_html/wp-content/themes/%sitename%/completed.php on line 21

    Notice: Undefined variable: item_sold in /home/%user%/public_html/wp-content/themes/%sitename%/completed.php on line 23

    In my template

    <?php wspsc_my_custom_ipn_tasks($item_sold, $email);             
                        return $item_sold;
    ?>
    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, is this test carried out in a local installation? Would you be able to carry out a test in a live site?

    • This reply was modified 9 years, 3 months ago by mbrsolution.
    Thread Starter michstar

    (@michstar)

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Have you set up your PayPal IPN correctly? If you have, can you test one of WordPress default themes like Twenty Fifteen and or Sixteen?

    Let me know how you go.

    Regards

    • This reply was modified 9 years, 3 months ago by mbrsolution.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘wspsc_my_custom_ipn_tasks’ is closed to new replies.