Follow these directions to set up recurring commissions from Chargify for your Referral (or Affiliate) program.
- Go to Chargify -> Settings -> Webhooks
- Enable webhooks
- Specify URL to your webhook handler
- Check "Renewal Success" in "Webhooks subscriptions"
- Save webhooks settings
Add ambassador_chargify.php file to your libraries folder.
Set values for $username, $api_key and $campaign_uid variables, and add additional variables (optional).
You can find them here:
Additional Variable Information located in API docs:
- In your function which handles webhook data add this code:
NOTE: You need to specify path to your library folder
require_once(PATH_TO_LIBRARY_FOLDER.'/ambassador_chargify.php'); $ambassador_chargify = new Ambassador_chargify(); $ambassador_chargify->renewal();
4.2 PHP + CodeIgniter
- Run your webhook URL in a browser to check if there are any errors displayed. If you see blank page, it is ok.