KKIAPAY
DashboardSupport
EN 1.0.0
EN 1.0.0
  • Introduction
  • Home
    • KKiaPay
  • Account
    • Create an account
    • Account activation
    • KKiaPay Sandbox : Test Guide
    • Using KKiaPay
  • Payements
    • Supported Currencies
    • Payment Methods
    • Fees
    • Payouts
    • Transactions
  • Plugin and SDK
    • Prestashop
    • WooCommerce
    • Wordpress Give
    • Wordpress Jobster
    • Javascript SDK
      • Using KKiaPay with Vue.js
      • Using KKiaPay with React.js
      • Using KKiaPay with Angular
      • Using KKiaPay with Svelte
    • Android SDK
    • SDK Flutter
    • SDK React-Native
    • SDK Swift for iOS
    • Admin SDKs (Server-side)
      • PHP Admin SDK
      • Python Admin SDK
      • Node.js Admin SDK
  • KKIAPAY SERVICES
    • KKiaPay Direct
    • KKiaPay POS
  • Dashboard
    • General Presentation
    • Menu
      • Transactions
      • Customers
      • Payouts
      • Developers
      • Settings
    • Webhook
  • Security
    • Security provisions
    • Suspicious email and website
    • Untitled
Powered by GitBook
On this page
  • Module import
  • Initialization
  • Status of a transaction
  • Example
  • Refund a transaction
  • Example

Was this helpful?

  1. Plugin and SDK
  2. Admin SDKs (Server-side)

Node.js Admin SDK

In order to use it you will need to install it through the following npm command :

$ npm i @kkiapay-org/nodejs-sdk

Module import

const { kkiapay } = require("@kkiapay-org/nodejs-sdk"); // javascript
ou
import { kkiapay } from "@kkiapay-org/nodejs-sdk"; // typescript

Initialization

The use of the server Admin SDK requires the creation of a kkiapay object. In order to create that object, you will need to retrieve your API keys and to use the following commands whether you are in Sandbox mode or in production.

  • In Sandbox

const k = kkiapay({privatekey:"xxxxxxx",
                   publickey:"xxxxxxx",
                   secretkey:"xxxxxxx",
                   sandbox:true})

When the attributesandboxis set to true you're in test mode.

  • In live

const k = kkiapay({privatekey:"xxxxxxx",
                   publickey:"xxxxxxx",
                   secretkey:"xxxxxxx"})

Status of a transaction

KKiaPay allow you to retrieve all the information related to a transaction. To do this, you will need to fill in the following fields:

  • Your public, private and secret API keys

  • The reference of the operation (see the image below)

Example

You can use the following code to test this feature:

k.verify("transactionId").
then((response) => {
    //Handle the response
}).
catch((error) => {
    //Handle the error
})

Refund a transaction

Any success transaction made by mobile money can be subject to a refund operation. You have the possibility to make a refund if your customer hasn't obtained satisfaction for the service for which he paid or if you consider it necessary. In order to carry out such an operation, you will need to provide the following information:

  • Your public, private and secret API keys

  • The reference of the operation (see the image below)

The refund of a transaction doesn't include the refund of the fees related to.

Example

You can use the following code to test this feature:

k.refund("transactionId").
then((response) => {
    //Handle the response
}).
catch((error) => {
    //Handle the error
})
PreviousPython Admin SDKNextKKiaPay Direct

Last updated 10 months ago

Was this helpful?