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.

Sending IDevAffiliate A Specific Amount

Home Forums Community Forum Sending IDevAffiliate A Specific Amount

Tagged: 

This topic contains 10 replies, has 3 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Friday Apr 26th, 2013 at 9:29 pm #48523

Is it possible to send to iDevaffiliate an exact dollar amount after the sale based on the sales transaction.

Instead of setting a % of the sale or sale with a discount, I want to calculate the commission based on a dollar amount that is predefined after the sale.

For example,

Product sells for $100. I want to send IDevAffiliate $50 to be the commission. Why don’t I just do 50%? Because if someone uses a coupon or discount code the $100 might be $79 or $81 – it will vary.

What I need to do is protect our base cost of the product which is a known and set. From there we can give a commission based on: Commission = Total Sale Price – ((Total Sale Price * Discount) + Product Cost)

If a Sale for $100 using a 15% Coupon and the product cost was $50.

Commission = $100 – (($100*.15) + $50) = $100 – $65 = $35

I want to send to IDevAffiliate $35.

I think I need to do this calc each time because every order/subscription could use any kind of discount. It varies.

Any thoughts or insight would be so appreciated.

Cordially,

Terry

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Saturday Apr 27th, 2013 at 8:35 am #48565

I guess you’d need your own script to do these calculations. So, instead of pointing to iDev directly, point to your script, calculate the amount and then pass it to iDev from there.

You could use the Notifications API instead of the tracking one. [hilite path]Dashboard -› s2Member® -› API / Notifications[/hilite]

Posted: Saturday Apr 27th, 2013 at 11:04 am #48575

Cristian,

Thank you for your reply. I appreciate your insight.

How would I go about intercepting the transaction and passing it to my script? Is this something that is triggered based the API Notification Handler?

It seems like the handler works such that an order gets placed and then data is passed to whatever URL’s are in the Handler list. One of the URL’s would be my script (PHP)

Am I thinking correctly?

So, the process would be: Order Placed > Data Send To Handler (Calcs the commission) > Send To IDevAffiliate

Your thoughts?

Cordially,

Terry

Posted: Monday Apr 29th, 2013 at 12:22 pm #48656

Cristian,

So, the process would be: Order Placed > Data Send To Handler (Calcs the commission) > Send To IDevAffiliate

Your thoughts?

Cordially,

Terry

Posted: Monday Apr 29th, 2013 at 7:29 pm #48684
Bruce
Username: Bruce
Staff Member

So, the process would be: Order Placed > Data Send To Handler (Calcs the commission) > Send To IDevAffiliate

That’s correct.

Jason wrote a nice article on creating an API Notification Handler here:

Knowledge Base » Building An API Notification Handler

How would I go about intercepting the transaction and passing it to my script? Is this something that is triggered based the API Notification Handler?

s2Member sends the data after the transaction is processed, for Payment Notifications, as well as when any recurring payment comes in. This varies for the different types of API Notifications.

Posted: Tuesday Apr 30th, 2013 at 3:12 pm #48813

Bruce,

Thanks your response. One last question (hopefully).

When a Payment Notification gets triggered and I have a MU Script that does some calc, how do I pass the data back to iDevaffiliate or S2Member?

Or, is this a one way communications. S2Member has a payment and it performs a call out to IDevAffiliate and whatever URL I have listed in the Payment Notifications.

I would then need to take that script and notify IDevAffiliate seperately outside of S2Member thus removing any integration between S2 and IDev?

Just trying to get my head around this…

Appreciate your insight…Thank You!

Cordially,

Terry

Posted: Tuesday Apr 30th, 2013 at 7:35 pm #48830
Bruce
Username: Bruce
Staff Member

When a Payment Notification gets triggered and I have a MU Script that does some calc, how do I pass the data back to iDevaffiliate or S2Member?

You’d want to connect to iDevAffiliate the same way s2Member would directly. iDevAffiliate provides you URLs like this that let it record purchases:

http://www.example.com/idevaffiliate/sale.php?profile=123&idev_saleamt=%%initial%%&idev_ordernum=%%subscr_id%%

You’d want to generate an 1×1 pixel image filling in this URL with the correct information, as shown here:

Dashboard -› s2Member® -› API / Tracking -› Integrating iDevAffiliate®

Posted: Tuesday Apr 30th, 2013 at 8:33 pm #48848

Bruce

Thanks again for your reply. So I can get my head around this…

I had IDevAffiliate do the integration (installation) It sounds like I need to undo this (I guess)

When a payment is made the notification gets triggered and sent to my script for processing, however how would I stop the order from going to IDev before I do my calc?

I’m not tracking with what you are saying.

I get the URL thing but I’m not following exactly how the flow goes as it pertains to an affiliate sending traffic and then an order gets made.

If I ddi nothing, IDev would capture the order and apply a commission. I need to divert that order, make a quick calc and send to IDev a different SaleAmt.

I get how to create a notification trigger, but the whole flow is tripping me up. Can you explain

As always, Thanks.

Cordially,

Terry

Posted: Tuesday Apr 30th, 2013 at 8:45 pm #48851
Bruce
Username: Bruce
Staff Member

When a payment is made the notification gets triggered and sent to my script for processing, however how would I stop the order from going to IDev before I do my calc?

You would take the integration out of your API Tracking settings. You’ll be doing an external integration.

I get the URL thing but I’m not following exactly how the flow goes as it pertains to an affiliate sending traffic and then an order gets made.

If I ddi nothing, IDev would capture the order and apply a commission. I need to divert that order, make a quick calc and send to IDev a different SaleAmt.

What you’re doing here is, instead of sending the data straight to iDevAffiliate from s2Member, is taking an s2Member API Notification (which provides more information), and using the information from that to send the data to iDevAffiliate. So your flow would be:

Payment Received -> API Notification Fired -> Your API Notification Handler gets the data -> Your API Notification Handler sends the data to iDevAffiliate with a tracking pixel

Posted: Tuesday Apr 30th, 2013 at 10:41 pm #48875

Bruce,

I get it…thank you! I really appreciate you for explaining this. Makes sense.

I’ve been reading the MU Plugin stuff.

Thanks again…

Cordially,

Terry

Posted: Tuesday Apr 30th, 2013 at 10:48 pm #48877
Bruce
Username: Bruce
Staff Member

Cool. Let us know if you have any further questions/concerns. :-)

Viewing 10 replies - 1 through 10 (of 10 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.