Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivyhjk/khipu-client-nodejs
Khipu Client NodeJS (non official client)
https://github.com/ivyhjk/khipu-client-nodejs
khipu khipu-client nodejs payment payment-gateway typescript
Last synced: about 2 months ago
JSON representation
Khipu Client NodeJS (non official client)
- Host: GitHub
- URL: https://github.com/ivyhjk/khipu-client-nodejs
- Owner: ivyhjk
- License: mit
- Created: 2020-01-28T02:27:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-14T15:42:30.000Z (about 2 months ago)
- Last Synced: 2024-11-14T16:38:07.173Z (about 2 months ago)
- Topics: khipu, khipu-client, nodejs, payment, payment-gateway, typescript
- Language: TypeScript
- Homepage:
- Size: 4.12 MB
- Stars: 4
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Khipu Client NodeJS
A [NodeJS](https://nodejs.org) client for [Khipu](https://khipu.com) (non official).
## Installation
with NPM:
```
npm install --save khipu-client
```with Yarn:
```
yarn add khipu-client
```## Examples
- [khipu-client-nodejs-example](https://github.com/ivyhjk/khipu-client-nodejs-example#readme)
## Usage
Generate a new client to make requests:
```typescript
import { Client } from 'khipu-cliet';const client = new Client({
receiverId: 'YOUR_RECEIVER_IDENTIFIER_HERE',
secret: 'YOUR_SECRET_HERE'
});
```### Get banks
```typescript
// ...
const response = await client.getBanks();
```### Create a payment
```typescript
// ...
const response = await client.createPayment({
subject: 'a payment',
currency: 'CLP',
amount: 1000,
// ...
});
```### Delete a payment
```typescript
// ...
const response = await client.deletePayment('the-payment-id');
```### Confirm a payment
```typescript
// ...
const response = await client.confirmPayment('the-payment-id');
```### Get a payment by notification token
```typescript
// ...
const response = await client.getPaymentByNotificationToken(
'the-notification-token'
);
```### Create a receiver
```typescript
// ...
const response = await client.createReceiver({
admin_first_name: '...',
admin_last_name: '...',
admin_email: '...',
country_code: '...',
business_identifier: '...',
business_category: '...',
business_name: '...',
business_phone: '...',
business_address_line_1: '...',
business_address_line_2: '...',
business_address_line_3: '...',
contact_full_name: '...',
contact_job_title: '...',
contact_email: '...',
contact_phone: '...',
// ...
});
```