Korapay SDK
The Korapay NodeJS SDK
How to use
npm install korapay-node
yarn add korapay-node
ESM,
import { Korapay } from "korapay-node";
const korapay = new Korapay(secret_key, public_key);
CommonJs
const { Korapay } = require("korapay-node");
const korapay = new Korapay(secret_key, public_key);
All methods use promise meaning you can either use the async...await
or then
. However, you do not have to clutter your code with blocks of try..catch
as the SDK intuitively handles error already. For instance:
const charge = await korapay.charge.initialize( payload );
if( !charge.status ) return charge.message;
redirect( charge.data.checkout_url );
Modules
Contributing
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
Created with 🧡 by Owoade