Skip to main content

Introduction

Welcome to the payonic-click2pay.js reference documentation. This guide provides a complete overview of how to integrate payonic-click2pay.js into your web application for secure and seamless click2pay processing.

Before integrating payonic-click2pay.js, you need:

  • An payonic account
  • An API key for server-side authentication

The first thing you need to do is to enroll a merchant. This needs to be done server side, as it requires your API key.

The response from the server will include a merchantId which is needed to initialize the payonic-click2pay.js client.

info

Please note, that the Click2Pay client needs to be fetched each time a new payment session is initialized and therefore can't be cached.

Example response: Enroll merchant
{
"merchantId": "Z7NWVCUWZ2QP"
}

Include payonic-click2pay.js

Once the payment merchant has been enrolled, include the payonic-click2pay.js script in your webpage.

This can be done by adding the following line of code inside the <head></head> tag your website.

Including payonic-click2pay.js
Including script in solution
<script type="module"
src="https://click-to-pay.stage.payonic.technology/payonic-click2pay.js">
</script>

Using library in solution
<sript>
import { CardTokensService } from "./payonic-click2pay.js";

CardTokenService.<method>
</sript>