# cafebazaar_validation

> A simple npm module for validate https://cafebazaar.ir/ payments

Latest version **1.0.1** (published 2020-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install cafebazaar_validation
pnpm add cafebazaar_validation
yarn add cafebazaar_validation
bun add cafebazaar_validation
```

## 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.0.1 |
| Published | 2020-11-27 |
| First published | 2020-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ehcan@icloud.com |
| Maintainers | ehcan |
| Keywords | payment, validation |

## Links

- npm: https://www.npmjs.com/package/cafebazaar_validation
- Repository: https://github.com/Ehcaning/cafebazaar_validation
- Homepage: https://github.com/Ehcaning/cafebazaar_validation#readme
- Issues: https://github.com/Ehcaning/cafebazaar_validation/issues
- npm.io page: https://npm.io/package/cafebazaar_validation

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.21.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-11-27
- 1.0.0 — 2020-04-10

## README

# Cafebazaar Validation
A simple npm module for validate https://cafebazaar.ir/ payments

## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/).

Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
$ npm install cafebazaar_validation
```


## Instantiate module
```js
const cafebazaar = require('cafebazaar_validation')(client_id, client_secret, refresh_token, package_name);
```

Example:
```js
const cafebazaar = require('cafebazaar_validation')(
    'client_id',
    'client_secret',
    'refresh_token',
    'package_name'
);
```

## Validate Payment
```js
let res = await cafebazaar.validate(sku, token);
```


Success Example:

```json
{
  "status": 200,
  "data": {
    "consumptionState": 0,
    "purchaseState": 0,
    "kind": "androidpublisher#inappPurchase",
    "developerPayload": "",
    "purchaseTime": 1586530039266
  }
}
```

Error Example:
```json
{
  "status": 404,
  "data": {
    "error_description": "The requested purchase is not found!",
    "error": "not_found"
  }
}
```

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