latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Action hook did not trigger after payment

Home Forums Community Forum Unofficial Extensions/Hacks Action hook did not trigger after payment

This topic contains 0 replies, has 1 voice. Last updated by  SDN Admin 3 years, 1 month ago.

Topic Author Topic
Posted: Monday Nov 11th, 2013 at 6:02 am #61000
SDN Admin
Username: sdn

Hello Community,

I have taken over a project that is totaly uncommented and very unstructured. The customer wants that corporate membership enters up to 4 users in the registration process (so 1 real s2member and 4 data informations). After successful payment the user will be returned to the page.

Here I want to integrated an action hook that triggers if the user returns to the page after a successful payment and the user role was set to corporate membership. (After that my function gets the 4 data informations and creates 4 new accounts with the right capabilites)

My function is already complete, but the problem is that it doesn’t trigger. I tried those hooks so far:

  1. ws_plugin__s2member_after_paypal_return
  2. set_user_role
  3. ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars

Here is my testhook to check up the hooks. Nothing happens.

add_action('ws_plugin__s2member_after_paypal_return', 'expiration_date');
function expiration_date($vars = array()) {
	wp_mail( 'testaccount@testbox.com', 'Test', 'TEST' );
}

My function is inside mu-plugins/s2hack_corporate_memberships.php

I prefer to use set_user_role to get old and new user role for extended functions.

Maybe you have any clue why my functions don’t trigger?

Thank you in advance!

Update*:

Ok I’m now able to use set_user_role as hook after payment through paypal. It was the priority level ($priority).

But after returning from the paypal site the get_user_field(’email_1′, $user_id); function does not return any data.

Is this because the user has no data yet or because the function is no available at this time?

  • This topic was modified 3 years, 1 month ago by  SDN Admin.

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.