stripe-errback

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

stripe-errback

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

Install

$ npm install --save stripe-errback

Usage

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.Stripeto 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:

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

License

MIT © Ben Drucker

Repository

bendrucker/stripe-errback


上一篇:grunt-http-download
下一篇:stripe-as-promised

相关推荐

  • stripe-debug

    npm install for Stripe.js — for testing only stripedebug for Stripe.js — for testing only. Downlo...

    14 天前
  • stripe-dat

    track stripe charges via dat stripedat track stripe charges via dat npmnpmimagenpmurl travistrav...

    8 个月前
  • stripe-cohort

    Query Stripe customers by cohort stripecohort Create Stripe(https://stripe.com) customer cohor...

    4 个月前
  • stripe-charges

    Query Stripe charges stripecharges A Stripe(https://stripe.com) charges API for node get a t...

    4 个月前
  • stripe-as-promised

    Wrap Stripe.js async methods to return promises stripeaspromised Build Status(https://travisci.org...

    14 天前
  • stripe

    Stripe API wrapper Stripe Node.js Library Version(https://img.shields.io/npm/v/stripe.svg)(https:...

    1 年前
  • eslint-config-stripe

    Stripe's ESLint config eslintconfigstripe This package provides Stripe's .eslintrc as an extensib...

    2 年前
  • dashboards-stripe-subscriptions

    Stripe subscriptions plugin for segmentio/dashboards dashboardsstripesubscriptions A Stripe(http...

    5 个月前
  • dashboards-stripe-charges

    Stripe charges plugin for segmentio/dashboards dashboardsstripecharges A Stripe(https://stripe.c...

    5 个月前
  • angular-stripe

    Angular service provider for interacting with Stripe angularstripe Build Status(https://travisci.or...

    2 年前

官方社区

扫码加入 JavaScript 社区