# node-payant

> a nodejs payant api

Latest version **1.2.0** (published 2017-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-payant
pnpm add node-payant
yarn add node-payant
bun add node-payant
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-01-18 |
| First published | 2017-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Subomi Oluwalana |
| Maintainers | subomi |
| Keywords | API, Payments, Fintech, Payant, Node, Naira |

## Links

- npm: https://www.npmjs.com/package/node-payant
- Repository: https://github.com/Subomi/node-payant
- Homepage: https://github.com/Subomi/node-payant#readme
- Issues: https://github.com/Subomi/node-payant/issues
- npm.io page: https://npm.io/package/node-payant

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.67.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-01-18
- 1.1.0 — 2017-01-18
- 1.0.0 — 2017-01-16

## README

# node-payant
A nodejs API for [Payant](https://payant.ng).

### Installation
```js
npm install node-payant
```

### Features
- Promisified
- Callback chaining with promise handlers


### Parameters For Each Call
|  Resource/method       |   Ref   |   params   |   
|------------------------|---------|------------|
| **Clients.add**        | Nil     |  Yes - `firstname, lastname, email, phone` |
| **Clients.get**        | Yes     | Nil        |
| **Clients.edit**       | Yes     | Yes - `firstname, lastname, email, phone`  |
| **Clients.delete**     | Yes     | Nil        |
| | | |
| **Invoices.add**       | Nil     | Yes - `firstname, lastname, email, phone` or `client_id, due_date, fee_bearer, items` |
| **Invoices.get**       | Yes     | Nil        |
| **Invoices.send**      | Yes     | Nil        |
| **Invoices.history**   | Nil     | Yes - `period` |
| **Invoices.delete**    | Yes     | Nil        |
| | | |
| **misc.getBanks**      | Nil     | Nil        |
| | | |
| **Payments.create**    | Nil     | Yes - `reference_code, date, amount, channel` |
| **Payments.get**       | Yes     | Nil        |
| **Payments.history**   | Nil     | Yes - `period` |
| | | |
| **Products.create**    | Nil     | Yes - `customer, plan`  |
| **Products.disable**   | Nil     | Yes - `code, token`     |
| **Products.enable**    | Nil     | Yes - `code, token`     |
| **Products.get**       | Yes     | Nil        |
| **Products.list**      | Nil     | Nil        |

The parameters specified in the third column are the complusory ones. But they are not limited to them alone. Check over at 
[Payant](https://developers.payant.ng) for the complete list.

### Examples
The Payant constructor takes in two arguments in a particular order.
- secret_key: Your secret key derived from your payant dashboard.
- demo_flag: It is used to set your endpoint either for production or testing, It is your default endpoint, to remove it in production set it to false. 

```js
// Requiring the library
var Payant = require('node-payant');

// To set endpoint for demo
Payant = Payant(secret_key);

// OR 
Payant = Payant(secret_key, true);

// To set endpoint for production
Payant = Payant(secret_key, false);

// Adding a new client
payant.clients.add({
		data: {
				first_name: "Subomi",
				last_name: "Oluwalana",
				email: "subomi.oluwalana@yahoo.com",
				phone: "2348077886076"
			}
		}, (error, data) => {
			if(!error) {
				return data;
			} 
			return error;
		})

// Retrieving a client's details
payant.clients.get(
		{ref: 900}, 
		(error, data) => {
			// parse response as json object
			return JSON.parse(data);
		})
		.then((value) => {}, (reason) => {});

```
### TODO
- Write Tests

### Saying Thank You
Just star, and report issues. Thank you.

---
_Source: https://npm.io/package/node-payant · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
