Integration with SWREG is very simple - you only need to place saletracking script into the template of order summary page.

1.

Plugin activation

The very first step is to activate your SWREG plugin. When it is active, login to your SWREG admin panel and click to Setup> Customizable templates
If your templates are disabled, you should enable them by clicking on the top link enable templates and create Summary template.

2.

Edit Summary template - step 1

Open Summary template and edit it's code. Ifyou don't have this template customized yet, you should download thesystem template and make the changes there.
Put the following code right after <body> tag of the template:

<!-- Post Affiliate Pro integration snippet -->
<script type="text/javascript">
document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "URL_TO_PostAffiliatePro/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
var i = 1;
</script>
<!-- /Post Affiliate Pro integration snippet -->

Note the integration will only work in case your Post Affiliate Pro is at SSL secured domain.

3.

Edit Summary template - step 2

Now find this line:

[FOREACH="BASKET"]  

Add the following code right after it:

<!-- Post Affiliate Pro integration snippet -->
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('###BRTOTAL2###');
sale.setOrderID('###ORDERNO###' '-' i);
sale.setProductID('###BRPRODCODE###');
sale.setStatus('P');
PostAffTracker.register();
i = i 1;
</script>
<!-- /Post Affiliate Pro integration snippet -->

Save your work.

This integration code will create per product commission, with original default currency mount, and order ID with postfix '-N' where N is a number of product iteration. All the commissions _will be created as pendin_g. The plugin, which should already be active, will only approve paid transactions.

4.

Add notification

To make the plugin working, you have to setup a notification for new sales. As all transactions are saved into your Post Affiliate Pro as pending, the notification will tell the plugin which transaction to approve. The plugin will only approve paid transactions because SWREG only sends notifications for paid transactions - it may take few days, e.g. in case of wire transfer.

To setup a notification, navigate to your SWREG admin panel, Setup> 
Event Notifications and click New Notification button. Set the notification format to JSON and set delivery to this URL:

http://URL_TO_PostAffiliatePro/plugins/Swreg/swreg.php?type=new_order

As the plugin supports also refund notification, you can set one for refunds. Follow the same setup, there is just one difference. The URL parameter type has to be set to 'refunded' instead of 'new_order'.

When you are done, save your notification and do not forget to ENABLE IT !