OK, the bit that's relevant is:
You don't need the HTML headers or the closing tags - just the bit I show above.
var merchantID = xxxx ;
var orderValue = 'ORDER_VALUE';
var orderRef = 'ORDER_REF';
var payoutCodes = '';
var offlineCode = '';
AFProcessSaleV2(merchantID, orderValue, orderRef,payoutCodes,offlineCode);
It's probably just a case of pasting that code right at the bottom of the tpl_checkout_success_default.php file .
But I don't know how ZC is going to "parse" the ORDER_VALUE and ORDER_REF data.... ??? It may need ZC's specific references here...
Kuroi--- you're the guru in this dept!