Skip to content

Add inai to your checkout

  • Add the following snippet in your page's head section
<script src="https://js.inai.io/v1/inai-widget.min.js"></script>
  • Place the following code on your checkout page where you want to display the widget
<div id="inai-widget"></div>
  • Initialize inai's checkout widget using the following lines of code
const inai = window.getInai();
inai.initialize({
    "order": {
        "amount": amount,
        "currency": currency
    },
    "token": inai_token,
    "container": "inai-widget"
}).then(function() {
    // Handle Payment success
}).catch(function(error) {
    // Handle Payment Failure
});

Replace the following values in the above code with the appropriate values:

  1. amount - The amount you want to charge the user e.g. if you want to charge a user 10 dollars, the value will be 10.00.
  2. currency - The three-character currency code that identifies the currency.
  3. token - Place your inai token here. You can find your token on the inai dashboard.

Apple Pay

At this time we support Apple Pay only through Stripe. To get Apple Pay support, use the following instructions:

  1. Host the domain association file at /.well-known/apple-developer-merchantid-domain-association on your site. For instance, if your site is located at https://example.com, make that file available at https://example.com/.well-known/apple-developer-merchantid-domain-association.
  2. Enable Apple Pay on inai's dashboard. We'll handle the Stripe registration process. The registration takes a minute to complete after which you'll be able to accept payments through Apple Pay.