Socket
Book a DemoInstallSign in
Socket

coinpayments-ipn

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinpayments-ipn

Coinpayments Instant Payment Notification processor.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
493
45%
Maintainers
1
Weekly downloads
 
Created
Source

Coinpayments-IPN

build status code coverage

alt text

Module for verifing Coinpaymets Instant Payment notifications.

Installation

npm install coinpayments-ipn

Usage

/**
 *
 * @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.

FAQs

Package last updated on 09 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.