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.

Choosing the Right Affiliate Notification

Home Forums Community Forum Choosing the Right Affiliate Notification

This topic contains 1 reply, has 2 voices. Last updated by  Bruce 3 years, 5 months ago.

Topic Author Topic
Posted: Monday Jul 29th, 2013 at 5:02 pm #54353
Don Pezet
Username: dpezet

First, a little about my setup:
– WordPress Multisite v3.5.2
– s2Member Pro v130617
– Authorize.net is my payment processor
– iDevAffiliate Gold Edition v7.2

I need help selecting the right affiliate notification methods for my site. I understand each of the options, but none of them seem to fit the scenario I need. Here is what I have now:

Scenario 1:
– Affiliates are given a non-recurring referral commission for each new paying member.
– Pro Coupon Codes are used to track the affiliate.
– Users can signup for a free account (Level 0), or a paid account (Level 2 or 3).
– If the user signs up for a free account, no commission is issued.
– If the user signs up for a Level 2 or 3 account, we kick off a commission notification.

I have that configured using the “Signup Notification” in API/Notification and since it doesn’t fire for non-paying registrants it works flawlessly for new signups. So, that is the good part. Now the problem part.

Scenario 2:
– Users can upgrade from a free account (Level 0) to a paid account (Level 2 or 3).
– Pro Coupon Codes are used to track the affiliate.
– A commission should be issued when someone upgrades from a free account because it is now a paying account.
– Users can also upgrade from a paid account (Level 2) to a higher level paid account (Level 3).
– A commission should not be issued because this was already a paying account to begin with.

At first, I set this up using the “Modification Notifications” in API/Notification. However, I quickly realized that the modification notification fires in all modification scenarios, not just when the account becomes a paying account. That is a problem, because I don’t want to issue a commission for an already paying customer. Just for the customers that upgrade from a free account to a Level 2 or 3 account.

Unfortunately, it doesn’t look like there is any way for me to override whether the call gets made or not. Is there anyway to control the commission call from the Authorize.net Pro Form since each upgrade path requires its own form? If so, I could create a “Level 2 to Level 3” form that didn’t fire a commission, and the “Level 0 to Level 2” form and the “Level 0 to Level 3” forms could run like normal.

Is that possible? Or is there another way to go about this?

Thanks,

Don

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Wednesday Jul 31st, 2013 at 1:26 am #54455
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

At first, I set this up using the “Modification Notifications” in API/Notification. However, I quickly realized that the modification notification fires in all modification scenarios, not just when the account becomes a paying account. That is a problem, because I don’t want to issue a commission for an already paying customer. Just for the customers that upgrade from a free account to a Level 2 or 3 account.

You can’t accomplish this with s2Member’s API Notifications. You’ll have to use this hook to accomplish this:

ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify

See: Knowledge Base » Hacking s2Member® Via Hooks/Filters

You’ll notice that this says PayPal. That’s because s2Member routes all of its IPN handlers through the central PayPal IPN processor. All Modifications that include a Membership Level change go through this file, and by effect the above hook is called:

/s2member/includes/classes/paypal-notify-in-subscr-modify-w-level.inc.php

At the point that this hook is fired, s2Member is right about to upgrade the User based on the Subscription details. Here you can grab the current User object that s2Member has, and see if they are s2Member level 0 now. If they are, then you can do the process that you want to. Here’s some example code:

<?php
add_action('ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify', 's2hack_on_modify_level0');
function s2hack_on_modify_level0($vars = array()) {
	extract($vars);
	
	if(user_is($user->ID, 'subscriber') { // If the User is a subscriber at this point, then that means they're being upgraded from level 0.
		// We do our processing here
	}
}
Viewing 1 replies (of 1 total)

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.