In my Ruby on Rails SaaS application users can subscribe to monthly or yearly plans. I am using Stripe as a payment processor. Stripe also handles all the subscriptions and re-bills users on a monthly (or yearly) basis.
I am also a member of an affiliate network which gets notified about every new subscription / charge that a user makes, so that the advertiser may get rewarded (if there is one). This works great for new subscriptions because Stripe instantly notifies me if a payment went through or not.
But what about recurring subscription payments? I have to (and want to) inform my affiliate network about those too, however, in my web application I can't really detect whether a recurring payment has been made. I can assume that it will be made, say, on the 24th of each month but that's not for sure.
Is there a better way for a web app to detect when a recurring subscription payment has been successfully processed by Stripe? My affiliate network requires me to show some little Javascript snippet on the frontend whenever a charge has been made.
Thanks for any help.