Custom payment gateway for AJAX PayPal Cart

You can add your own payment gateway by the setting below.

        // Create a basic cart
        var cart = $('#cart').DCAJAXPaypalCart({
            width:600,
            height:400,
            paymentOptions:{
                server:"http://YOU_PAYMENT_GATEWAY_URL.php"
            }
        });

It will post a set of item and shipping by “POST” method to the gateway.

The var name is same as the item and shipping variables in paypal.

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables

changing the theme color for AJAX PayPal Cart jQuery Plugin

1. Change theme color by parameter. Add the ‘themeColor’ and ‘themeDarkColor’ when initialize the cart.

    $(function(){
        // Create a basic cart
        var cart = $('#cart').DCAJAXPaypalCart({
            width:600,
            height:400,
            themeColor:'#FF0000',
            themeDarkColor:'#000000',
            paypalOptions:{
                business:'YOU_PAYPAL_EMAIL@email.com'
            }
        });
    });

2. You can also changing the color by editing the dc.cart.css included in the lib folder.

Quick Start AJAX PayPal Cart jQuery Plugin

1. Unzip the product.

2. Copy the “lib” folder into your project directory.

3. Include the library by adding the following headers between <head> tag.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> 

<!-- CSS for this product-->    
<link rel="stylesheet" type="text/css" href="lib/dc.core.1.0.0.min.css" />        
<link rel="stylesheet" type="text/css" href="lib/dc.cart.css" />        

<!-- Javascript for this product-->    
<script src="lib/dc.core.1.0.0.min.js" type="text/javascript"></script>      
<script src="lib/dc.cart.1.0.0.min.js" type="text/javascript"></script>          
<script src="lib/dc.cart.lang.js" type="text/javascript"></script>

4. Insert a <div id=”cart”></div> tag in your html where you want to put the cart widget.

5. Insert below script in between <head> tag.


$(function(){

 // Create a basic cart

var cart = $('#cart').DCAJAXPaypalCart({
            width:600,
            height:400,
            paypalOptions:{
                business:'YOU_PAYPAL_EMAIL@email.com'
            }
        });

 });

6. Now, you can test the cart by open the html in your browser.
7. To add a buy button. Insert a link in your html.

<a id=”item_1″>Buy this product</a>

8. Insert the follow script below the create cart script.

   $(function(){
		……

        // Create a buy button from a link with id "buy_button_1"
        cart.addBuyButton("#buy_button_1",{
            id:'item_1',                        // Specify the unique id for this item
            name:'Item 1',                  	// Item name appear on the cart
            thumbnail:'product_thumbnail.jpg',  // Thumbnail path of the item (Optional)
            price:'10'                          // Cost of the item
            shipping:5         				// Shipping cost for the item (Optional)
        });
	});

9. You can test it in a browser. Click the link will add a product to cart.