1.2.0 ā€¢ Published 2 years ago

mvola v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

The MVola Node library provides convenient access to the MVola API from applications written in server-side Javascript

šŸšš Install

yarn add mvola

šŸš€ Usage

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",
  });

  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

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ā­ļø if this project helped you!

šŸ“ License

Copyright Ā© 2022 Tsiry Sandratraina <tsiry.sndr@aol.com>. This project is MIT licensed.

1.2.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago