# @mandarvl/mvola

> The MVola Node library provides convenient access to the MVola API. Forked from tsirysndr/mvola-node

Latest version **1.2.4** (published 2024-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mandarvl/mvola
pnpm add @mandarvl/mvola
yarn add @mandarvl/mvola
bun add @mandarvl/mvola
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2024-10-20 |
| First published | 2023-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 59.4 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Manda Ravalison |
| Maintainers | mandarvl |
| Keywords | mvola |

## Links

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

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) ^6.10.3
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [buffer](https://npm.io/package/buffer.md) ^6.0.3

## Recent versions

- 1.2.4 (latest) — 2024-10-20
- 1.2.3 — 2024-09-17
- 1.2.2 — 2024-09-17
- 1.2.1 — 2023-10-13
- 1.2.0 — 2023-07-04

## README

<h1 align="left">MVola Node.js Library</h1>
<p>
  <a href="https://app.travis-ci.com/github/tsirysndr/mvola-node" target="_blank">
    <img src="https://app.travis-ci.com/tsirysndr/mvola-node.svg?branch=master" />
  </a>
  <a href="https://codecov.io/gh/tsirysndr/mvola-node" target="_blank">
    <img src="https://codecov.io/gh/tsirysndr/mvola-node/branch/master/graph/badge.svg?token=" />
  </a>
  <a href="https://www.npmjs.com/package/mvola" target="_blank">
  <img alt="Version" src="https://img.shields.io/badge/version-1.2.0-cyan.svg?cacheSeconds=2592000" />
  </a>
  <a href="https://www.npmjs.com/package/mvola" target="_blank">
  <img alt="npm" src="https://img.shields.io/npm/dm/mvola?color=%23ff00ff">
  </a>
  <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/mvola?color=%230deb99">
  <a href="https://github.com/tsirysndr/mvola-node#readme" target="_blank">
    <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
  </a>
  <a href="https://github.com/tsirysndr/mvola-node/graphs/commit-activity" target="_blank">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
  </a>
  <a href="https://github.com/tsirysndr/mvola-node/blob/master/LICENSE" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg" />
  </a>
   <a href="https://github.com/tsirysndr/mvola-node/commits/master" target="_blank">
    <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/tsirysndr/mvola-node">
  </a>
</p>

<p>
<a href="https://www.buymeacoffee.com/tsiry">
  <img src="https://cdn.buymeacoffee.com/buttons/v2/default-red.png" alt="Buy Me A Coffee" height="40" />
</a>
</p>

The MVola Node library provides convenient access to the [MVola API](https://www.mvola.mg/devportal) from applications written in server-side Javascript 

## 🚚 Install

```sh
npm install mvola
```

## 🚀 Usage

```typescript
import { Client, SANDBOX_URL, TransactionRequest } from "mvola";
import { v4 } from "uuid";

async function main() {
  const consumerKey = process.env.CONSUMER_KEY;
  const consumerSecret = process.env.CONSUMER_SECRET;
  const mvola = new Client(SANDBOX_URL);
  const data = await mvola.auth.generateToken(consumerKey!, consumerSecret!);

  mvola.transaction.setAccessToken(data.access_token);
  mvola.transaction.setOptions({
    version: "1.0",
    correlationId: v4(),
    userLanguage: "FR",
    userAccountIdentifier: "msisdn;0343500004",
    partnerName: "TestMVola",
    // callbackUrl: "YOUR CALLBACK URL"
  });

  const transactionRef = v4();

  const tx: TransactionRequest = {
    amount: 1000,
    currency: "Ar",
    descriptionText: "test",
    requestDate: new Date().toISOString(),
    debitParty: [
      {
        key: "msisdn",
        value: "0343500003",
      },
    ],
    creditParty: [
      {
        key: "msisdn",
        value: "0343500004",
      },
    ],
    metadata: [
      {
        key: "partnerName",
        value: "TestMVola",
      },
      {
        key: "fc",
        value: "USD",
      },
      {
        key: "amountFc",
        value: "1",
      },
    ],
    requestingOrganisationTransactionReference: transactionRef,
    originalTransactionReference: transactionRef,
  };
  const response = await mvola.transaction.initMerchantPayment(tx);
  console.log(response);
}

main();

```

## Author

👤 **Tsiry Sandratraina <tsiry.sndr@aol.com>**

* Twitter: [@tsiry_sndr](https://twitter.com/tsiry_sndr)
* Github: [@tsirysndr](https://github.com/tsirysndr)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/tsirysndr/mvola-node/issues). You can also take a look at the [contributing guide](https://github.com/tsirysndr/mvola-node/blob/master/CONTRIBUTING.md).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2022 [Tsiry Sandratraina <tsiry.sndr@aol.com>](https://github.com/tsirysndr).<br />
This project is [MIT](https://github.com/tsirysndr/mvola-node/blob/master/LICENSE) licensed.

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