• pl3bs

    (@pl3bs)


    Hello s2member community. I am having issues with the API Notifications. This is a new ubuntu 14.04.02 server install, fresh wordpress, s2member pro setup. I have verified webhook for stripe is working, smtp email is working.

    So I made a directory for mu-plugins inside the wp-content directory. I chown it to the apache user -R. I then copied the example code for s2-payment-notification, renamed each “payment” to “signup” and insert the appropriate link in the signup section.

    There is nothing which seems to be happening. I set the email address to confirm the API trigger is successful, it does not send. I have a one line execution of a super simple script to test the process, it does not execute.

    Where may I be missing something? I need to be executing scripts via the API-notifications feature when new signups, upgrades/downgrades, or EOT occurs. This should be rather straight forward. I must be missing something simple. I really need to be focusing on the scripting which needs this feature in order to successfully launch my company next month. If someone could please give me some support that would be much appreciated.

    Here is my s2-signup-notification.php code:

    <?php
    add_action('init', 's2_signup_notification');
    function s2_signup_notification()
        {
            if(!empty($_GET['s2_signup_notification']) && $_GET['s2_signup_notification'] === 'yes')
            // ↑ In my URL, I have <code>?s2_payment_notification=yes</code>, that's what I'm looking for here.
                {
                    if(!empty($_GET['user_id']) && !empty($_GET['item_number']))
                    // In my URL, I have <code>&user_id=%%user_id%%&item_number=%%item_number%%</code>, that's what I'm looking for here.
                        {
                    exec('cd /var/www/prodiscourse.com/wp-content/mu-plugins && ./success.sh');
    
                    exit; // We can exit here. There's no reason to continue loading WordPress in this case.
                }
        }
    }

    Thanks in advance!

    pl3bs

    https://wordpress.org/plugins/s2member/

Viewing 1 replies (of 1 total)
  • krumch

    (@krumch)

    Difficult to say what is wrong exactly, did you get some message in error_log file?

    Also there is a syntax error in the code, the opening brake above the “exit” is not closed.

Viewing 1 replies (of 1 total)

The topic ‘API Notifications Error’ is closed to new replies.