• I’m working to integrate PayPal’s Instant Payment Notification with WordPress to create users when subscriptions are paid for.

    I want it to go like this:

    1. The user clicks on a subscribe button on my site (a non-WP page) that links them to PayPal (easy, I used PayPal’s button maker in my business account).
    2. The user purchases a subscription using PayPal (done).
    3. PayPal sends me data at a page on my site with payment information. I send back verification that I’ve received the notification (done, with a little help from the PayPal developer’s forum).
    4. I write all the data I get from PayPal to two new tables I’ve created in my WP database so I can keep a record of transactions (done).
    5. Here’s where I’m stuck – now I need to automatically create a user from my non-WP page.

    I’d like to just use wp_create_user to insert everything, but I’m not sure what files I need to include to grab the right classes/functions. I’ve looked everywhere I can think of and tried at least a dozen different things with no success.

    Can I just do an insert directly into the wp_user table? If so, do I need to MD5 the password? Do I need to write data to wp_usermeta as well?

    Are there other processes I need to make sure I take care of? I know I’ll need to check for existing usernames, email addresses, etc., but I should be able to take care of that.

    Basically, I just need to know everything that needs to happen to create a user from outside of a WP page.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am asking the exact same question? Any ideas? Someone must have added users with wp_create_user or directly to the database?

    Best regards
    Ask2

    This is how I did:
    INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) VALUES
    (‘user1’, ‘md5 generated password’,’user1′,’[email protected]’,”,’some_date’,”,0,’user1′);

    I checked the databasse after adding a user from within wordpress and some other tables are also changed but it do seem to work anyway.
    I added a couple of hundred users like this and updated their roles from the admin interface.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom registration using my own data’ is closed to new replies.