1

Overview

Oluwatobi Ololade

Last Update 2 ani în urmă

Our client library allows you to easily embed a payment iframe into your website or application. This iframe provides two payment options (for now): card payment and virtual terminal. The library is designed to simplify the integration process and ensure a secure payment experience for your users.

Installation

You can install the client library via the JavaScript client library.

Installation via Client Library

Include the following script in your HTML file:

Usage
1. Initialize the Payment Gateway

Important Params

Paramsis requiredDescription
Customer name
YesFor customizing the name on the invoice that is generated following a transaction requires this.

EmailYesThe email address of the customer is shown to them on the payment library interface.

API keyYesIt is advised that you utilize the secret key for production/live purposes and the public key for testing purposes.

PhoneYesWhen you call the library, you want this phone number to be attached to the transaction
AmountYesThis is the sum that the transaction is to be made on.
ReferenceYesA unique case-sensitive transaction reference is required for this. Alphabetic letters only (-,., =) are permitted.
Information such as email, amount, transaction reference, phone number, etc. is a must in order to start the transaction. You can pass parameters when you initialize a transaction. Here is a sample markup to initialise the payment library from a form.

You can display the payment iframe by calling the payWithBelemaPay method. Specify the payment options you want to provide (card payment and virtual terminal):

2. HTML submit button to call the payment Iframe

Ensure you have a button to trigger the payment gateway to respond with the iframe to make payment:

Example Integration

Here's a full example of how to integrate the payment iframe into your html page:

This example will render a payment iframe that supports both card payments and a virtual terminal, providing a seamless payment experience for your users.

Payment Options
  1. Card Payment:
  • Users can enter their card details directly in the iframe.

  • The library securely handles card information and sends it to the payment gateway.

2. Virtual Terminal:
  • The virtual terminal allows for manual transfer of funds via a generation of virtual account, this virtual account is for a one time transaction and expires after 30 minutes of generation.

  • This option is ideal for phone orders or in-person payments where customers prefers not to enter the details of their card.

  • Once a payment has been made, this page has the ability to automatically confirm the payment to be either successful or failed.

Payment Results

The success callback will be triggered when a payment is successfully processed. The paymentData object will contain status.

The onError callback will handle any errors that occur during the payment process, providing feedback to your customer user.

Security Considerations
  • Ensure the apiKey is kept secure and not exposed to unauthorized users.
  • Always use the sandbox environment for testing and production for live transactions.
  • Use HTTPS to secure all communication between your application and the payment gateway.
Troubleshooting
Common Issues
  • Invalid API Key: Ensure you are using the correct environment's API key (test vs. live).

  • invalid Card Details: Verify the card details are correct before sending in the payment.

Support

If you have any questions or need further assistance, please reach out to our support team at [email protected].

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us