A korapay client SDK for the javascript runtime.
- Typescript support
- Implements methods matching all of korapay's public API.
- Automatic case transformation of payload and response data keys for a more optimal JS/TS experience
npm i @gray-adeyi/korapay-sdk
yarn add @gray-adeyi/korapay-sdk
pnpm i @gray-adeyi/korapay-sdk
bun add @gray-adeyi/korapay-sdk
deno add @gray-adeyi/korapay-sdk
import {
type ChargeViaBankTransferPayload,
Currency,
KorapayClient,
type KorapayResponse,
} from "@gray-adeyi/korapay-sdk";
// Assumes your KORAPAY_PUBLIC_KEY, KORAPAY_SECRET_KEY
// & KORAPAY_ENCRYPTION_KEY is set in your environmental
// variables. They can be passed in explicitly on the
// instantiation which overrides the values set in the environmental
// variables.
const client = new KorapayClient();
const response: KorapayResponse = await client.getBalances()
const payload: ChargeViaBankTransferPayload = {
reference: "qwerty",
customer: { email: "johndoe@example.com" },
amount: 1_000_000,
currency: Currency.NGN,
narration: "test charge",
};
client.chargeViaBankTransfer(payload).then(console.log);
See the Project's Documentation for more
- Currently, @gray-adeyi/korapay-sdk does not perform any form of validation on the data passed in as method parameters but sends them as is to korapay's servers.
- Limited documentation
Every little donation goes a long way. You can also give this project a star in
its Github repository it helps
You might encounter bugs while using this project or have feature enhancements you'd like to share with the project. Create an issue on the project's github page.