npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

zotlo-checkout

v1.8.1

Published

[![Publish Package to npm](https://github.com/Zotlo/zotlo-checkout/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Zotlo/zotlo-checkout/actions/workflows/main.yml)

Readme

Zotlo Checkout

Publish Package to npm

Zotlo Checkout SDK allows you to embed a secure payment form directly into your website, providing your customers with a seamless checkout experience without leaving your site.

Quick Start

Installation

Add the zotlo-checkout package to your project:

npm

npm install --save-dev zotlo-checkout

yarn

yarn add -D zotlo-checkout

Initialize Checkout

import 'zotlo-checkout/dist/zotlo-checkout.css';
import ZotloCheckout from 'zotlo-checkout';

// Initialize checkout
const checkout = await ZotloCheckout({
  token: 'YOUR_CHECKOUT_TOKEN',
  packageId: 'YOUR_PACKAGE_ID',
  returnUrl: 'YOUR_RETURN_URL',
  language: 'en',
  customParameters: { // Optional
    myCustomParam: 'OK!'
  },
  events: {
    onSuccess(result) {
      // Handle success here
    },
    onFail(error) {
      // Handle fails here
    }
  }
});

// Render form whenever you want
checkout.mount('zotlo-checkout')

Note: The string 'zotlo-checkout' passed to mount is the id of the DOM element where the form will be embedded, for example:

<div id="zotlo-checkout"></div>

Using via CDN

You can also include Zotlo Checkout SDK directly in the browser using CDN links:

unpkg

<link rel="stylesheet" href="https://unpkg.com/zotlo-checkout/dist/zotlo-checkout.css" />
<script src="https://unpkg.com/zotlo-checkout/dist/zotlo-checkout.min.js"></script>

jsdelivr

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zotlo-checkout/dist/zotlo-checkout.css" />
<script src="https://cdn.jsdelivr.net/npm/zotlo-checkout/dist/zotlo-checkout.min.js"></script>

Usage example

<div id="zotlo-checkout"></div>

<script>
  ZotloCheckout({
    token: 'YOUR_CHECKOUT_TOKEN',
    packageId: 'YOUR_PACKAGE_ID',
    returnUrl: 'YOUR_RETURN_URL',
    language: 'en',
    customParameters: { // Optional
      myCustomParam: 'OK!'
    },
    events: {
      onSuccess(result) {
        // Handle success here
      },
      onFail(error) {
        // Handle fails here
      }
    }
  }).then(function (checkout) {
    checkout.mount('zotlo-checkout');
  })
</script>

Parameters

These parameters specify the parameters and descriptions used in the Zotlo Checkout SDK.

| Name | Required | Description | |-------------------------|----------|------------------------------------------------------------------------------------------------------------------------------| | token | yes | The checkout token obtained from the Zotlo Console. You can find this in your project's Developer Tools > Checkout SDK page. | | packageId | yes | The ID of the package you want to use. | | returnUrl | yes | The URL to redirect the user after payment completion. | | subscriberId | no | (Optional) Default subscriber ID for registration; can be an email, phone number, or UUID v4. | | style | no | Custom styling on config | | customParameters | no | Send custom parameters to webhooks | | events | no | Event listeners that can be used during the checkout process. | | events.onLoad | no | Triggers after form loaded. | | events.onSubmit | no | Triggered after the form is submitted. | | events.onSuccess | no | Triggered after a successful payment. | | events.onFail | no | Triggered when a payment fails. | | events.onInvalidForm | no | Triggers when form has an invalid field. |

Note: For more details, please visit types.ts file.

Events

Please view IZotloCheckoutEvents for full details on src/lib/types.ts file.

onLoad

Triggers after form loaded.

onLoad?: (params: IFormLoad) => void;

Note: You can see params details on type IFormLoad

{
  ...
  events: {
    onLoad(params) {
      // Update page bg color by form bg color
      document.body.style.backgroundColor = params.backgroundColor;
    }
  }
}

onSubmit

Triggers after the form is submitted.

onSubmit?: () => void;
{
  ...
  events: {
    onSubmit() {
      console.log('Form submitted')
    }
  }
}

onSuccess

Triggers after a successful payment.

onSuccess?: (result: PaymentDetail) => void;

Note: You can see result details on type PaymentDetail

{
  ...
  events: {
    onSuccess(result) {
      const emailEl = document.getElementById('email')
      emailEl.innerText = result.client.subscriberId;
      alert('Success done!');
    }
  }
}

onFail

Triggers when a payment fails.

onFail?: (error: FailEventData) => void;

Note: You can see error details on type FailEventData

{
  ...
  events: {
    onFail(error) {
      alert(error.message)
    }
  }
}

onInvalidForm

Triggers when form has an invalid field.

onInvalidForm?: (error: IFormInvalid) => void;

Note: You can see error details on type IFormInvalid

{
  ...
  events: {
    onInvalidForm(error) {
      alert('Invalid field:', error.name)
    }
  }
}

Methods

User methods available after Checkout is started:

mount

Renders the Checkout form to the specified DOM element.

checkout.mount(containerId: string);

refresh

Refreshes the form.

checkout.refresh(): Promise<void>;

unmount

Removes the form and deletes it from the DOM.

checkout.unmount();

Styling

You can customize your form on config with style parameter. If you do not define any parameters, the settings made in the Zotlo Console will apply by default.

Note: For more details, please check IZotloCheckoutStyle on types.ts file.

{
  ...
  style: {
    design: {
      theme: 'mobileapp',
      borderWidth: 2,
      backgroundColor: '#CCCCCC',
      ...
    },
    success: {
      show: true,
      waitTime: 20
      ...
    }
  }
}