Integrating Curebit on Your Site

FastSpring Store Integration

Curebit is easily integrated into your FastSpring store.

  1. Login to your FastSpring administration console with your administrator account
  2. Under "Tracking", click on "External Tracking"
  3. Under "Actions", click "Add Custom Tracking Method"
  4. Enter 'Curebit' for Name, and under URL Type, select "Free-form XHTML Fragment"
  5. In the "Free-form XHTML Fragment" text area, put this code:
    Sample code: To get your personal integration code, YOUR-CUREBIT-SITE-ID needs to be replaced with your curebit store ID. To get your personalized Curebit Store ID, access integration instructions from inside your Curebit account.
    <!-- Begin Curebit integration code -->
    
    <script type="text/javascript">
      <![CDATA[
        var curebitSiteId = 'YOUR-CUREBIT-SITE-ID';
        var curebitJsUrl = 'https://www.curebit.com/public/' + curebitSiteId + '/purchases/create_fastspring.js';
        var curebitVersion = '0.2';
        var curebitOrderNumber = "#{order.reference}";
    
    
        var curebitI = 0;
        var curebitItems = '';
      ]]>
      <repeat value="#{order.allItems}" var="orderItem">
        <![CDATA[
            curebitItems += 'purchase[items_attributes][' + curebitI + '][product_id]=' + '#{orderItem.productName}' + '&';
            curebitItems += 'purchase[items_attributes][' + curebitI + '][price]=' + '#{orderItem.priceTotal.value}' + '&';
            curebitItems += 'purchase[items_attributes][' + curebitI + '][quantity]=' + '#{orderItem.quantity}' + '&';
            curebitI++;
        ]]>
      </repeat>
      <![CDATA[
    
        var curebitJsSrc = curebitJsUrl +
                    '?v=' + encodeURIComponent(curebitVersion) +
                    '&purchase[order_number]=' + curebitOrderNumber +
                    '&purchase[subtotal]=' + '#{order.subTotal.value}' +
                    '&purchase[order_date]=' + '#{order.created}' +
                    '&purchase[email]=' + '#{order.customer.email}' +
                    '&' + curebitItems;
    
        var curebitHeadID = document.getElementsByTagName("head")[0];
        var curebitNewScript = document.createElement('script');
        curebitNewScript.type = 'text/javascript';
        curebitNewScript.src = curebitJsSrc;
        curebitHeadID.appendChild(curebitNewScript);
    
      ]]>
    </script>
    <!-- End Curebit integration code -->
    
  6. Click "Next"
  7. Under "Actions", click "Save"

Verifying your integration

After installing Curebit, you should verify that the integration is working. All you have to do is check out from your store using the special email integration@curebit.com.

  1. Do a test checkout on your online store and use integration@curebit.com as the customer email address.
  2. After checking out, you should see an integration success page that looks like this:
    Integration_success
    (Don't worry. This image is only shown when you use the special integration@curebit.com email address. No one else is seeing that image)

If you can't complete checkout with integration@curebit.com, we'll also verify your integration whenever someone completes checkout on your store (but they won't see anything).

Note for merchants who accept PayPal as a payment method
You must turn on auto-redirection to your thank you page for Curebit to work. Learn How

Optional features

Curebit offers many optional features you can include with your documentation, to find out more browse the Optional Features section of the documentation.