@gray-adeyi/korapay-sdk
v0.3.0
Published
A korapay client SDK for the javascript runtime.
Maintainers
Readme
@gray-adeyi/korapay-sdk
A korapay client SDK for the javascript runtime.
Features
- 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
Installation
Npm
npm i @gray-adeyi/korapay-sdkYarn
yarn add @gray-adeyi/korapay-sdkPnpm
pnpm i @gray-adeyi/korapay-sdkBun
bun add @gray-adeyi/korapay-sdkDeno
deno add @gray-adeyi/korapay-sdkUsage
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: "[email protected]" },
amount: 1_000_000,
currency: Currency.NGN,
narration: "test charge",
};
client.chargeViaBankTransfer(payload).then(console.log);See the Project's Documentation for more
Limitations
- 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
Sponsorship
Every little donation goes a long way. You can also give this project a star in its Github repository it helps ♥️
Contributing
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.
