Credit Card Integration
Integrating AllAffiliatePro with your ordering system can be anything from very simple to a bit technical. Below is a list of card processors with information on how to integrate with each of them. At the end there is a general guide to integrating with any Card Processor. If you Card Processor is not listed then contact us using the form at the bottom of this page, and we will find the integration method for you and add your processor to the list.
If you are integration with a shopping cart click for shopping cart integration
- PayPal
-
Method 1 Shopping cart/Sales links
This method involves changing your PayPal return page to a cgi script called thankyou.cgi. Scroll down to the section called Thankyou.cgi for more information.
Method 2 Subscriptions/Shopping cart/Sales links
This method is for automated recurring commissions support, it can also be used for shopping cart and sales link. Add the following code to each Shopping cart/Subscriptions/Sales links link HTML code:-
<input type="hidden" name="custom" value="<!--#include virtual="/cgi-bin/affiliate/paypalinclude.cgi" -->">Make sure this code is in one line and not split among several and that it is within the <Form> tag along with the other hidden fields. Also be sure the virtual includes are pointing to the correct files on your server. This uses Server Side Includes (SSI) so depending on whether your server checks for SSI automatically, you may need to rename the pages to .shtml or add the following code to your .htaccess file:-
AddType text/x-server-parsed-html .htm .html .shtm .shtmlIf you are running apache 1.x OR add the line:-
AddOutputFilter INCLUDES .htm .htmlIf you are running apache 2.x.
&custom=<!--#include virtual="/cgi-bin/affiliate/paypalinclude.cgi" -->
If you are using the old style of having the code along a hyperlink then add the following code to the end of the link.Then from within the PayPal member area setup your Instant Payment Notification (IPN) to use, if you are already using IPN then you'll need to look at paypal.cgi and merge the files together:-
http://www.yourserver.com/cgi-bin/affiliate/paypal.cgiInserting the correct path to the AllAffiliatePro folder on your server.
- Google Checkout
-
Method 1 Buy Now buttons
This method involves adding additional input fields to the buttons form. Locate the form for the button you wish to track, it should have an id of "BB_BuyButtonForm".
Add the following before the closing form tag (replacing the example url with your own):-
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-1.url" value="http://www.example.com/cgi-bin/clickme2.cgi"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-1.parameters.url-parameter-1.name" value="id"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-1.parameters.url-parameter-1.type" value="order-id"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-1.parameters.url-parameter-2.name" value="amount"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-1.parameters.url-parameter-2.type" value="order-subtotal"/> - Roman Cart
-
step 1.
Login into romancart and click "Enhance Your Website" then "Configure Sales Tracking Scripts" then "Configure Sales Tracking Scripts"
step 2.
Add the following code into the textarea (replacing yourserver.com with your websites address)
<img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id=<orderid>&amount=<totalminusshipping>" height="1" width="1" border="0">step 3.
Click "Save Changes" and you're finished
- Magento
-
Step 1.
Open up the file app/design/frontent/default/default/template/checkout/success.phtml
Step 2.
Locate the following line :-
<?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?>Step 3.
Just before the above line enter the following block of code (replacing yourserver.com with your websites address)
<!-- START AAP INTEGRATION CODE --> <?php $order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId()); $amount = number_format($order->subtotal,2); ?> <img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id=<?php echo $this->getOrderId()?>&amount=<?php echo $amount; ?>" height="1" width="1" border="0"/> <!-- END AAP INTEGRATION CODE -->Step 4.
Save the File and you're done.
- 2CheckOut.com
-
Method 1
Login to your 2CheckOut.com account there is a section called 3rd party affiliate programs, enter the code:-
http://www.yourserver.com/cgi-bin/affiliate/clickme2.cgi?id=$a_order&amount=$a_totalWe recommend you use and configure click & click2.cgi and call securely. So the code would be:-
https://www.yourserver.com/cgi-bin/affilate/click2.cgi?id=$a_order&amount=$a_totalMethod 2
Set the post back URL to thankyou.cgi. See section thankyou.cgi below.
- WorldPay
-
Method 1
Worldpay allows you to configure your own version of the order complete page. This page is called resultsY.html, create this page (if you haven't already, there is a guide on the worldpay site) and add the following html <img> tag to the page:-
<img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id=<WPDISPLAY ITEM=transId>&amount=<WPDISPLAY ITEM=authAmount>" height=1 width=1 border=0>We recommend you use and configure click & click2.cgi and call securely. So the code would be:-
<img src="https://www.yourserver.com/cgi-bin/affilate/click2.cgi?id=<WPDISPLAY ITEM=transId>&amount=<WPDISPLAY ITEM=authAmount>" height=1 width=1 border=0>Method 2
Use worldpay.cgi. In the Customer Management System, section 'Configuration Options', input the CallBack URL
http://www.yourserver.com/cgi-bin/affiliate/worldpay.cgi
and select 'callback enabled'.Edit your WorldPay links to contain the code:-
<input type=hidden name=MC_affiliate value="<!--#include virtual="/cgi-bin/affiliate/paypalinclude.cgi" -->"> - IBill
-
IBill allows you to configure your own version of the order complete page for each subscription you have available. Look through their documentation to see how to do this. Make your own version of the page and add to it the following code:-
<img src="http://www.yourserver.com/cgi-bin/affiliate/clickme2.cgi?id=%%tran?&amount=MEMBERSHIPAMOUNT" height=1 width=1 border=0>We recommend you use and configure click & click2.cgi and call securely. So the code would be:-
<img src="https://www.yourserver.com/cgi-bin/affiliate/click2.cgi?id=%%tran?&amount=MEMBERSHIPAMOUNT" height=1 width=1 border=0> - CCBill
-
CCbill allow you to configure the affiliate tracking script from their purchase button. Add the following code for a hidden field within the CCbill <form> tag along with the other hidden fields:-
<INPUT TYPE="hidden" NAME="alternate_script" VALUE="http://www.yourserver.com/cgi-bin/affiliate/clickme2.cgi?id=---id---&amount=---amount">
- CCNow
CCNow will only let the affiliate order tracking script be called along a secure server. So follow the guide to setup click and click2.cgi then from the CCNow admin area add the following code:-
www.yourserver.com/cgi-bin/affiliate/click2.cgi?id=order-id-here&amount=order-amount-here- ClickBank
This method involves logging in to your ClickBank account and changing your return pages for each sales link number to a cgi script called thankyou.cgi. In the case of ClickBank thankyou.cgi is also able to grab the order ID number. Scroll down to the section called Thankyou.cgi for more information.
- Ixxocart
-
Step 1.
locate and open the file "components/com_ixxocart/content/skins/flat/completed.html"
Step 2.
At the bottom of the page add the following code:-
<img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id={$order_id}&amount={$order_amount}" height=1 width=1 border=0>Substituting the URL to AllAffiliatePro on your server.
Step 3.
Save and upload the file
- Thankyou.cgi
-
Thankyou.cgi is a script designed to allow our affiliate software to integrate with CardProcessors that do not allow you to display any of the order information (i.e. order id and amount) on your 'Order Complete' or 'Thank you for your order' pages. If you have already made your own order complete page then Thankyou.cgi will utilize it, if you haven't then please create one now.
Step 1.
Begin by editing your current thankyou page and adding to it the following code:-
<img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>Substituting the URL to AllAffiliatePro on your server.
If you do not currently have a thank you for your order page, then the template thankyou.html is provided with the beforementioned code already included.
Step 2.
Now edit the file thankyou.cgi using a text editor such as notepad. Make sure the top of the file points to perl on your server. Change the variable $valid domains to contain your domain name and your card processors domain name(s), separted by ¦. Change the variable $thankyoupage so that is contains the RELATIVE server path to your order complete page. I.e If your thankyou page was in your root folder then this would look something like '../../thankyou.html'.
Step 3.
Now you must set thankyou.cgi as you order complete page. You need to do this for each sales link, as you need to tell thankyou.cgi what the product price is. The code is:-
http://www.yourserver.com/cgi-bin/affiliate/thankyou.cgi?amount=XXWhere XX is the price of the product, such as '99' for $99.
If you are using thankyou.cgi with PayPal or Plug n Pay you do not need to enter the amount. Such as:-
http://www.yourserver.com/cgi-bin/affiliate/thankyou.cgiThankyou.cgi will only substitute the order amount if the referring URL that calls it from is one of the valid domains you set earlier (this can be disabled). If you track your own order ID's then you can pass the order ID also. If thankyou.cgi cannot find an order ID it uses the customers IP number as the ID. The code for this is:-
http://www.yourserver.com/cgi-bin/affiliate/thankyou.cgi?amount=XX&id=YYSome card processors do pass the order ID along the QUERY STRING for you, if so then contact us and we will modify thankyou.cgi to pick this up. Currently it picks up the order id from ClickBank and PayPal only.
General Guide
The general rule for integrating is to modify your order complete page. Most Card Processors allow you to do this, and most will allow you to display certain information from the order. The information we are interested in is the order ID and the order amount. You need to edit your order complete page so that it contains:-
<img src="http://www.yourserver.com/cgi-bin/affilate/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>You need to swap ::id:: and ::amount:: for the symbols your card processor uses, these can be anything such as $a_order or <WPDISPLAY ITEM=transId>. Usually you will need to call from a secure server to prevent a 'Page contains non secure items' error. Do this using click and click2.cgi, and the code:-
<img src="https://www.yourserver.com/cgi-bin/affilate/click2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>If you integrate your card processor using this method and it is not listed here then please contact us so that we may add it to the list.
If your card processor does not allow you to insert the order information in the page then please read the section on thankyou.cgi.