Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The solution is to place a script on your site that talks server-to-server to the ultracart server. By doing this, and directing all remote calls to your relay script, there are no security restrictions. This solution works very well.

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.

Tip

Make sure your web server has an SSL certificate. Asking customers to enter their credit card on a non-SSL site would dramatically lower conversion and pose a security risk.

If you're going to create a custom checkout on your own web server then you need to follow of important steps.

Version 1.0

...

...

Code Block
languagexml
themeDJango
linenumberstrue
<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>

...

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://secure.ultracart.com/merchant/integrationcenter/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
    languagexml
    themeDJango
    linenumberstrue
    <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>
    

Version 1.2

  • 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.ultracart.com/merchant/integrationcenter/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
    languagexml
    themeDJango
    linenumberstrue
    <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>
    

Version 2.0

...

Include Page
ucdoc:Setting up the API on your page
ucdoc:Setting up the API on your page