Postback on successful charge, or an alternate way to handle referral discounts?
One of the requirements in our client's business model is to allow customers to get referral discounts for referring new members. The rules around this are as follows:
- A user who refers another user will receive a month of
discounted service for each paid referral account.
- Referral discounts stack up by adding additional discounted months, not by just applying a credit to the bill. Example: Subscriptions cost $20.00/mo, and a referral gets a $10.00 discount. 2 referrals mean 2 months at $10.00/mo, not 1 free month.
I had originally thought that we could switch products to a discounted product on a successful referral and increment a counter for free months. Then, when billing occurred, a postback could be handled which would decrement this counter and then reset the product to non-discounted status if the counter had reached 0. This was before I realized that postbacks only occurred on changes to the account, not on successful payment processing.
Do you have any suggestions for how this model might be accomplished with Chargify?
Thanks!
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by David H. - Chargify on 22 Feb, 2010 05:17 PM
Ernie,
This is a great question and would be much easier once the full support for discounts and promotions is released. I developer will take a look at this and see if there is a short-term solution. This may take a day or two.
3 Posted by Brian R. - Chargify on 25 Feb, 2010 07:02 PM
Hi Ernie,
After a few lengthy internal discussions, we have not been able to come up with a good way to handle the case you need.
However, we are planning to implement a more robust notification/postback system in the future. This feature has not yet been scheduled, but we will keep you posted as we make progress.
Please let me know if you have any other questions or concerns.
Thanks,
Brian
4 Posted by Ernie Miller on 25 Feb, 2010 08:01 PM
Brian,
Thanks for the research, and the transparency, at least. I'm at a loss for how we can meet their needs in the meantime. Possibly a periodic poll of the subscription's product, status, and billing period start or end date.
5 Posted by Brian R. - Chargify on 26 Feb, 2010 10:04 PM
Hi Ernie,
One method (which is not ideal, but could work) would be to track the next_assessment_at value and setup the appropriate product for that subscription the day before the assessment is scheduled to take place. In your app, you could track the number of free months and decrement each time you move them down a rung.
This would require some rather creative logic on your part. I hope we can come up with a more ideal solution for you very soon.
Thanks,
Brian
David H. - Chargify resolved this discussion on 26 Feb, 2010 11:03 PM.
Ernie Miller re-opened this discussion on 09 Mar, 2010 02:14 PM
6 Posted by Ernie Miller on 09 Mar, 2010 02:14 PM
Brian,
Thanks, sounds like you confirmed my suspicions as to how to go about it. This is what I ended up with. The idea is that it will run on a schedule of nightly or more frequently. I updated my copy of the PHP API to provide some very basic caching of Chargify subscription info in a table called subscription_cache in my local app.
PHP is not my preferred language (I'm a Rails guy), but I think the general logic is sound, which has been outlined in the comments. Could someone there verify that comparison of current period start dates should indicate when a billing has occurred?
7 Posted by Brian R. - Chargify on 10 Mar, 2010 05:27 PM
Hi Ernie,
The current_period_starts_at value should be the value you want to use for comparison. You could also make use of current_period_ends_at or possibly next_assessment_at for similar logic.
Thanks,
Brian
Support Staff 8 Posted by Lance W. - Chargify on 15 Mar, 2010 04:17 PM
Hi there, I'm going to close this ticket. If you have other questions, please reply to it or open a new ticket.
Thanks.
--- Lance
Lance W. - Chargify resolved this discussion on 15 Mar, 2010 04:17 PM.