2.1.0 • Published 7 years ago

hipay v2.1.0

Weekly downloads
18
License
MIT
Repository
github
Last release
7 years ago

HiPay SDK

Library that enables you to interact with the Gateway and the Tokenization HiPay APIs.

Notes:

  • This package respects the semver and the keep a changelog specifications.
  • Every asynchronous methods can be used with async/await ES7 features, generators, or promises.
  • Every methods listed but not specified here fit the HiPay specifications, so please refer to their documentation to know exactly how to provide them.

Install

npm i hipay

Available Methods

Hipay#init(credentials)

const credentials = {
  username: String, // (required)
  password: String, // (required)
  passphrase: String,
  mod: String // production || test (default: test)
};

Hipay#order(order)

Hipay#capture(transaction)

Hipay#refund(transaction)

Hipay#cancel(transaction)

Hipay#getFormUrl(order)

Hipay#getTransactionDetails(source)

const source = {
  transactionId: String
};

Or

const source = {
  orderId: String
};

Hipay#getTokenDetails(data)

Hipay#createToken(card)

Hipay#updateToken(data)

Hipay#isCallbackSignatureValid(query)

Hipay#isNotifySignatureValid(rawBody, receivedHash)

Example

const bodyParser = require('body-parser');
const hipay = require('hipay');
const server = require('express')();

hipay.init({
  username: 'john',
  password: 'shhhh',
  passphrase: 'secret',
  mod: 'test'
});

server.use(bodyParser.json());

server.post('/order', async (req, res) => {
  try {
    const hipayResponse = await hipay.order(req.body);

    res.send(hipayResponse);
  } catch(e) {
    res.status(500).send(e);
  }
});

server.listen(3000);
2.1.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago