I’m using Membership free plugin on staging website with Paypal Single Gateway Sandbox mode of this membership plugin.
I want to get user id (logged in user id who purchased the membership) after user complete payment on paypal.
I’m using action hook ms_gateway_paypalsingle_payment_processed_pending which works after user pay on paypal but it return wrong user Id (always same user ID). I think this same user ID connected to that membership as I can see on Membership -> Billing page at my wp backend but it always shows same and don’t return the latest/exact user ID who purchased the membership.
only logged in users can buy membership on my website.
I want only 2 things.
1: User ID with action hook in my plugin who purchased that membership so I can implement further functionality for that user.
2: The membership name/slug user purchased.
I want only these 2 values after user paid payment on paypal.
So for I’ve used both parameters $invoice and $subscription of ms_gateway_paypalsingle_payment_processed_pending do_action hook but I can’t get user ID who purchased the membership.
Also note that get_current_user_id() function only return 0 on ms_gateway_paypalsingle_payment_processed_pending hook so can you do something like if you send logged in user ID who purchased the membership as hidden parameters and then return that User ID when response from paypal come?