Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Support request] Action hook swpm_payment_ipn_processed doesn't work for recurring paiements

Simple Membership Plugin › Forums › Simple Membership Plugin › Action hook swpm_payment_ipn_processed doesn't work for recurring paiements

  • This topic has 8 replies, 3 voices, and was last updated 6 years, 4 months ago by admin.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • July 19, 2019 at 7:23 am #18646
    tester
    Participant

    Dear,

    Great plugin!
    I tried out the swpm_payment_ipn_processed action hook on recurring paiements, but it is only triggered when the first paiement occurs, not when the recurring paiements occurs. Any idea how to fix this?
    And can you also tell me what is the name of the array that is returned so I can capture the data?

    July 21, 2019 at 6:00 am #18649
    mbrsolution
    Moderator

    Hi, thank you for reaching out to us. I have submitted a message to the developers to investigate further your question.

    Kind regards

    July 22, 2019 at 7:19 am #18658
    admin
    Keymaster

    It should get triggered both for the first payment and the recurring payments. Please enable the debug log feature of the plugin. Then after you receive a recurring payment, check the log file to see if you see the following line in the log file:

    
    Transaction data saved.
    

    The action hook is triggered just after that. So seeing that line in the log file means, it is getting executed.

    February 5, 2020 at 2:45 pm #19739
    tester
    Participant

    Thanks for your answer.
    Can you also tell me what the returned array contains as data? Can you give me an example of a returned array? Need to know what it contains and how it is fully returned to be able to use the returned data.

    February 5, 2020 at 10:27 pm #19745
    admin
    Keymaster

    We don’t have example data for this. You can dump the array content to a file from your test script to see what you are receiving. Below is an example of how the $ipn_data array structure looks like:

    $ipn_data[‘mc_gross’]
    $ipn_data[‘first_name’]
    $ipn_data[‘last_name’]
    $ipn_data[‘payer_email’]
    $ipn_data[‘membership_level’]
    $ipn_data[‘txn_id’]
    $ipn_data[‘subscr_id’]
    $ipn_data[‘swpm_id’]
    $ipn_data[‘ip’]
    $ipn_data[‘custom’]
    $ipn_data[‘gateway’]
    $ipn_data[‘status’]

    February 6, 2020 at 11:00 am #19746
    tester
    Participant

    Great, thanks for the answer. Does the hook also work with test payments (sandbox mode)?

    February 6, 2020 at 11:27 pm #19748
    admin
    Keymaster

    Yes, that hook will be triggered for testmode transactions also.

    February 7, 2020 at 9:34 am #19752
    tester
    Participant

    Well it doesn’t seem to work. I created in stripe in test mode a payment, but no action was triggered.
    This is my code in functions.php in WordPress

    add_action('swpm_payment_ipn_processed', 'after_received_payment');
    function after_received_payment($ipn_data)
    {
    		$webmaster = "myemail@yahoo.com";
    		$subject = "Paiement received test function";
    		$msg     = "Hello" . "\r\n";
    		$msg     .= "test functions.php Simple membership". "\r\n\r\n";
    		$msg     .= "Payer email :".$ipn_data['payer_email']."\r\n\r\n";
    		$msg     .= "Custom data : ".$ipn_data['custom']."\r\n\r\n";
    		$msg     .= "Gateway : ". $ipn_data['gateway']."\r\n\r\n";
    		$msg     .= "Status : ".$ipn_data['status']."\r\n\r\n";
    		$msg     .= "MC gross : ". $ipn_data['mc_gross']."\r\n\r\n";
    		wp_mail($webmaster, $subject, $msg );

    }

    Any suggestion how to make it work?

    February 7, 2020 at 11:47 pm #19755
    admin
    Keymaster

    I can’t see any obvious mistakes in there. This custom coding troubleshooting is beyond the scope of this free support forum. It will need to be handled via a paid ticket option.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy