An open API service indexing awesome lists of open source software.

https://github.com/vectormike/cyberpay

Nodejs API wrapper for CyberPay
https://github.com/vectormike/cyberpay

Last synced: about 1 year ago
JSON representation

Nodejs API wrapper for CyberPay

Awesome Lists containing this project

README

          

# CyberPay Node.js Library

[![CircleCI](https://circleci.com/gh/circleci/circleci-docs.svg?style=shield)](https://circleci.com/gh/circleci/circleci-docs)
![GitHub repo size](https://img.shields.io/github/repo-size/Vectormike/cyberpay)
![GitHub contributors](https://img.shields.io/github/contributors/Vectormike/cyberpay)
![Twitter Follow](https://img.shields.io/twitter/follow/Vectormike_?style=social)

NPM Version
NPM Downloads

Nodejs API wrapper for [CyberPay](https://cyberpay.net.ng/).

This library provides access to the CyberPay API from applications written in server-side JavaScript.

## CyberPay Endpoints/Services exposed by the library

- Bank
- BankUSSD
- BillByWallet
- Biller
- BillPayment
- Business
- Channels
- Dashboard
- DirectDebit
- FundTransfer
- Integration
- MandateProduct
- NibssPaPlus
- Nip
- Partner
- Payment
- Payout
- Provider
- Transaction
- TSA
- WalletTopUp

## Installation

```sh
npm install cyberpay --save
#or
yarn add cyberpay
```

## Usage

This package requires configuration with your account's secret key in the [CyberPay Dahboard](https://cyberpay.net.ng/)

Using ES modules and `async`/`await`:

```js
import CyberPay from 'cyberpay';

const cyberpay = new CyberPay({
integrationKey: process.env.INTEGRATION_KEY,
});

try {
const res = await cyberpay.payment.verify(transactionReference);
// Verify payment
if (res.status === 200) {
// Successful
}
} catch (err) {
if (!err.response) {
// No response from the server
// Bad network
} else {
// Response was returned from the server
// ...
}
}
```

### Payment

Operations relating to payment

#### Payment with token

`const response = await cyberpay.payment.paywithtoken(options);`

#### Payment with card

`const response = await cyberpay.payment.paywithtoken(options);`

### Bank

Activities has to do with basic information about banks integrated

#### Get all integrated banks

`const response = await cyberpay.bank();`

### Channels

Channels associated

#### Retrieves active channels

`const response = await cyberpay.fetchActiveChannels();`

### Dashboard

Display transactions on dashboard

#### Display transactions by date

`const response = await cyberpay.fetchTransactionsToDashboard(options);`

## Contributing

- You can contribute by extending the README file to contain more examples and explanations of how to use the package.

## Authors

- [Victor Jonah](https://www.linkedin.com/in/victor-jonah/)

## License

The code is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT)