# mxbitcore-payment-protocol

> Payment Protocol (BIP70 and related) support for bitcore

Latest version **8.0.1** (published 2019-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install mxbitcore-payment-protocol
pnpm add mxbitcore-payment-protocol
yarn add mxbitcore-payment-protocol
bun add mxbitcore-payment-protocol
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score; declining downloads.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2019-04-21 |
| First published | 2019-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 364.9 KB |
| Known vulnerabilities | 0 (+21 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 36 |
| Author | BitPay |
| Maintainers | matrixbit |
| Keywords | bitcoin, bitcore, payment protocol, BIP70 |

## Links

- npm: https://www.npmjs.com/package/mxbitcore-payment-protocol
- Repository: https://github.com/bitpay/bitcore-payment-protocol
- Homepage: https://github.com/bitpay/bitcore-payment-protocol#readme
- Issues: https://github.com/bitpay/bitcore-payment-protocol/issues
- npm.io page: https://npm.io/package/mxbitcore-payment-protocol

## Dependencies (7)

- [bs58](https://npm.io/package/bs58.md) ^4.0.1
- [asn1.js](https://npm.io/package/asn1.js.md) ^5.0.1
- [jsrsasign](https://npm.io/package/jsrsasign.md) ^8.0.12
- [protobufjs](https://npm.io/package/protobufjs.md) =5.0.3
- [bitcore-lib](https://npm.io/package/bitcore-lib.md) ^8.0.0
- [asn1.js-rfc3280](https://npm.io/package/asn1.js-rfc3280.md) ^4.0.0
- [asn1.js-rfc5280](https://npm.io/package/asn1.js-rfc5280.md) ^3.0.0

## Recent versions

- 8.0.1 (latest) — 2019-04-21
- 8.0.0-beta-0 (beta) — 2019-02-19
- 8.0.0-beta-5 — 2019-03-16
- 8.0.0-beta-4 — 2019-03-16
- 8.0.0-beta-3 — 2019-03-09
- 8.0.0-beta-2 — 2019-03-09
- 8.0.0-beta-1 — 2019-03-09

## README

Bitcore Payment Protocol
=======

[![NPM Package](https://img.shields.io/npm/v/bitcore-payment-protocol.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-payment-protocol)
[![Build Status](https://img.shields.io/travis/bitpay/bitcore-payment-protocol.svg?branch=master&style=flat-square)](https://travis-ci.org/bitpay/bitcore-payment-protocol)
[![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-payment-protocol.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-payment-protocol)

A module for [bitcore](https://github.com/bitpay/bitcore) that implements [Payment Protocol](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) and other related BIPs.

## Getting Started

This library is distributed in both the npm  packaging systems.

```sh
npm install bitcore-lib
npm install bitcore-payment-protocol
```


There are many examples of how to use it on the developer guide [section for payment protocol](https://bitcore.io/api/paypro). For example, the following code would verify a payment request:

```javascript
var PaymentProtocol = require('bitcore-payment-protocol');

var body = PaymentProtocol.PaymentRequest.decode(rawbody);
var request = new PaymentProtocol().makePaymentRequest(body);

var version = pr.get('payment_details_version');
var pki_type = pr.get('pki_type');
var pki_data = pr.get('pki_data');
var serializedDetails = pr.get('serialized_payment_details');
var signature = pr.get('signature');

// Verify the signature
var verified = request.verify();
```

## Contributing

See [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo for information about how to contribute.

## License

Code released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).

Copyright 2013-2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.

---
_Source: https://npm.io/package/mxbitcore-payment-protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
