API class
Javascript
P S P Integration
Widgets | Plugins
Use Cases | Tutorials
Javascript Checkout Popup.js

In order to initiate the kasssh.com checkout, we have a generic (vanilla) javascript `popup` which you can use. This is at api.kasssh.com/popup/v1/popup.js and you can include this in your shop code as

<script src="https://api.kasssh.com/popup/v1/popup.js"></script>

Alternatively please see our NPM module


This Javascript code can be readily inspected as open-source and it uses some styling/CSS api.kasssh.com/popup/v1/popup.css as well as some official kasssh logos and images which are held at api.kasssh.com/popup/images. Future releases will give you more control over this styling.

Checkout button to call the `popup`

As for a checkout button itself, these can be found at api.kasssh.com/popup/buttons and below is short table of options you may wish to deploy on your checkout page. You may, of course, use your own button if your shop has a certain style although we would recommend the official and more identifable kasssh logos.

a lozenge style (rounded-corners) - large 500 by 85 pixels. Click on the icon to open in a new window/tab.
a lozenge style (rounded-corners) - small/medium 250 by 43 pixels. Click on the icon to open in a new window/tab
... more to come

These buttons are just transparent PNG blocks and you can easily/equally control their size with your own CSS or styling.

Calling the `popup`

kassshPopup( _data, onSuccess, onFail, sendemail = true | false );

   onSuccess a callback (your JS function) after the kasssh popup returns true, i.e. success. This f() will receive a _reply argument and would take the form of function onSuccess(_reply) {...}
   onFail a callback (your JS function) if the kasssh popup fails, note this is for a FAILURE and not a cancellation. A user cancellation will simply close the `popup`, i.e. rejecting this method of payment at checkout. This f() will receive a _reply argument and would take the form of function onFail(_reply) {...}
   _data a JS object with `starting point` data for the cart to be paid for via kasssh.com. Most of this data is optional, but you should ideally populate as much as possible to save the user time, i.e. not having-to/ask the user to input data which you have already collected/know, e.g. names and address.
   sendemail true or false ( or empty | null). Optional parameter to send an eMail to the customer if/when successfully issued a token. If set to true then this will save you the time | trouble of using the /customer/email API as this is a standard flow for a customer kasssh-notification when they checkout.