Recent Changes
Warning |
---|
This API is in maintenance mode. It is no longer actively developed or supported. Please use the REST API instead. |
Requirements
- jQuery 1.4+
Installing
Tip |
---|
As a general rule, make sure that you're referencing all scripts (jQuery, MooTools, checkoutapi.js, etc.) using HTTPS URLS all from the same domain in your HTML file. |
...
- View the online Demo in the Developer Tools section of UltraCart.
- Download the source for source for the demo from github: https://github.com/UltraCart/legacy_javascript.
- Review and edit cart_1.0.js. Pay attention to the comments.
...
doNotTestRemoteConnection:false
For example:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var merchantCartConfig = { merchantId: "DEMO", secureHostName:'www.mystore.com', remoteApiUrl:"https://www.mystore.com/proxy.php", debugMode:true, verboseAjax:true, doNotTestRemoteConnection:true } |
...
- Download the required files, mootools and checkout API javascript, to your server.
- Download the PHP proxy script from the integration center and place it on your web server. The PHP script requires that your server have the Curl module with SSL enabled. This is a very common module to have available in most LAMP hosting environments. An ASP version of the relay script will be available in the future for Microsoft hosting environments. The direct download link for the PHP proxy script is: https://securegithub.ultracart.com/merchant/integrationcentercom/UltraCart/legacy_javascript/blob/master/example/proxy.php
Call the initializeCheckoutAPI method with your merchant ID, your custom SSL host name if you have one or null for the second parameter, and then the HTTPS URL to the relay script that you have installed on your server.
Let's pretend that I have a site called avkits and the domain is www.avkits.com. I've already installed an SSL certificate with my hosting company so that I can access the site via https://www.avkits.com or http://www.avkits.com. I've also downloaded the three files mentioned below to the root directory of my hosting account. Below is an example of my initialization code for my HTML page:Code Block theme DJango language xml theme DJango linenumbers true <script type="text/javascript" src="/mootools-1.2-core-yc.js"></script> <script type="text/javascript" src="/checkoutapi.js"></script> <script type="text/javascript"> var relayUrl = "https://www.avkits.com/proxy.php"; initializeCheckoutAPI('AVKIT', null, relayUrl); </script>
Notice that the URL to proxy script is the complete HTTPS url.
Version 1.1
- Download the required files, jQuery and checkout API javascript, to your server.
- Download the PHP proxy script from the integration center and place it on your web server. The PHP script requires that your server have the Curl module with SSL enabled. This is a very common module to have available in most LAMP hosting environments. The direct download link for the PHP proxy script is: https://securegithub.ultracart.com/merchant/integrationcenter/UltraCart/legacy_javascript/blob/master/example/proxy.php
Call the initializeCheckoutAPI method with your merchant ID, your custom SSL host name if you have one or null for the second parameter, and then the HTTPS URL to the relay script that you have installed on your server.
Code Block theme DJango language xml themeDJango linenumbers true <script type='text/javascript' src='js/jquery-1.4.2.min.js'></script> <script type='text/javascript' src='js/jquery.json-2.2.min.js'></script> <script type='text/javascript' src='js/checkoutapi-1.1.js'></script> <script type='text/javascript'> window.onload = function(){ var relayUrl = "https://www.avkits.com/proxy.php"; initializeCheckoutAPI("DEMO", 'secure.ultracart.com', relayUrl); getCartInstance(); }; </script>
...
- Download the required files, jQuery and checkout API javascript, to your server.
- Download the PHP proxy script from the integration center and place it on your web server. The PHP script requires that your server have the Curl module with SSL enabled. This is a very common module to have available in most LAMP hosting environments. The direct download link for the PHP proxy script is: https://secure.ultracartgithub.com/merchant/integrationcenter/UltraCart/legacy_javascript/blob/master/example/proxy.php
Call the initializeCheckoutAPI method with your merchant ID, your custom SSL host name if you have one or null for the second parameter, and then the HTTPS URL to the relay script that you have installed on your server.
Code Block theme DJango language xml theme DJango linenumbers true <script type='text/javascript' src='js/jquery-1.4.2.min.js'></script> <script type='text/javascript' src='js/jquery.json-2.2.min.js'></script> <script type='text/javascript' src='js/checkoutapi-1.1.js'></script> <script type='text/javascript'> window.onload = function(){ var relayUrl = "https://www.avkits.com/proxy.php"; initializeCheckoutAPI({merchantId: "DEMO", secureHostName:'secure.ultracart.com', callbackUrl:relayUrl, debugMode:true, verboseAjax:true}); getCartInstance(); }; </script>