open-index/open-npm huggingface dataset:
npm package: @qpavy/protable-text-react-native
Description: *Experimental*: Render Portable Text with React Native
Author: Quentin Pavy
Latest version: 1.0.1

# @portabletext/react-native

**Note: Experimental!** Please report issues and feedback.

Render [Portable Text](https://portabletext.org/) with React Native.

Utilizes [@portabletext/react](https://github.com/portabletext/react-portabletext) under the hood, and thus has the exact same API, but will render React Native views instead of HTML.

## Installation

```
npm install --save @portabletext/react-native
```

## Basic usage

```js
import {PortableText} from '@portabletext/react-native'

<PortableText
  value={[/* array of portable text blocks */]}
  components={/* optional object of custom components to use */}
/>
```

## Styling the output

The rendered views has very little or no styling applied, so you will quite often want to pass [custom components](#customizing-components) to override the built-in ones.

## Customizing components

Customizing components are done in the same way as in [@portabletext/react](https://github.com/portabletext/react-portabletext#customizing-components) - see the [README](https://github.com/portabletext/react-portabletext#customizing-components) for more details.

## License

MIT © [Sanity.io](https://www.sanity.io/)
npm package: @qpay-sdk/cli
Description: CLI tool for QPay V2 Payment API — create invoices, check payments, test webhooks
Author: QPay SDK
Latest version: 1.0.0

# qpay-cli

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![npm](https://img.shields.io/npm/v/qpay-cli)](https://www.npmjs.com/package/qpay-cli)

CLI tool for the [QPay V2 Payment API](https://merchant.qpay.mn). Create invoices, check payments, and test webhooks from the terminal.

## Installation

```bash
npm install -g qpay-cli
```

Or use directly with npx:

```bash
npx qpay-cli help
```

## Setup

Configure your QPay merchant credentials:

```bash
qpay setup
```

This saves credentials to `~/.qpay/config.json`. Alternatively, set environment variables:

```bash
export QPAY_BASE_URL=https://merchant.qpay.mn
export QPAY_USERNAME=your_username
export QPAY_PASSWORD=your_password
export QPAY_INVOICE_CODE=your_invoice_code
export QPAY_CALLBACK_URL=https://yoursite.com/webhook
```

## Usage

### Create Invoice

```bash
qpay invoice create --amount 5000 --order ORD-001
qpay invoice create -a 10000 -o ORD-002 --description "Product payment"
qpay invoice create --amount 5000 --json
```

### Check Payment

```bash
qpay payment check INVOICE_ID
qpay payment check INVOICE_ID --json
```

### Cancel Invoice

```bash
qpay invoice cancel INVOICE_ID
```

### Webhook Listener

Start a local webhook listener for testing:

```bash
qpay webhook listen
qpay webhook listen 8080
```

This starts a local HTTP server that:
- Receives QPay webhook callbacks
- Automatically verifies payments via the QPay API
- Logs events to the console with color-coded status
- Provides a web dashboard at `http://localhost:4040`
- Returns event history at `GET /events`

### Configuration

```bash
qpay config          # Show current configuration
qpay setup           # Interactive setup wizard
```

### Sandbox

Use `--sandbox` flag to target the sandbox environment:

```bash
qpay invoice create --amount 100 --sandbox
```

## Commands

| Command | Description |
|---------|-------------|
| `qpay setup` | Interactive credential setup |
| `qpay invoice create` | Create a new invoice |
| `qpay invoice get <id>` | Get invoice details |
| `qpay invoice cancel <id>` | Cancel an invoice |
| `qpay payment check <id>` | Check payment status |
| `qpay webhook listen [port]` | Start webhook listener (default: 4040) |
| `qpay config` | Show current configuration |
| `qpay help` | Show help |
| `qpay version` | Show version |

## Links

- [QPay SDK Documentation](https://qpay-sdk.github.io/qpay-docs/)
- [QPay SDK GitHub](https://github.com/qpay-sdk)
- [qpay-js](https://www.npmjs.com/package/qpay-js) (base SDK)

## License

MIT
npm package: @qpay-sdk/express
Description: QPay V2 payment middleware for Express
Latest version: 1.0.1

# @qpay-sdk/express

[![npm](https://img.shields.io/npm/v/@qpay-sdk/express)](https://www.npmjs.com/package/@qpay-sdk/express)
[![CI](https://github.com/qpay-sdk/qpay-express/actions/workflows/ci.yml/badge.svg)](https://github.com/qpay-sdk/qpay-express/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

QPay V2 payment middleware for Express.

## Install

```bash
npm install @qpay-sdk/express qpay-js
```

## Usage

### Middleware

```typescript
import express from 'express';
import { qpayMiddleware } from '@qpay-sdk/express';

const app = express();
app.use(qpayMiddleware());

app.post('/pay', async (req, res) => {
  const invoice = await req.qpay.createSimpleInvoice({
    invoiceCode: 'YOUR_CODE',
    senderInvoiceNo: 'ORDER-001',
    amount: 10000,
    callbackUrl: 'https://yoursite.com/qpay/webhook',
  });
  res.json(invoice);
});
```

### Pre-built Router

```typescript
import { createQPayRouter } from '@qpay-sdk/express';

app.use('/qpay', createQPayRouter(undefined, {
  onPaymentReceived: (invoiceId, result) => {
    console.log('Payment received:', invoiceId);
  },
}));
```

## License

MIT
npm package: @qpay-sdk/nestjs
Description: QPay V2 payment module for NestJS
Latest version: 1.0.1

# @qpay-sdk/nestjs

[![npm](https://img.shields.io/npm/v/@qpay-sdk/nestjs)](https://www.npmjs.com/package/@qpay-sdk/nestjs)
[![CI](https://github.com/qpay-sdk/qpay-nestjs/actions/workflows/ci.yml/badge.svg)](https://github.com/qpay-sdk/qpay-nestjs/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

QPay V2 payment module for NestJS.

## Install

```bash
npm install @qpay-sdk/nestjs qpay-js
```

## Usage

```typescript
import { QPayModule } from '@qpay-sdk/nestjs';

@Module({
  imports: [
    QPayModule.forRoot({
      baseUrl: 'https://merchant.qpay.mn',
      username: 'your_username',
      password: 'your_password',
      invoiceCode: 'YOUR_CODE',
      callbackUrl: 'https://yoursite.com/qpay/webhook',
    }),
  ],
})
export class AppModule {}
```

### Async Configuration

```typescript
QPayModule.forRootAsync({
  imports: [ConfigModule],
  useFactory: (config: ConfigService) => ({
    baseUrl: config.get('QPAY_BASE_URL'),
    username: config.get('QPAY_USERNAME'),
    password: config.get('QPAY_PASSWORD'),
    invoiceCode: config.get('QPAY_INVOICE_CODE'),
    callbackUrl: config.get('QPAY_CALLBACK_URL'),
  }),
  inject: [ConfigService],
})
```

### Inject Service

```typescript
import { QPayService } from '@qpay-sdk/nestjs';

@Injectable()
export class PaymentService {
  constructor(private readonly qpay: QPayService) {}

  async createPayment() {
    return this.qpay.createSimpleInvoice({
      invoiceCode: 'YOUR_CODE',
      senderInvoiceNo: 'ORDER-001',
      amount: 10000,
      callbackUrl: 'https://yoursite.com/qpay/webhook',
    });
  }
}
```

## License

MIT