# node-shoket

> A simple node wrapper for the shoket payment API, for more information on the API visit Shoket Official website.

Latest version **1.1.1** (published 2022-04-30) · MIT license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2022-04-30 |
| First published | 2022-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Abdulaziz |
| Maintainers | samatar1776 |

## Links

- npm: https://www.npmjs.com/package/node-shoket
- npm.io page: https://npm.io/package/node-shoket

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7

## Recent versions

- 1.1.1 (latest) — 2022-04-30
- 1.1.0 — 2022-03-01
- 1.0.0 — 2022-03-01

## README

# node-shoket

A simple node wrapper for the shoket payment API, for more information on the API visit [Shoket Official website](https://developers.shoket.co/).

## Getting Started

### Prerequisites

- Install [Node.js](https://nodejs.org/) which includes [Node Package Manager](https://www.npmjs.com/get-npm)


### Installation
Installing with npm:

```shell
npm install node-shoket
```

### Usage
```js
const {makePayment, verifyPayment} = require('node-shoket');

//function used to make payment
makePayment(API_KEY,'5000','Sam Smith','user@mail.com','255612345678','Halotel');

//function used to verify payment
verifyPayment(API_KEY, '3j8zL7Tu7LhTMuR1S540f');

```

### Testing
```js
npm test
```

## Documentation
- The **makePayment** function is used to accept payments, the function has 6 parameters which are **API_KEY**, **amount**, **customer_name**, **email**, **number_used** and **channel**. 
The parameters are as follows in the function:
```js
makePayment(API_KEY, amount, customer_name, email, number_used, channel);
```
| Parameter       | Required | Description                                                                                                 |
|-----------------|----------|-------------------------------------------------------------------------------------------------------------|
| API_KEY         | Yes      | This is the secret API key given on registering at the [Shoket Official site](https://dashboard.shoket.co/) |
| Amount          | Yes      | This is an amount in Tanzania shilling.                                                                     |
| Customer Number | Yes      | This is a customer phone number which will be used to charge a customer.                                    |
| Email           | Yes      | This is a customer Email                                                                                    |
| Channel         | Yes      | Mobile-provider name which is used by the customer phone number.                                            |
| Customer names  | Yes      | This is a customer full name                                                                                |

- The **verifyPayment** is used to verify the transaction conducted, the function has 2 parameters which are the **API_KEY** and the **transaction reference**. The parameters are arranged as follows:

```js
verifyPayment(API_KEY, transaction_reference);
```
| Parameter             | Required | Description                                                                                                 |
|-----------------------|----------|-------------------------------------------------------------------------------------------------------------|
| API_KEY               | Yes      | This is the secret API key given on registering at the [Shoket Official site](https://dashboard.shoket.co/) |
| Transaction Reference | Yes      | This is the reference of the transaction performed already.                                                 |

## Contributing

Please see [CONTRIBUTING](CODE_OF_CONDUCT.md) for details.


## Credits

-   [Abdulaziz(Samatar) Abdi](https://github.com/azeez1776)
-   [Louis Ngatale](https://github.com/LouisNgatale)
-   [All Contributors](../../contributors)


## License

This project is licensed under the [MIT](LICENSE.md) License.

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