Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mendoc/ongoua-pvit
A npm package for use PVit payment gateway
https://github.com/mendoc/ongoua-pvit
Last synced: 6 days ago
JSON representation
A npm package for use PVit payment gateway
- Host: GitHub
- URL: https://github.com/mendoc/ongoua-pvit
- Owner: mendoc
- License: mit
- Created: 2021-05-13T10:23:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-25T17:10:38.000Z (over 3 years ago)
- Last Synced: 2024-04-23T11:18:28.593Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ongoua-pvit
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ongoua-pvit
A npm package for use PVit payment gateway## Installation
Using npm:
```shell
$ npm i ongoua-pvit
```Using yarn:
```shell
$ yarn add ongoua-pvit
```
## Examples
### Submitting request
```js
const { OngouaPvit } = require("ongoua-pvit");const TEL_MARCHAND = process.env.TEL_MARCHAND;
const TOKEN = process.env.TOKEN;const clientPvit = new OngouaPvit(TEL_MARCHAND, TOKEN);
clientPvit.tel_client = "074567890";
clientPvit.montant = 100;
clientPvit.ref = "PROD2X3T8";clientPvit.send().then((response) => {
const data = response.json;
if (data) {
// Do something with data
console.log(data.statut);
console.log(data.message);
}
}).catch((error) => {
console.log("Error handling");
console.log(error);
});
```
### In your PVit callback
```js
const { OngouaPvit } = require("ongoua-pvit");// xmlPVit contains XML response provided by PVit
const data = OngouaPvit.parse(xmlPVit)if (data) {
// Do something with data
console.log(data.statut);
console.log(data.message);
console.log(data.ref);
}
```## Report bug
DM me on Twitter [@DimitriONGOUA](https://twitter.com/DimitriOngoua)