Page 1 of 1

idevaffiliate integration

PostPosted: December 30th, 2011, 10:49 pm
by jevans161
Hello:

I have idevaffiliate setup on a separate domain from s2member. I am using the instant payment notification method to track affiliate sales.

So under s2Member API / Notifications -> Payment Notification URLs, I have this:

http://www.outrageousmastery.com/affili ... v_saleamt=%%amount%%&idev_ordernum=%%txn_id%%&ip_address=%%cv1%%

and I have my order form short code configured with the custom attribute:

custom="www.yourhomeformastery.com|<?php echo $_SERVER['REMOTE_ADDR']; ?>"

I have php execution installed, and I have verified with previous sales that the ip address is being tracked correctly under %%cv1%%.

However, affiliate sales are not showing up in idevaffiliate. I tested my configuration of idevaffiliate, by taking the appropriate variables from a customer that should have shown up as affiliate sale, and created the following url:

http://www.outrageousmastery.com/affili ... .179.162.4

I copied and pasted this into a browser to test, and the commission showed exactly the way I expected in idevaffiliate. So something must be happened with s2Member not firing the payment notification url.

What do you think it could be?

Re: idevaffiliate integration

PostPosted: December 31st, 2011, 7:24 am
by Cristián Lávaque
Could you please enable logging and try a test transaction, then look for the related entries in the logs and paste them here x'ing out any private info? WP Admin -> s2Member -> PayPal Options -> Account Details -> Enable Logging

Have you watched this video? http://www.s2member.com/idevaffiliate-i ... ion-video/

Thanks!

Re: idevaffiliate integration

PostPosted: December 31st, 2011, 1:16 pm
by jevans161
Here you go.

Thanks.

Re: idevaffiliate integration

PostPosted: January 2nd, 2012, 12:26 pm
by jevans161
Yes, I have watched the video you posted. There is a new replacement code available (%%user_ip%%), and I changed the ipn url to include that replacement code, instead of using php execution to capture it as a custom variable. It has tracked a couple of affiliate sales, but I know the system is not functioning correctly, as there should be several more affiliate sales showing up. The test sale that I posted should have shown up as an affiliate sale, but it didn't.

Please help as soon as possible on this, I really need to get it done, it's for a client.

Thanks,

Jeffry

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 6:29 am
by Cristián Lávaque
Hmm... Could you add an email to your notification to check if notification is being fired and has all the vars in it? WP Admin -> s2Member -> API / Notifications -> Payment Notification -> Send An Email

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 1:55 pm
by jevans161
Sometimes it works, sometimes it doesn't.

Very strange, very frustrating. I have been trying to get the affiliate system integrated for weeks now.

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 1:56 pm
by jevans161
I have to have this up and running by tomorrow for this client. Please help as soon as possible.

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 1:58 pm
by jevans161
If you can tell how me how to access the amount of the sale via php, I can integrate this my own way. I've checked through a lot of documentation, and cannot find a price or amount variable that can be displayed on a page/thank you page. Just the email token, which is not what I need.

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 5:54 pm
by Raam Dev
What is WP Admin -> s2Member -> PayPal Options -> PayPal Account Details -> PayPal® Pro Forms / Recurring Profile Behavior set to? If it's not set to Real-Time / Direct Pay, then that might explain why the Payment Notification URL wasn't fired when you expected it to be.

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 6:03 pm
by jevans161
I'm using authorize.net pro forms

Re: idevaffiliate integration

PostPosted: January 3rd, 2012, 8:41 pm
by jevans161
I figured it out, it was an auto-login function messing up the initial tracking.

Thanks,

Jeffry

Re: idevaffiliate integration

PostPosted: January 4th, 2012, 3:25 pm
by Cristián Lávaque
Thanks for the update, Jeffry! Glad you found the problem. :)

What auto-login function was it?

Re: idevaffiliate integration

PostPosted: January 5th, 2012, 5:50 pm
by jevans161

Re: idevaffiliate integration

PostPosted: January 7th, 2012, 4:21 am
by Cristián Lávaque
Ah, got it. I thought that'd be the one you meant, but I wanted to make sure.

Did you try the version that I posted later in that thread to fix a problem? viewtopic.php?f=4&t=14211&p=29918#p31548

Re: idevaffiliate integration

PostPosted: January 7th, 2012, 12:58 pm
by jevans161
No, I passed the user's email address to the thank you page, and added a function to functions.php to grab the email address, find the user, and log them in automatically.

Code: Select all
function checkout_login() {
    if (!is_user_logged_in() && isset($_REQUEST['user_email'])) {        
        
//get the user's email from the checkout page
        $user_email = $_REQUEST['user_email'];
        //automatically log them in, and redirect them
        global $wpdb;
        $get_user_login = $wpdb->get_row('SELECT u.user_login FROM wp_users u WHERE u.user_email = "'.$user_email.'"');        
        $user_login 
= $get_user_login->user_login;
        $user = get_userdatabylogin($user_login);
        $user_id = $user->ID;
        wp_set_auth_cookie($user_id);
        wp_redirect('http://www.example.com/thank-you/');
        exit;
    }
}
add_action('init', 'checkout_login'); 

Re: idevaffiliate integration

PostPosted: January 12th, 2012, 4:56 am
by Cristián Lávaque
Ah, I see. I thought you said you had used the code in the post you linked to, but the one you quoted now is something else. Why don't you try the one I linked to?

Re: idevaffiliate integration

PostPosted: January 12th, 2012, 12:41 pm
by jevans161
I did try it. It caused the problem that prompted me to post here.