If you have Stripe Checkout buttons embedded into your site, follow the integration instructions below. These instructions will work if you are taking one-time payments or recurring subscription payments.


If you're not using an embedded Stripe Checkout button, but rather Stripe connects with a custom order system or another third-party system, you should refer to our “Stripe Connect” integration instructions from the thank you page instructions in the drop-down menu above.


Note: Our integration will only work if you are using the full Stripe Checkout button code snippet. Our integration will not work with the Stripe “Buy” links. If you are using the buy link option, you can switch to the full code snippet option by following these instructions:


Step 1. Login to your Stripe account.


Step 2. Click on the gear symbol at the top right of your dashboard to go to Settings.


Step 3. Under the Payments section, click “Checkout and Payment Links”


Step 4. Scroll down and click the “Enable client-only integration” button.


Step 5. Enter your website domain in the “Domains” field and click save.


Step 6. You can now generate the code snippet for your products, so click the “Products” link in your top Nav.


Step 7. Select the product that you want to generate the code snippet for.


Step 8. Under the Pricing section click the three dots next to the “Create payment link” button and select “Get Checkout code snippet”


Step 9. Copy the code and add to your site where you want the button to appear. 


After you have followed the above instructions to get your code snippet if you did not currently already have code snippets for your products, follow the instructions below:


Step 1. Connect to your Stripe account. To do that, on your admin dashboard, go to Set Up Software and click complete integration.


Step 2. On the drop-down list, look for Stripe Checkout. Scroll down and click on the "Connect to Stripe" button below to connect with your Stripe account. 

Note: Our integration only works with Stripe in Live mode.


Step 3. Add the following code to the landing page of your site before the </body> tag.

<script defer type="text/javascript" src="https://www.ositracker.com/js/url-params.js"></script>

<script> document.addEventListener("DOMContentLoaded", function() { setCookie("affiliate_id", urlParams['affiliate_id'], 60); setCookie("prodgroup", urlParams['prodgroup'], 60); }); function setCookie(cname, cvalue, exdays) { const d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); let expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } </script>


Step 4. Now update your checkout button code as follows:

Add this code before stripe.redirectToCheckout({ :


let affiliate_id = getCookie("affiliate_id"); let prodgroup = getCookie("prodgroup");


Add this code after cancelUrl: 'CANCEL_URL_HERE', :


clientReferenceId: affiliate_id + '_' + prodgroup,


 

At the bottom of your code snippet, add this code after })(); :


function getCookie(cname) { let name = cname + "="; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }


Step 5. In your Stripe account, click on Developers -> Webhooks.

Step 6. Click on "Add Endpoint"

Step 7. In the endpoint URL field, add the URL below:

https://yoursubdomain.ositracker.com/Stripe/checkout

Note: Replace yoursubdomain with your actual ositracker subdomain url.

Select your current API and then for the events, select "checkout.session.completed" and then click "Add Endpoint".


Step 8. Click API Keys. Select "Create secret key" and then copy it to a notepad.

Step 9. Go back to your OSI Admin control panel and click Set up Software -> Settings and then select "Show advanced settings".

Step 10. Check the box "Include Parameters in Affiliate URL" and then click update.

Step 11. On the settings page click "Third Party Integrations"


Step 13. Select Stripe and paste in the Secret key that you previously copied from step 12 and click Submit.



Once you connect with Stripe and follow the steps above, read our detailed Stripe checkout integration instructions here on how to configure your referral program.