# stripe-errback

> Wrap Stripe.js async methods to use node-style callbacks

Latest version **1.0.2** (published 2016-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install stripe-errback
pnpm add stripe-errback
yarn add stripe-errback
bun add stripe-errback
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-07-30 |
| First published | 2016-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | stripe, browser, stripe.js, node, callback, errback |

## Links

- npm: https://www.npmjs.com/package/stripe-errback
- Repository: https://github.com/bendrucker/stripe-errback
- Homepage: https://github.com/bendrucker/stripe-errback#readme
- Issues: https://github.com/bendrucker/stripe-errback/issues
- npm.io page: https://npm.io/package/stripe-errback

## Dependencies (2)

- [xtend](https://npm.io/package/xtend.md) ~4.0.1
- [dot-prop](https://npm.io/package/dot-prop.md) ~3.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-07-30
- 1.0.1 — 2016-07-30
- 1.0.0 — 2016-07-30

## README

# stripe-errback [![Build Status](https://travis-ci.org/bendrucker/stripe-errback.svg?branch=master)](https://travis-ci.org/bendrucker/stripe-errback)

> Wrap Stripe.js async methods to use node-style callbacks


## Install

```
$ npm install --save stripe-errback
```


## Usage

```js
var stripeErrback = require('stripe-errback')

var stripe = stripeErrback(window.Stripe)

stripe.card.createToken(data, params, function (err, data) {
  if (err) { /* console.error(err) */ }
  else { /* token = data.id... */ }
})
```

## API

#### `stripeErrback(Stripe)` -> `object`

Wraps `window.Stripe` to call a Node-style callback (`function (err, data)`) with results instead of using Stripe's `function (status, response)` functions.

##### Stripe

*Required*  
Type: `function`

The Stripe.js browser library (`window.Stripe`).

The returned object wraps the following methods in addition to exposing utility methods:

* [`card.createToken`](https://stripe.com/docs/stripe.js#card-createToken)
* [`bankAccount.createToken`](https://stripe.com/docs/stripe.js#bank-account-createToken)
* [`piiData.createToken`](https://stripe.com/docs/stripe.js?#pii-data-createToken)
* [`bitcoinReceiver.createReceiver`](https://stripe.com/docs/stripe.js#bitcoinreceiver-createreceiver)
* [`bitcoinReceiver.pollReceiver`](https://stripe.com/docs/stripe.js#bitcoinreceiver-pollreceiver)
* `bitcoinReceiver.getReceiver` (undocumented)

This configuration is exposed as `stripeErrback.methods` with `{async, sync}` containing arrays of dot property paths.

## License

MIT © [Ben Drucker](http://bendrucker.me)

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