Jump to content

Shipping Included in Commission Calc on PayPal Cart Purchase


Recommended Posts

Is there a way to exclude the shipping [and sales tax] amounts from the Commission calculation when using the PayPal shopping cart? On our site we are using the Add To Cart PayPal button. Clicking this button takes one to the PayPal shopping cart, where a Checkout With PayPal button is offered. Clicking this button leads to a sale and to a commission calculation. But, the final total amount is used in the calculation, rather than the subtotal, before shipping and tax. Is there a way to fix this?

If I'm embarrassed, it's because I stepped in my humanness.

Link to post
Share on other sites
  • 2 weeks later...

With the help of the excellent JROX support team I was able to resolve this issue. This was happening because, in the JAM integration code [which I completely forgot about], I was sending the total amount [purchase total + tax + shipping], rather than just the purchase total [or subtotal].


This is the proper way to do it:

            $amount          = $keyarray['payment_gross'];
            $tax             = $keyarray['tax'];
            $shipping        = $keyarray['mc_shipping'] + $keyarray['mc_handling'];
            $subtotal        = $amount - $tax - $shipping;

            // ============================================================================
            // ====================    Affiliate Notification     =========================
            // ================   JROX.com JAM Affiliate Software   =======================
            // ============================================================================
    
            $curl = curl_init();

            curl_setopt_array($curl, array(      
                 CURLOPT_RETURNTRANSFER => 1,      
                 CURLOPT_URL => 'http://www.domain.com/affiliates/sale/amount/' . 
                     $subtotal . '/trans_id/' .   // This is where I made my mistake!  Previously I placed $amount here.
                     $tx_token . '/tracking_code/' .
                      $_COOKIE['jamcom'],
                 CURLOPT_USERAGENT => 'Affiliate Software Tracking Request'  ,
            )); 

            $resp = curl_exec($curl);  
            curl_close($curl);

 

I was sending the 'payment_gross'!

If I'm embarrassed, it's because I stepped in my humanness.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...