This topic contains 2 replies, has 1 voice. Last updated by Don Pezet 3 years, 4 months ago.
Topic Author | Topic |
---|---|
Posted: Wednesday Aug 21st, 2013 at 10:40 pm #56390 | |
First, a little about my setup: I am really struggling with getting commissions setup properly for my environment. Here is what I am trying to achieve: 1) Commissions should not be issued for people who cancel in their 7 day trial period. I have two types of access on my system: a monthly subscription and an annual subscription. Both subscriptions have a 7 day free trial. I use affiliate coupon codes entered in my Authorize.net pro forms to identify who the affiliate was that referred the customer. I want to issue a one time flat fee commission to the affiliate when I receive payment from the customer. I do not want to issue a commission in the event the customer cancels in the 7 day trial period. I also do not want to issue a commission for any ARB renewals (monthly or annual) that the customer may make. Here is what I have tried, and the issues I have run in to with each: 1) I started out using API/Signup Notifications. This worked well as only one commission notification was sent to iDevAffiliate and commissions were not issued on ARB renewals. However, this notification is sent out immediately upon signup, so if the user cancels during the 7 day trial iDevAffiliate still shows a commission. Is there a way to trigger a cancellation notification to iDevAffiliate if they cancel in their trial? 2) Next, I switched to API/Payment Notifications. This worked well as it wouldn’t issue a commission while a customer was in their trial period. As soon as they paid, the commission was issued. That solved the problem of issuing commissions on free trial cancellations. However, this notification triggers on ARB renewals so iDevAffiliate was receiving commission notices for payments I don’t want to issue commission for. Is there a variable I can include that indicates the payment number so I can filter it out on the iDevAffiliate side? For example, this is the customers 1st, 2nd, 3rd, 84th payment? 3) At this point, I decided the API.Notification and API/Tracking system wasn’t going to suite my needs as it is out of the box. So, I took a shot at writing my own filter. I figured I could do a hook in to the API/Payment Notification and filter the notifications based on how long it had been since the user signed up. I figured I could query s2member_paid_registration_time() I could limit when the notification was fired. For example, I could wait until after the 7 day trial period but cut it off before a monthly subscription renewed. So, only fire the payment notification if the s2member_paid_registration_time() returned a value between 8 and 27 days. With 8 days being greater than the 7 day trial, and 27 days being one day less than the shortest month of the year. However (and I’m guessing a little) this wasn’t precise enough. The free trial ends and the first payment occurs at the same time. So I couldn’t get this to work. Would I need to change the ranges to greater than 6 days 23 hours and 59 minutes to ensure that I catch the payment notification? Or is there another trick here? 4) Now I’m looking for other options. Is there a way to query what payment number this is? e.g. Is it the user’s first payment, or second? If so, I could use that to allow the payment notification to go through, or otherwise filter it out. I suppose I should add a fifth option which would be that I could be a giant bone-head and there is some super simple way to do this and I am making it harder than I should. Either way, I am open to suggestions and willing to try anything. If you have made it this far in my post you already deserve an award. Thanks for all of your help, Don Pezet |