coinpayments-ipn

Coinpayments Instant Payment Notification processor.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
coinpayments-ipn
531.0.04 years ago4 years agoMinified + gzip package size for coinpayments-ipn in KB

Readme

Coinpayments-IPN

<img src="https://travis-ci.com/OrahKokos/coinpayments-ipn.svg?branch=master"
alt="build status">
<img src="https://codecov.io/github/OrahKokos/coinpayments-ipn/coverage.svg?branch=master"
alt="code coverage">

alt text Module for verifing Coinpaymets Instant Payment notifications.

Installation

```bash npm install coinpayments-ipn ```

Usage

```javascript / @param {String} hmac @param {String} ipnSecret @param {Object} payload @returns {Boolean} @throws {CoinpaymentsIPNError} / const { verify } = require('coinpaments-ipn'); const CoinpaymentsIPNError = require('coinpaments-ipn/lib/error'); let IsValid, error; try { isValid = verify(hmac, ipnSecret, payload); } catch (e) { error = e; } if (error) { if (error instanceof CoinpaymentsIPNError) {
// handle invalid payload
} // make bug report } if (isValid) { // valid } else { // invalid } ```

Example

A simple docker image can be found here
.