Accept Payments with Checkout.Js
Why Use Checkout.js for Online Payments ?
Checkout.js is a tool designed to make it easy to integrate a secure and fast payment form on your website. Whether you are a developer or not, this tool will allow you to collect payments directly on your site with ease. Learn how to use and customize Checkout.js to provide a smooth payment experience for your users.
Before you start, watch this video that explains how to integrate Checkout.js: :
Methods of Integrating Checkout.js
Checkout.js offers several integration options to suit different needs. You can add a simple payment button, multiple collection buttons, or even embed the payment form directly on your site to avoid redirects.
Add a Simple Payment Button to Your Page
Start by adding a simple button on your page to trigger the collection. This button will allow the user to access a payment form where they can finalize the transaction.
Customize the Payment Form
You can customize the collection details (amount, description, customer names, and email address) to adapt the payment form to your platform.
Add Multiple Payment Buttons on One Page
To allow collections of different amounts, you can integrate multiple payment buttons on the same page.
Trigger the Collection with an Event
If you want to trigger the collection through a specific event, use JavaScript to activate the payment form on request.
Embedded Integration: Payment Without Redirection
For an optimized user experience, you can integrate the collection form directly on your site without redirecting the user.
Customization of the Interface and Advanced Options
Checkout.js allows you to customize the visual elements of your form to match your platform’s identity. You can define the background color, the payment button text, or add a logo.
Modify the appearance and add extra details:
-
Public key :
data-public-key
-
Collection amount :
data-transaction-amount
-
Collection description :
data-transaction-description
-
Currency :
data-currency-iso
-
Button text :
data-button-text
-
Button CSS class :
data-button-class
-
Widget image and description :
data-widget-image, data-widget-description
Method with a form tag for advanced integration
Checkout.js also allows integration with a form tag to send specific data after payment.
Connect Your FedaPay Account
Once the code is integrated, make sure to connect your FedaPay account to authorize the creation of clients and collections. This step is crucial to secure your integration.
Go to Preferences here :
FedaPay Class Method and Configuration Attributes
Checkout.js offers options to initialize the collection component with multiple configurations:
Domain Authorization for Checkout JS
When your merchant site connects to the FedaPay Checkout solution for the first time, domain authorization is required. This step ensures that your customers are properly redirected to your secure payment page, and not to the FedaPay account creation interface.
Why is this authorization crucial ?
Without prior authorization of your domain:
- Your customers will be redirected to the FedaPay signup interface,
- They will not be able to complete their payments,
- This can lead to a loss of conversions.
Steps to authorize your domain
-
Log in to your FedaPay account
-
Click on your profile photo (top right)
-
Select the Applications menu
-
In the section Domain name to authorize:
- Enter the domain name of your merchant site (e.g. yourwebsite.com)
- Click the Authorize button
Once this step is completed, your domain is approved for use with Checkout JS.
Revoking a domain (optional)
In some cases, you may want to remove access for an authorized domain – for example:
- If you have changed your main site or domain,
- If you detect unauthorized or suspicious usage.
To do this:
-
Still go to the Applications tab
-
Enter the relevant domain name in the field Revoke access to the following domain
-
Click the Revoke access button
Note : Once the revocation is done, payments from this domain will be blocked.