This documentation page contains everything you need to know about integrating to Klasha’s Payment Gateway. Once integration is done, you can begin to process payments from anywhere in the world in seconds.
Whilst you start your integration, please remember to reach out to our Compliance team to go through the KYB process and get your business verified. This is a mandatory process before you can start using our production platform.
If you are going to be implementing the direct charge API, you would require additional verification as this is only available to businesses that are PCI-DSS certified.
Payment collection
As a business owner, here is a way we make it possible for you to collect payments from customers all over the world:
In all the following APIs, you can simply substitute the desired currency to the path variable {gateway}.
Before you begin
Get your API keys
Find your keys on the Klasha Dashboard → Settings → Generate API Keys (here)
Klasha Dashboard, Generate API Keys page
Encryption algorithm
Since we are treating payment data, the communication from merchant to APIs must be encrypted. Expand the section to find out more about the encryption algorithm and how to use it.
How to use
We are using a standard 3DES technology with Padding. Please find some code snippets here:
If you are using any other programming language asides Java in your applications, please reach out to us; we can help.
The secret, also known as the encryption key, can be found in the Klasha Dashboard → Settings → Generate API Keys (here), under the caption New encryption key.
Card payments
To accept a card payment, you need to integrate with the following flow:
First, initiate the card payment
Then charge the card
And at the end validate the payment (to provider OTP and/or PIN)
You can find more information on the Postman link as well as other APIs.
You’d need to pass, as header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
This is for cards that are covered by 3DS flows.{"tx_ref":"klasha-add-bank-card-1697954ttt947238348","redirectUrl":"https://coreflutterwavestaging.com/flwmpgs/trxauth?hid=712b85a8542649e68c19b1c80d81aadc","data": {"meta": {"authorization": {"mode":"redirect","redirect":"https://coreflutterwavestaging.com/flwmpgs/trxauth?hid=712b85a8542649e68c19b1c80d81aadc" } } }}
{"status":"error","message":"Card number is invalid","data":null,"tx_ref":"klasha-add-bank-card-1697954ttt947238348"}
You can find more information on the Postman link as well as other APIs.
You’d need to pass, as header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name
Value
Content-Type
application/json
Request Body (encrypted)
{"message":"encrypted-body"}
Request Body (plain)
The tx-ref is contained in the successful response of the initiate payment call.
You can find more information on the Postman link as well as other APIs.
You would need to pass, as header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name
Value
Content-Type
application/json
Request Body (encrypted)
{"message":"encrypted-body"}
Request Body (plain)
The tx-ref is contained in the successful response of the initiate payment call.
You can find more information on the Postman link as well as other APIs.
You’d need to pass, as header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
{"tx_ref":"test910-on2007u047e-cvercdfer","meta": {"authorization": {"mode":"banktransfer","transfer_note":"Please make a bank transfer to Klasha - Collection","transfer_amount":10.0,"transfer_bank":"WEMA BANK","account_expiration":"2024-03-11T10:28:06.793","transfer_account":"8575492419" } },"message":"Charge initiated","status":"success"}
You can find more information on the Postman link as well as other APIs.
You would need to pass, as header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.