open-index/open-npm huggingface dataset:
npm package: @mongolian-payment/bonum
Description: Bonum PSP payment SDK for Node.js - card payment processing, Google Pay, Apple Pay
Latest version: 1.0.0

# @mongolian-payment/bonum

Bonum PSP payment SDK for Node.js — card payment processing, Google Pay, Apple Pay.

## Installation

```bash
npm install @mongolian-payment/bonum
```

Requires Node.js >= 18.0.0 (uses native `fetch`).

## Quick Start

```typescript
import { BonumClient } from '@mongolian-payment/bonum';

const client = new BonumClient({
  endpoint: 'https://psp.bonum.mn',
  merchantKey: 'your-merchant-key',
});

// Process a payment (card token / Apple Pay token)
const result = await client.processPayment({
  token: 'payment-token-from-authorization',
  orderId: 'ORDER-001',
});
console.log(result.success); // true or false
console.log(result.statusCode);

// Process a Google Pay payment
const gpay = await client.processGooglePay({
  token: 'encrypted-google-pay-token',
  orderId: 'ORDER-002',
  amount: 5000,
  currencyCode: 'MNT',
});

// Validate merchant session (Apple Pay)
const session = await client.validateMerchant({
  validationURL: 'https://apple-pay-gateway.apple.com/...',
});

// Check payment log
const logs = await client.getPaymentLog('ORDER-001');
console.log(logs[0].success); // true
console.log(logs[0].amount); // 5000
```

## Environment Variables

```bash
BONUM_ENDPOINT=https://psp.bonum.mn
BONUM_MERCHANT_KEY=your-merchant-key
```

```typescript
import { BonumClient, loadConfigFromEnv } from '@mongolian-payment/bonum';
const client = new BonumClient(loadConfigFromEnv());
```

## API Methods

| Method | Description |
|--------|-------------|
| `processPayment(input)` | Process payment with card/Apple Pay token |
| `processGooglePay(input)` | Process Google Pay payment |
| `validateMerchant(input)` | Validate Apple Pay merchant session |
| `getPaymentLog(orderId)` | Get payment log entries for an order |

## Endpoints

| Environment | Base URL |
|-------------|----------|
| Production | `https://psp.bonum.mn` |
| Test | `https://testpsp.bonum.mn` |

## Error Handling

```typescript
import { BonumError } from '@mongolian-payment/bonum';

try {
  await client.processPayment(input);
} catch (err) {
  if (err instanceof BonumError) {
    console.error(err.message);    // "Bonum API error: POST /api/payment/process (401)"
    console.error(err.statusCode); // 401
    console.error(err.response);   // Raw response body
  }
}
```

## License

MIT
npm package: @mongolian-payment/golomt
Description: Golomt Bank ecommerce payment SDK for Node.js - Create invoices, inquire transactions, pay by token
Latest version: 1.0.0

# @mongolian-payment/golomt

Golomt Bank ecommerce payment SDK for Node.js. Create invoices, inquire transaction status, and pay by token with automatic HMAC-SHA256 checksum generation.

## Installation

```bash
npm install @mongolian-payment/golomt
```

## Quick Start

```typescript
import { GolomtClient } from "@mongolian-payment/golomt";

const client = new GolomtClient({
  endpoint: "https://ecommerce.golomtbank.com",
  secret: "your-hmac-secret",
  bearerToken: "your-bearer-token",
});

// Create an invoice
const invoice = await client.createInvoice({
  amount: 50000,
  transactionId: "order-12345",
  returnType: "POST",
  callback: "https://yoursite.com/payment/callback",
  getToken: false,
  socialDeeplink: false,
});

// Get payment URL to redirect the user
const paymentUrl = client.getPaymentUrl(invoice.invoice);
// => "https://ecommerce.golomtbank.com/payment/MN/..."

// Check transaction status
const status = await client.inquiry("order-12345");

// Pay with a saved token
const result = await client.payByToken(50000, "saved-token", "order-67890");
```

## Configuration

### Direct

```typescript
const client = new GolomtClient({
  endpoint: "https://ecommerce.golomtbank.com",
  secret: "your-hmac-secret",
  bearerToken: "your-bearer-token",
});
```

### From Environment Variables

```typescript
import { loadConfigFromEnv, GolomtClient } from "@mongolian-payment/golomt";

// Reads GOLOMT_ENDPOINT, GOLOMT_SECRET, GOLOMT_BEARER_TOKEN
const client = new GolomtClient(loadConfigFromEnv());
```

## API

### `createInvoice(input)`

Create a payment invoice. The HMAC checksum is computed automatically.

| Field           | Type        | Description                          |
| --------------- | ----------- | ------------------------------------ |
| amount          | `number`    | Payment amount                       |
| transactionId   | `string`    | Unique transaction identifier        |
| returnType      | `ReturnType`| `"POST"`, `"GET"`, or `"MOBILE"`     |
| callback        | `string`    | Callback URL for payment result      |
| getToken        | `boolean`   | Generate a reusable payment token    |
| socialDeeplink  | `boolean`   | Generate a SocialPay deeplink        |

### `inquiry(transactionId)`

Check the status of a transaction.

### `payByToken(amount, token, transactionId, lang?)`

Pay using a previously saved token. Language defaults to `"MN"`.

### `getPaymentUrl(invoice, lang?, paymentMethod?)`

Build a redirect URL for the Golomt payment page.

- `lang`: `"MN"` (default) or `"EN"`
- `paymentMethod`: `"payment"` (default) or `"socialpay"`

## License

MIT
npm package: @mongolian-payment/monpay
Description: MonPay payment SDK for Node.js - QR payments and deeplink invoices
Latest version: 1.0.0

# @mongolian-payment/monpay

TypeScript SDK for **MonPay** payment integration. Supports both QR code payments and deeplink invoices with zero dependencies.

## Installation

```bash
npm install @mongolian-payment/monpay
```

Requires Node.js >= 18.0.0 (uses native `fetch` and `btoa`).

## QR Payments

Use `MonPayQrClient` for QR-based payments with HTTP Basic Auth.

```typescript
import { MonPayQrClient } from "@mongolian-payment/monpay";

const client = new MonPayQrClient({
  endpoint: "https://api.monpay.mn",
  username: "your-username",
  accountId: "your-account-id",
  callbackUrl: "https://yoursite.com/monpay/callback",
});

// Generate a QR code
const qr = await client.generateQr(5000);
console.log(qr.result.qrcode); // base64 QR image
console.log(qr.result.uuid); // UUID for tracking

// Check payment status
const status = await client.checkQr(qr.result.uuid);
console.log(status.result.transactionId);

// Parse callback
const callback = client.parseCallback(new URL(callbackUrl));
console.log(callback.amount, callback.status);
```

## Deeplink Invoices

Use `MonPayDeeplinkClient` for deeplink-based payments with OAuth2.

```typescript
import { MonPayDeeplinkClient } from "@mongolian-payment/monpay";

const client = new MonPayDeeplinkClient({
  endpoint: "https://api.monpay.mn",
  clientId: "your-client-id",
  clientSecret: "your-client-secret",
  grantType: "client_credentials",
  webhookUrl: "https://yoursite.com/monpay/webhook",
  redirectUrl: "https://yoursite.com/monpay/redirect",
});

// Create a deeplink invoice (auto-authenticates)
const invoice = await client.createDeeplink(
  10000,      // amount
  "P2B",      // invoiceType
  "branch1",  // branchUsername (receiver)
  "Order #42" // description
);
console.log(invoice.result.id);

// Check invoice status
const status = await client.checkInvoice(invoice.result.id);
console.log(status.result.status, status.result.bankName);

// Parse callback
const callback = client.parseCallback(new URL(webhookUrl));
console.log(callback.invoiceId, callback.status);
```

## Types

All request/response types are exported:

```typescript
import type {
  InvoiceType,
  Bank,
  MonPayQrConfig,
  MonPayDeeplinkConfig,
  MonPayQrResponse,
  MonPayCheckResponse,
  MonPayCallback,
  DeeplinkCreateResponse,
  DeeplinkCheckResponse,
  DeeplinkCallback,
} from "@mongolian-payment/monpay";
```

## Error Handling

All API errors throw `MonPayError` with HTTP status code and response body:

```typescript
import { MonPayError } from "@mongolian-payment/monpay";

try {
  await client.generateQr(5000);
} catch (err) {
  if (err instanceof MonPayError) {
    console.error(err.message);    // Human-readable message
    console.error(err.statusCode); // HTTP status code
    console.error(err.response);   // Raw response body
  }
}
```

## License

MIT
npm package: @mongolian-payment/tokipay
Description: TokiPay payment SDK for Node.js - POS payments, third-party deeplinks, refunds
Latest version: 1.0.0

# @mongolian-payment/tokipay

TokiPay payment SDK for Node.js — QR payments, deeplink payments, send to user, refunds, and more.

## Installation

```bash
npm install @mongolian-payment/tokipay
```

## Quick Start

```typescript
import { TokiPayClient } from '@mongolian-payment/tokipay';

const client = new TokiPayClient({
  endpoint: 'https://api.tokipay.mn',
  apiKey: 'your-api-key',
  imApiKey: 'your-im-api-key',
  authorization: 'your-authorization-token',
  merchantId: 'your-merchant-id',
  successUrl: 'https://yoursite.com/success',
  failureUrl: 'https://yoursite.com/failure',
});

// QR Payment
const payment = await client.paymentQr({
  orderId: 'ORDER-001',
  amount: 50000,
  notes: 'Payment for order #001',
});
console.log(payment.data.requestId);

// Check payment status
const status = await client.paymentStatus(payment.data.requestId);
console.log(status.data.status); // APPROVED, PENDING, EXPIRED, COMPLETED

// Send payment to user by phone
const sent = await client.paymentSendToUser({
  orderId: 'ORDER-002',
  amount: 30000,
  notes: 'Refund',
  phoneNo: '99001122',
  countryCode: '+976',
});

// Third-party deeplink
const deeplink = await client.thirdPartyDeeplink({
  orderId: 'ORDER-003',
  amount: 25000,
  notes: 'Purchase',
});
console.log(deeplink.data.deeplink);

// Cancel payment
await client.paymentCancel(payment.data.requestId);

// Refund payment
await client.paymentRefund({
  requestId: payment.data.requestId,
  refundAmount: 50000,
});
```

## Environment Variables

```bash
TOKIPAY_ENDPOINT=https://api.tokipay.mn
TOKIPAY_API_KEY=your-api-key
TOKIPAY_IM_API_KEY=your-im-api-key
TOKIPAY_AUTHORIZATION=your-auth-token
TOKIPAY_MERCHANT_ID=your-merchant-id
TOKIPAY_SUCCESS_URL=https://yoursite.com/success
TOKIPAY_FAILURE_URL=https://yoursite.com/failure
TOKIPAY_APP_SCHEMA_IOS=your-ios-schema
```

```typescript
import { TokiPayClient, loadConfigFromEnv } from '@mongolian-payment/tokipay';
const client = new TokiPayClient(loadConfigFromEnv());
```

## API Methods

### POS Methods
| Method | Description |
|--------|-------------|
| `paymentQr(input)` | Generate QR payment |
| `paymentSendToUser(input)` | Send payment to user |
| `paymentScanUser(input)` | Scan user for payment |
| `paymentStatus(requestId)` | Check payment status |
| `paymentCancel(requestId)` | Cancel payment |
| `paymentRefund(input)` | Refund payment |

### Third-Party Methods
| Method | Description |
|--------|-------------|
| `thirdPartyDeeplink(input)` | Create deeplink payment |
| `thirdPartyPhoneRequest(input)` | Phone-based payment request |
| `thirdPartyStatus(requestId)` | Check third-party status |

## Order Statuses

| Status | Value |
|--------|-------|
| Paid | `APPROVED` |
| Completed | `COMPLETED` |
| Pending | `PENDING` |
| Canceled/Expired | `EXPIRED` |

## License

MIT
npm package: @mongoloquent/nestjs
Description: Mongoloquent is a lightweight MongoDB ORM library for Javascript/Typescript (@nestjs)
Author: Ajat Darojat
Latest version: 1.2.0

<p align="center">
    <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
    <br />
    <img src="./assets/logo.jpeg"/>
</p>

<p align="center">
    A lightweight <a href="https://mongodb.com" target="_blank">MongoDB</a> ORM library for Javascript/Typescript.
</p>

<p align="center">
<a href="https://www.npmjs.com/@mongoloquent/nestjs" target="_blank"><img src="https://img.shields.io/npm/v/@mongoloquent/nestjs.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/@mongoloquent/nestjs" target="_blank"><img src="https://img.shields.io/npm/l/@mongoloquent/nestjs.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/@mongoloquent/nestjs" target="_blank"><img src="https://img.shields.io/npm/dm/@mongoloquent/nestjs.svg" alt="NPM Downloads" /></a>
<a href="https://github.com/sponsors/ajatdarojat45"  target="_blank"><img src="https://img.shields.io/badge/Support%20us-Github%20Sponsor-41B883.svg" alt="Support us"></a>

</p>

## Description

[Mongoloquent](https://mongoloquent.com/) module for [Nest](https://github.com/nestjs/nest).

## Installation

```bash
$ npm i --save @mongoloquent/nestjs mongoloquent mongodb
```

## Quick Start

[Overview & Tutorial](https://mongoloquent.com/docs/integrations/nestjs)

## Support

Mongoloquent is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://mongoloquent.com/docs/support).

### Sponsors

### Partners

<p align="center">
    <a href="https://youtube.com/@digicodeacademy" target="_blank">
    <img height="50px" src="./assets/digicode.png"/>
    </a>
    <a href="https://ideacamp.id" target="_blank">
    <img height="50px" src="./assets/ideacamp.png"/>
    </a>

</p>

## Stay in touch

- Author - [Ajat Darojat](https://linkedin.com/in/ajatdarojat45)
- Website - [https://mongoloquent.com](https://mongoloquent.com/)

## License

Mongoloquent is [MIT licensed](LICENSE).
npm package: @mongoly/core
Description: A lightweight MongoDB utility/wrapper library for Node.js
Author: mongoly
Latest version: 0.1.11

# @mongoly/core
The core of mongoly. This library includes all the primary functionality and goals of this project.
## Installation
```bash
npm install mongodb @mongoly/core
```
## Usage
```ts
import { MongoClient } from 'mongodb';
import { ensureJSONSchema, ensureIndexes } from '@mongoly/core';

async function bootstrap() {
  const client = new MongoClient('mongodb://localhost:27017');
  await client.connect();
  const db = client.db('test');
  await ensureJSONSchema(db, 'users', {
    bsonType: 'object'
    properties: {
      name: { bsonType: 'string' },
      age: { bsonType: 'number'},
    },
    required: ['name', 'age']
  });
  const collection = db.collection('users');
  await ensureIndexes(collection, [
    { 
      key: { name: 1 },
      unique: true, 
    }
  ]);
  await collection.insertOne({ name: 'John', age: 27 }) 
  await collection.insertOne({ name: 'Jane', age: '27' }) // Document Validation Error 
}
```
## Whats left?
If you have anything else in mind just let me know, but remember the library is meant to be a lightweight utility/wrapper for MongoDB.
- Create a transformer for JSON schema document validation errors to make displaying them easier.
## Ecosystem
- [`@mongoly/nestjs`](https://www.npmjs.com/package/@mongoly/nestjs): A NestJS wrapper for mongoly.
npm package: @mongoly/nestjs
Description: A Nestjs module for mongoly
Author: mongoly
Latest version: 0.2.0

# @mongoly/nestjs

The official nest module for mongoly

> This package is under heavy development and will continously receive breaking changes, use at your own risk!

## Installation

```bash
npm install mongodb @mongoly/core @mongoly/nestjs
```

## Usage

```ts
// app.module.ts
import { Module } from "@nestjs/common";
import { ensureJSONSchema, ensureIndexes } from "@mongoly/nestjs";

@Module({
  imports: [
    MongolyModule.forRoot({
      url: "mongodb://localhost:27017/dev_mongoly_nestjs",
    }),
    CatsModule,
  ],
})
export class AppModule {}
```

```ts
// cats.module.ts
import { Module } from "@nestjs/common";
import { MongolyModule } from "@mongoly/nestjs";
import { Cat, CatIndexes, CatSchema } from "./cats.entity";
import { CatsService } from "./cats.service";

@Module({
  imports: [
    MongolyModule.forFeature([
      {
        name: Cat.name,
        schema: CatSchema,
        indexes: CatIndexes,
        dropOldIndexes: true,
      },
    ]),
  ],
  providers: [CatsService],
  exports: [CatsService],
})
export class CatsModule {}
```

```ts
// cats.entity.ts
import {
  Schema,
  Prop,
  createJSONSchemaForClass,
  createIndexesForClass,
} from "@mongoly/nestjs";

@Schema()
export class Cat {
  @Prop({ isRequired: true, isIndexed: true })
  name: string;

  @Prop({ isRequired: true, isIndexed: true })
  age: number;

  @Prop({ isRequired: true, isIndexed: true })
  breed: string;
}

export const CatSchema = createJSONSchemaForClass(Cat);
export const CatIndexes = createIndexesForClass(Cat);
```

```ts
// cats.service.ts
import { Injectable } from "@nestjs/common";
import { InjectCollection } from "@mongoly/nestjs";
import type { Collection } from "mongodb";
import { Cat } from "./cats.entity";

@Injectable()
export class CatsService {
  constructor(
    @InjectCollection(Cat.name)
    private readonly catsCollection: Collection<Cat>,
  ) {}
}
```
npm package: @mongoosejs/async-hooks
Description: Mongoose plugin providing experimental support for Node.js `async_hooks`
Author: Valeri Karpov
Latest version: 0.0.5

# mongoose-async-hooks

[Mongoose](http://mongoosejs.com/) plugin providing experimental support for [Node.js `async_hooks`](https://nodejs.org/api/async_hooks.html)

[![Build Status](https://secure.travis-ci.org/mongoosejs/mongoose-async-hooks.png)](http://travis-ci.org/mongoosejs/mongoose-async-hooks)

# Importing

```javascript
// Using Node.js `require()`
const mongooseAsyncHooks = require('@mongoosejs/async-hooks');

// Using ES6 imports
import mongooseAsyncHooks from '@mongoosejs/async-hooks';
```


# Examples

## It integrates with Node.js async hooks

```javascript
const types = [];
const hooks = {
  init: (asyncId, type) => {
    types.push(type);
  }
};

const asyncHook = require('async_hooks').createHook(hooks);

const schema = new Schema({ name: String });

// Add this plugin
schema.plugin(mongooseAsyncHooks);

const MyModel = mongoose.model('MyModel', schema);

asyncHook.enable();

const doc = new MyModel({ name: 'test' });
doc.save(function(error, doc) {
  asyncHook.disable();

  assert.ok(types.includes('mongoose.MyModel'));
});
```