If you are a plugin developer and want to integrate your plugin with the Affiliates Manager plugin then you can use the action hook.
When you want to track commission from your plugin (example: after a payment is confirmed or after a user submits the contact form), use the following code and pass the details to track the commission.
$args = array(); $args['txn_id'] = '4JX55705JA6177943';//TODO $args['amount'] = '49.95';//TODO $args['aff_id'] = '1';//TODO do_action('wpam_process_affiliate_commission', $args);
Getting the Affiliate’s ID
The affiliate ID value is stored in the browser’s cookie. You can access it like the following:
$aff_id = $_COOKIE['wpam_id'];
If you need to pass this value to a post payment script (exmaple: IPN handling script), then you can pass is via the custom field and access it later.