Skip to main content

Integrate JS SDK

In order to facilitate a seamless crypto acceptance flow for your end user, we request our merchants to integrate our SDK. The SDK can be added as an inline script in the HTML page.

INLINE SCRIPT

To add the SDK in a HTML page include this line in the head tag of the file.

<script src="https://checkout.zamplabs.com/v1/index.js"></script>

To initialise payment SDK for stage env, the base URL is : https://checkout.stg.zamplabs.com/v1/index.js

After Including the zamp sdk, the zamp checkout object can be initialised like

  const zamp = new ZampCheckout({ session: PAYMENT_SESSION_ID, token: TOKEN});
zamp.initialize();

The PAYMENT_SESSION_ID and TOKEN can be fetched from the response after initialising the payment session. The SDK will automatically redirect to the success and failure urls mentioned while initialising the payment session.

NPM MODULE

Install zamp SDK using the npm package manager:

npm install @zamp/acceptance --save

Import ZampCheckout to payment page with the following snippet

import ZampCheckout from '@zamp/acceptance';

The user can be redirected to the checkout page by initialising the ZampCheckout button. This can be implemented on the payment button.

  const payload = { PAYMENT_SESSION_ID, TOKEN }
const checkout = new ZampCheckout(payload) ;
checkout.initialize() ;

The PAYMENT_SESSION_ID and TOKEN can be fetched from the response after initialising the payment session. The SDK will automatically redirect to the success and failure urls mentioned while initialising the payment session.

NPM Package URL: https://www.npmjs.com/package/@zamp/acceptance