khipujs

1.0.1 • Public • Published

Khipu NodeJs

Complete documentation

This library is an implementation made in javascript of the Khipu API, it is incomplete and only contemplates functionalities that will be used by banks and payments, if you want to add the rest, do it without problems.

Support Version

Current support Khipu API version 2.0

Install

Npm:

npm install --save khipujs

Yarn:

yarn add khipujs

Getting started

Authenticate with your Commerce ID Key, and Secret Key

Make sure you have created your free account on Khipu and that you have your Credentials.

import Khipu from 'khipu'
 
const khipu = new Khipu({
  commerceId: 'COMMERCE_ID',
  secretKey: 'YOUR_SECRET_KEY'
})

Payments

Payments with notification token

khipu.payments
  .withNotificationToken({
    notification_token: 'string'
  })
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Create payment

khipu.payments
  .create({
    subject: 'First Product',
    currency: 'CLP',
    amount: '1000'
  })
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Read payment

khipu.payments
  .read(paymentId)
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Delete payment

khipu.payments
  .delete(paymentId)
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Banks

list banks

khipu.banks
  .list()
  .then(response => {})
  .catch(error => console.log(error)) // Handle the error.

Readme

Keywords

Package Sidebar

Install

npm i khipujs

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

6.1 kB

Total Files

9

Last publish

Collaborators

  • siturra