PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Paypal and Member add on issues

  1. I have 2 different issues.
    1. I am using the paypal & member add on to allow people to buy a membership and add a donation, etc...AND register for our site at http://www.endeavourptsa.org. I can get the user over to paypal and transactions are successful, but some issues once the transaction is done.
    1. I have a redirect back to a volunteer page post purchase. It appears the user's login is broken, or never happens, once they go over to paypal. Once I come back to the site, the user is not logged in. The form successfully registers the user but once they come back the account info is not maintained. Is there a way to keep that login info so when they come back, I can use the account info to prepopulate the volunteer form and automatically add {user:display_name} to pull from the account?
    2. It also appears that while the form does register the user, they do not show up as an active member until they login again. I am using WP Symposium for the social components.....once they login post registration, they do show up. Ideas on how to make them show up without coming back to login? I do not have a requirement to click a link to activate their account.

    Thanks

    Posted 12 years ago on Friday August 24, 2012 | Permalink
  2. Regarding issue #2, that does not sound like default WordPress functionality. I would contact the author of the WP Symposium plugin to see if this something they have done.

    For issue #1, when did the user actually log in? If they are not logging in manually, you can try to auto log them in. I'm just curious in the process where they get logged in.

    Posted 12 years ago on Friday August 24, 2012 | Permalink
  3. The flow is they register with the form/registration add on, I take them to Paypal to pay, and then redirect them back to the site to complete a volunteer form. I was hopping the login info they just completed in registration could follow them to paypal and back....but maybe not? Not the end of the world to have them have to put their name in the form...but I was wanting to grab it automatically, and because of issue #2, hope to force them to login so they then show up in the site.....but If I use the themes standard login page (which is nicely formatted vs the WP one) it does not work as intended....

    Posted 12 years ago on Friday August 24, 2012 | Permalink
  4. interactive_bytes
    Member

    Hi Chris, I have tried auto logging the user in after coming back from Paypal, but not been able to. Have you got any ideas?

    Posted 12 years ago on Wednesday October 3, 2012 | Permalink
  5. @interactive_bytes, what code are you using to try and log them in, and can you post a link to your form? We can't give you any new ideas if we don't know what you've tried already.

    Posted 12 years ago on Wednesday October 3, 2012 | Permalink
  6. interactive_bytes
    Member

    [php]
    function autologin( $userID) {
            $user = get_userdata($userID);
            $user_id = $user->ID;
            $user_login = $user->user_login;
    
            //login
            wp_set_current_user($user_id, $user_login);
            wp_set_auth_cookie($user_id);
            do_action('wp_login', $user_login);
    
            $message = '
    <pre>' . print_r($userID) . '</pre>
    ';
    		mail( 'foo@bar.com', 'After Registration', $message);
        if (!is_user_logged_in()) {}
    
    }
    
    add_action( 'gform_user_registered', 'autologin', 10, 4 );

    The form is on this page and you click the Get Noticed flag to show the form: http://www.workingmothersconnect.com.au/beta/working-mothers/

    I am receiving the email within the function. I am guessing because you aren't on the site at the stage of firing the gform_user_registered action, it doesn't want to sign you in. Any ideas? If not is there anyway to know when you've come back from Paypal and get a email address or something that you signed up with, I could use that to sign them in after they arrive back.

    Posted 12 years ago on Thursday October 4, 2012 | Permalink
  7. interactive_bytes
    Member

    Any ideas if Paypal PDT is integrated?

    Posted 12 years ago on Thursday October 4, 2012 | Permalink
  8. I'm not sure how Paypal PDT is related. Can you explain? Do you mean as an alternative to automatically logging the visitor in?

    Posted 12 years ago on Friday October 5, 2012 | Permalink
  9. interactive_bytes
    Member

    Well the idea would be to grab the transaction ID or the like that paypal pass back and marry up to the user, then automatically log them in. Seems like the hooks in place get fired whilst you are still at paypal and using the login code doesn't work, but if you fire it once you come back to paypal it does work. Just not sure what the best option is for doing this.

    I see the paypal plugin uses this action for checking if the user is coming back from paypal: add_action('wp', 'blah', 5); Then proceeds to break up the gf_paypal_return variable.

    But am I right in thinking that that action gets questioned each page load? Causing undue processing? I managed to use this add_action('wp', 'login_user', 4); and use the same logic as in the paypal plugin to grab the $lead_id then find a user with meta equal to it for the entry_id. Obviously I'd love a hook in the paypal plugin around the function maybe_thankyou_page() to be able to run some login code..... ?? please??? Then ... if there was an update made to the plugin I wouldn't the run the risk of any breakages.

    Posted 12 years ago on Saturday October 6, 2012 | Permalink