Integration of Ubercart by integration of Thank you page and also a solution for Ubercart using PayPal.

1.

Locate the settings

Go to Administer> Store administration> Configuration> Checkout settings> Edit> Checkout messages

2.

Integratio code for thank you page

Add this code to Checkout completion message header:

<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('[order-total]');
sale.setOrderID('[order-id]');
sale.setProductID('[model]');
PostAffTracker.register();
</script>

Change Input format in 'Checkout completion message header' to Full HTML.

Do not forget to save your changes.

3.

Using PayPal in Ubercart

If you are using PayPal as a payment gateway in your Ubercart, it is better to integrate it directly.

Edit file sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.module - find the function uc_paypal_wps_form() and put this code just after the line with code:

'notify_url' =>

'custom' => $_COOKIE['PAPVisitorId'],

Now, edit the file sites/all/modules/ubercart/payment/uc_paypal/uc_paypal.pages.inc and find the function uc_paypal_ipn() - put the following code below the function line:

/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* /Post Affiliate Pro integration snippet */

Do not forget to save your changes.