# How to send commission to affiliates at time of Renewal

**URL:** <https://www.ruby-forum.com/t/how-to-send-commission-to-affiliates-at-time-of-renewal/169575>\
**Category:** Rails\
**Created:** [June 5, 2009, 2:27pm UTC](https://www.ruby-forum.com/t/how-to-send-commission-to-affiliates-at-time-of-renewal/169575 "2009-06-05T14:27:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@ravikanth](https://www.ruby-forum.com/u/ravikanth)\
**Post date:** [June 5, 2009, 2:27pm UTC](https://www.ruby-forum.com/t/how-to-send-commission-to-affiliates-at-time-of-renewal/169575/1 "2009-06-05T14:27:59Z")

</div>

Hi  
For renewal of the account i use crontab to execute  
renewal\_auto\_monthly\_transaction.rake file which make auto renewal for  
every 30 days billing cycle. My problem is for every renewal of the  
account means the amount charged for the renewal on that 20 percent  
commission must be added to affiliate.

Affiliates provide an api JavaScript which one sign up thank you i  
pasted the code which takes parameters amount,  
user name, transaction id and adds to the 3rd party affiliates  
account.

But for Renewal how can we add 3rd party JavaScript api(well this  
script cannot be used in rake file)…is there any alternative  
solution for this…?
