open-index/open-npm huggingface dataset:
npm package: @payfonte/payfonte-react
Description: This is an reactJS library for implementing payfonte payment checkout
Author: Chikezie Joachim
Latest version: 0.0.7

# payfonte-react

[![Publish](https://github.com/chuddyjoachim/payfonte-react/actions/workflows/publish.yml/badge.svg)](https://github.com/chuddyjoachim/payfonte-react/actions/workflows/publish.yml)

<div>
    <img src='./test-usd.png' alt='payfonte-usd' />
    <img src='./test-ngn.png' alt='payfonte-ngn' />
</div>

A React library that provides a reusable react hook for integrating with the Payfusion checkout system. <br/>
This hook allows you to easily accept payment by invoking its **handlePayfontePayment** method returned from the **usePayfonte** hook provides the accurate args are passed to the method.


## Installation

You can install `@payfonte/payfonte-react` using npm:

```bash
npm install @payfonte/payfonte-react
```

## Usage

1. Import the `usePayfonte` hook:
```jsx
import React from 'react';
import { usePayfonte, PayfontePaymentProps } from '@payfonte/payfonte-react'
```

2. Create your `onSuccess`, and `onClose` callback functions to be passed when hooks is initialised:

```jsx
function onSuccess(data: any) {
  console.log(data);
}

function onClose() {
  console.log("payfonte modal closed");
}
```

3. Initialize usePayfonte hook - handlePayfontePayment
```jsx
  const { handlePayfontePayment, isPaymentLoading } = usePayfonte({
    isProduction: false, // can be true of false
    onClose,
    onSuccess
    clientId: 'payfusion', // required, Your client-id 
  })
```

4. configure payment config props to be passed to handlePayfontePayment
```jsx
    const config: PayfontePaymentProps = {
    amount: 1000, // amount * 100 - amount in lowest currency denomination e.g  kobo for naira, cents for dollars - 1000/100 = 10
    currency: 'NGN', //NGN, XOF, XAF, USD e.t.c depends on the currency the client provided
    reference: `${Date.now()}`, //if you have your own transactionId you want to track this payment with
    user: {
      email: 'email@example.com',
      name: 'John Doe',
      phoneNumber: '+XXX XXXX XXXXX'
    },// required - user object
    metadata: {} // optional - your data that will come back with the event
  }
```

4. Makepayment - pass config above to handlePayfontePayment method
```jsx
    return (
    <>
      <p>
        {isPaymentLoading ? 'Payment initiated' : 'Payment not initiated'}
      </p>
      <button onClick={() => handlePayfontePayment(config)}>Pay 10 NGN</button>
    </>
  )
```
npm package: @payforpress/payforpress-node-sdk
Description: Official Node.js Server SDK for PayForPress API - An onboarding, paywall and payment solution for online media
Author: PayForPress
Latest version: 1.0.0

# PayForPress Node.js SDK

Official Node.js SDK for PayForPress API - An onboarding, paywall and payment solution for online media.

## Installation

```bash
npm install payforpress-node-sdk
```

## Quick Start

```typescript
import { PayForPress } from 'payforpress-node-sdk';

// Initialize the SDK with your API key
const pfp = new PayForPress({
	apiKey: 'your-api-key-here'
});

// Example: Get user information
async function getUser() {
	try {
		const user = await pfp.users.get({ email: 'user@example.com' });
		console.log('User:', user);
	} catch (error) {
		console.error('Error:', error);
	}
}
```

## Features

- User Management
- Article Management
- Payment Processing
- Analytics
- Appearance Settings
- Targeting Rules
- Organization Settings

## API Documentation

For detailed API documentation, please visit our [API Documentation](https://payforpress.gitbook.io/payforpress/api-pfp-connect/api-pfp-connect).

## Security

This SDK is designed to be used on the server-side only. Never expose your API key in client-side code.

## License

MIT
npm package: @payfun/node-kong
Description: ## Install
Author: xujiantong
Latest version: 2.4.0

# node-kong

## Install

```bash
 npm i @payfun/node-kong
```

## How to Use?

### Step1 配置Kong Option

#### Example

```javascript
const KongOption = {
    KongHOST: '<Kong URL>',
    service: {
        name: '<Service Name>',
        protocol: 'http',
        port: 80,
        connect_timeout: 60000,
        write_timeout: 60000,
        host: '<upstream name>'
    },
    route: {
        name: '<route name>',
        hosts: ['a.b.com'],
        // paths: ['/xxx/(?i)'],
        methods: ['POST', 'GET', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'TRACE', 'CONNECT'],
        protocols: ['http', 'https'],
        service: {name: '<service name>'},
        https_redirect_status_code: 302
    },
    upstream: {
        name: '<upstream name>',
        'healthchecks': {
            'active': {
                'https_verify_certificate': true,
                'unhealthy': {
                    'http_statuses': [429, 404, 500, 501, 502, 503, 504, 505],
                    'tcp_failures': 0,
                    'timeouts': 0,
                    'http_failures': 0,
                    'interval': 0
                },
                'http_path': '<checkHealth path>',
                'timeout': 1,
                'healthy': {
                    'http_statuses': [200, 302],
                    'interval': 0,
                    'successes': 0
                },
                'concurrency': 10,
                'type': 'http'
            },
            'passive': {
                'unhealthy': {
                    'http_failures': 0,
                    'http_statuses': [429, 500, 503],
                    'tcp_failures': 0,
                    'timeouts': 0
                },
                'type': 'http',
                'healthy': {
                    'successes': 0,
                    'http_statuses': [200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308]
                }
            },
            'threshold': 0
        }
    },
    target: {
        target: '<target url:port>',
        weight: 100,
        upstream: ''
    }
}
```

### Step2 Register

```javascript

const {KongRegister} = require('@payfun/node-kong')
KongRegister(KongOption)

```

> 官网API
https://docs.konghq.com/gateway-oss/1.1.x/admin-api/
npm package: @payfunc/cli
Description: PayFunc command line interface.
Author: PayFunc
Latest version: 0.0.45

# PayFunc CLI
Command line interface for PayFunc.

# Installing
Install using NPM in the global scope:
```
npm install -g @payfunc/cli
```

# Usage
Assuming that the `payfunc` command is installed in your path as done above.
## Version
To learn which version you have installed use:
```
payfunc version
```
## Help 
### List Modules
To get an index of all help commands:
```
payfunc help
```
### Module Help
Help for a specific module can be gotten by:
```
payfunc help <module>
```
### Command Help
```
payfunc help <module> <command>
```
## Server
### Add Server
#### Adding a Server
```
payfunc server add <name> <private key> <public key>
```
#### With Admin User and Password
```
payfunc server add <name> <private key> <public key> <admin> <password>
```
#### Storage
Added servers are stored in the `~/.payfunc` directory in cleartext.

### List Server
```
payfunc server list
```
### Using Server
To use a particular server use the `--server` flag:
```
payfunc --server <server name> <module> <command> <...arguments>
```
### Default Server
The server with the name `default` is used by default when no `--server` flag is used.

### Env Server
The server name `env` is reserved and when used the following enviroment variables are used for server credentials:
- `privateKey`
- `publicKey`
-	`adminUser`
- `adminPassword`

### Local debugging
Additional Env servers can be added to a .env file for use when debugging in a local clone of this repository. Each server require a private and a public key and should be saved in the key name format: `privateKey<PascalCaseServerName>`

Example of a .env file with an additional server named `localOnly` (notice the upper case on first letter of servers in key names):
```
privateKey = EyJheader.EyJpayloadDefault1.signatureXYz
publicKey = EyJheader.EyJpayloadDefault2.signatureYZa
privateKeyLocalOnly = EyJheader.EyJpayload1.signatureXYz
publicKeyLocalOnly = EyJheader.EyJpayload2.signatureYZa
```

To run locally you can run the command:
```
node dist/run.js
```
To run all default card related tests:
```
node dist/run.js test
```
To run the same on the `localOnly` server defined above:
```
node dist/run.js -s localOnly test
```
To also continuously update the code as you are debugging, add `npm run build &&`:
```
npm run build && node dist/run.js test
```
or
```
npm run build && node dist/run.js -s localOnly test
```

### URL Override
By default server keys provide the url used to connect to the server. If you would prefer to override the url used to connect to the server use the `--url` flag:
```
payfunc --url <url> <module> <command> <...arguments>
```
npm package: @payfunc/cli-card
Description: PayFunc command line interface for tokenizing.
Author: PayFunc
Latest version: 0.1.17

# PayFunc Card Tokenizing CLI
Command line interface for PayFunc Card Tokenizing.

# Installing
Install using NPM in the global scope:
```
npm install -g @payfunc/cli-card
```

# Usage
Assuming that the `payfunc-card` command is installed in your path as done above.
## Version
To learn which version you have installed use:
```
payfunc-card version
```
## Help 
### List Modules
To get an index of all help commands:
```
payfunc-card help
```
### Module Help
Help for a specific module can be gotten by:
```
payfunc-card help <module>
```
### Command Help
```
payfunc-card help <module> <command>
```
## Server
### Add Server
#### Adding a Server
```
payfunc-card server add <name> <private key> <public key>
```
#### With Admin User and Password
```
payfunc-card server add <name> <private key> <public key> <admin> <password>
```
#### Storage
Added servers are stored in the `~/.payfunc-card` directory in cleartext.

### List Server
```
payfunc-card server list
```
### Using Server
To use a particular server use the `--server` flag:
```
payfunc-card --server <server name> <module> <command> <...arguments>
```
### Default Server
The server with the name `default` is used by default when no `--server` flag is used.

### Env Server
The server name `env` is reserved and when used the following enviroment variables are used for server credentials:
- `privateKey`
- `publicKey`
-	`adminUser`
- `adminPassword`

### URL Override
To override the URL used to connect to the server use the `--url` flag:
```
payfunc-card --url <url> <module> <command> <...arguments>
```

## Authorization
### Create
To create an authorization use:
```
payfunc-card authorization create <amount> <currency> <pan> <expires> <pares>
```
## Test
### All Tests
To run all tests invoce:
```
payfunc-card test
```
### Standard
A test that runs a standard authorization 
```
payfunc-card test standard
```
### Cancel
```
payfunc-card test cancel
```