Skip to content

gray-adeyi/korapay-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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-sdk

Yarn

yarn add @gray-adeyi/korapay-sdk

Pnpm

pnpm i @gray-adeyi/korapay-sdk

Bun

bun add @gray-adeyi/korapay-sdk

Deno

deno add @gray-adeyi/korapay-sdk

Usage

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

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.

About

A Korapay client SDK for the javascript runtime.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published