This integration method uses Recurly API to identify last payment of the customer and to record a commission based on that.

1.

Recurly configuration

This integration method uses "Thank you page" especially PHP one, so if you do not have one, please create it. When you have the site, navigate to Configuration> Subscription Plans section and edit your subscriptions. Set "Return URL after Success" to your thank you page, where Recurly API will be used.
Add this string to each URL:

?account_code={{account_code}}&plan={{plan_code}}

In case you already have question mark in the link, change the one in above code to ampersand symbol.

2.

Enable API

In Developer> API credentials section enable your API if it is not enabled yet, and get your API key.

Please, download Recurly API files as you will need it in the next step. Now, navigate to Developer> Push Notifications and use Configure button to set Push Notification URL to point to http://URL_TO_PostAffiliatePro/plugins/Recurly/recurly.php

Finally, enable Recurly plugin in your Plugins section in merchant panel.

3.

Integration code

Open your thank you page for editing and paste this code to the file:

<?php
if (!empty($_GET['account_code'])) {
require_once('lib/recurly.php');

Recurly_Client::$apiKey = '12345678912345678912345678912345'; // set your API key here

$invoices = Recurly_InvoiceList::getForAccount($_GET['account_code']);

foreach ($invoices as $invoice) {
  $inv = explode(", ","{$invoice}");
  foreach ($inv as $key=>$value){
    $res = explode("=",$value);
    if ($res[0] == "invoice_number")
      $orderID=$res[1];
    if ($res[0] == "subtotal_in_cents")
      $total=$res[1]/100;
  }
  break;
}
?>

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/salejs.php" type="text/javascript">
</script>
<script type="text/javascript">

var sale = PostAffTracker.createSale();
sale.setTotalCost('<?php echo $total;?>');
sale.setOrderID('<?php echo $_GET['account_code'];?>');
sale.setProductID('<?php echo $_GET['plan'];?>');
sale.setData1('<?php echo $orderID;?>');

PostAffTracker.register();
</script>
<?php
}
?>

Keep in mind you have to upload files from the API ZIP file to the directory where your Thank you page is. As you can see, the first line of the code includes /lib directory from API ZIP file.

The second line defines your API key, so please change it!

Do not forget to integrate your site with the click tracking code.