0.4.11 • Published 5 months ago

@kasssh-js/popup v0.4.11

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Kasssh Popup

The Kasssh Popup JS library offers an easier way to display popups to customers, providing details on how to pay using Kasssh. The library ensures the correct details are provided and that the customer agrees to the Terms and Conditions (TNC) and Privacy Policy.

Setup

CDN

To include the Kasssh CSS and JavaScript using CDN, add the following code to your checkout page:

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/gh/pmacarikasssh/kasssh-popup/dist/popup.css"
/>
<script src="https://cdn.jsdelivr.net/gh/pmacarikasssh/kasssh-popup/dist/popup.js"></script>

For a specific version:

<script src="https://cdn.jsdelivr.net/gh/pmacarikasssh/kasssh-popup@0.4.0/dist/popup.js"></script>

NPM

Install the Kasssh popup library using NPM:

npm i @kasssh-js/popup

Then, import it in your JS file:

import Kasssh from "@kasssh-js/popup/popup.js";

Checkout Process

During your checkout event, add the following:

// Create an object for Kasssh
var kasssh = new window.Kasssh(300.0);

// Initialize with customer data
kasssh.init({ email: "customer@example.com", phone: "0123456789" });

// Set up a callback for Kasssh on the submit event
kasssh.onSubmit((data) => {
  // Display a spinner
  kasssh.toggleSpinner(true);

  // Perform HTTP calls to your server to create an order with Kasssh as the payment method

  // Hide the spinner and the popup
  kasssh.toggleSpinner(false);
  kasssh.toggle(false);

  // TODO: Redirect the customer to the order confirmation page
});

// add this to event when user clicks checkout with kasssh
kasssh.toggle(true);
0.4.11

5 months ago

0.4.10

5 months ago

0.4.9

7 months ago

0.4.8

7 months ago

0.4.7

8 months ago

0.4.6

9 months ago

0.4.5

9 months ago

0.4.3

9 months ago

0.4.2

9 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.2.6

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago