Giter VIP home page Giter VIP logo

feathers-stripe's Introduction

feathers-stripe

CI Dependency Status Download Status Discord

A Feathers service for Stripe

Installation

npm install stripe@^13 feathers-stripe --save

Documentation

Please refer to the Stripe API Docs and the stripe-node docs for options that can be passed. Feathers service methods map to the following Stripe methods:

  • Feathers find -> Stripe list
  • Feathers get -> Stripe retrieve
  • Feathers create -> Stripe create
  • Feathers update -> Stripe update
  • Feathers patch -> Stripe update (in most cases). Some special cases include paying an invoice or an order when you pass {pay: true} as part of context.data. See each service's code for more info.
  • Feathers remove -> Stripe del (in most cases). Some special cases include transfers and charges create a reversal/refund. See each service's code for more info.

If a method is not supported by Stripe for a given resource it is not supported here as well.

Use params.stripe to pass additional parameters like expand, idempotencyKey, apiVersion, etc to the underlying Stripe methods.

Many methods support/require passing special properties to context.data and context.query to better inform the underlying stripe methods. You are encouraged to read the source code for each service to better understand their usage. For example, the Card service requires a customer to be provided.

const card = await app.service("stripe/cards").create({
  customer: "cust_123",
  source: { token: "tok_123" }
});
// stripe.customers.createSource(customer, { source: { ... } });

const card = await app.service("stripe/cards").get("card_123", {
  query: { customer: "cust_123" }
});
// stripe.customers.retrieveSource(query.customer, id);

Available Services

The following services are supported and map to the appropriate Stripe resource:

  • AccountLinks
  • Account
  • ApplicationFeeRefund
  • Balance
  • BankAccount
  • Card
  • Charge
  • Coupon
  • Customer
  • Dispute
  • Event
  • ExternalAccount
  • InvoiceItem
  • Invoice
  • PaymentIntent
  • PaymentMethod
  • Payout
  • Plan
  • Price
  • Product
  • Recipient
  • Refund
  • SetupIntent
  • Source
  • SubscriptionItem
  • Subscription
  • Token
  • Transaction
  • TransferReversal
  • Transfer
  • Webhook

This is pretty important! Since this connects to your Stripe account you want to make sure that you don't expose these endpoints via your app unless the user has the appropriate permissions. You can prevent any external access by doing this:

import { Forbidden } from "@feathersjs/errors";

app.service("stripe/cards").hooks({
  before: {
    all: [
      (context) => {
        if (context.params.provider) {
          throw new Forbidden("You are not allowed to access this");
        }
      }
    ]
  }
});

This is pretty important! You are also encouraged to use some kind of rate limiter. Checkout the Stripe Rate Limit Docs

import Bottleneck from 'bottleneck';

// Configure 100 reqs/second for production, 25 for test mode
const readLimiter = new Bottleneck({ minTime: 10 });
const writeLimiter = new Bottleneck({ minTime: 10 });
// const readLimiter = new Bottleneck({ minTime: 40 });
// const writeLimiter = new Bottleneck({ minTime: 40 });

const rateLimitHook = async (context) => {
  const limiter = context.method === 'find' || context.method === 'get'
    ? readLimiter
    : writeLimiter;

  context.result = await limiter.schedule(() => {
    // Use an underscored method to bypass hooks and not end
    // up in an infinite loop hitting this hook again.
    if (context.method === 'find') {
      return context.service._find(context.params);
    }
    if (context.method === 'get') {
      return context.service._get(context.id, context.params);
    }
    if (context.method === 'create') {
      return context.service._create(context.data, context.params);
    }
    if (context.method === 'update') {
      return context.service._update(context.id, context.data, context.params);
    }
    if (context.method === 'patch') {
      return context.service._patch(context.id, context.data, context.params);
    }
    if (context.method === 'remove') {
      return context.service._remove(context.id context.params);
    }
  });

  return context;
}

// The rateLimitHook should be the last before hook for each method.
app.service('stripe/cards').hooks({
  before: {
    find: [ ...hooks, rateLimitHook],
    get: [ ...hooks, rateLimitHook],
    create: [ ...hooks, rateLimitHook],
    update: [ ...hooks, rateLimitHook],
    patch: [ ...hooks, rateLimitHook],
    remove: [ ...hooks, rateLimitHook],
  }
});

Complete Example

Here's an example of a Feathers server that uses feathers-authentication for local auth. It includes a users service that uses feathers-mongoose. Note that it does NOT implement any authorization.

import { feathers } from "@feathersjs/feathers";
import express from "@feathersjs/express";
import socketio from "@feathersjs/socketio";
import Stripe from 'stripe';
import { ChargeService } from "feathers-stripe";

// Initialize the application
const app = feathers()
  .configure(express.rest())
  .configure(socketio())
  // Needed for parsing bodies (login)
  .use(express.json())
  .use(express.urlencoded({ extended: true }))
  // A simple Message service that we can used for testing
  .use(
    "/stripe/charges",
    new ChargeService({ stripe: new Stripe('sk_test_...') })
  )
  .use("/", feathers.static(__dirname + "/public"))
  .use(express.errorHandler({ html: false }));

const validateCharge = () => (hook) => {
  console.log("Validating charge code goes here");
};

const chargeService = app.service("stripe/charges");

chargeService.hooks({
  before: {
    create: [validateCharge()]
  }
});

const charge = {
  amount: 400,
  currency: "cad",
  source: "tok_87rau6axWXeqLq", // obtained with Stripe.js
  description: "Charge for [email protected]"
};

chargeService
  .create(charge)
  .then((result) => {
    console.log("Charge created", result);
  })
  .catch((error) => {
    console.log("Error creating charge", error);
  });

app.listen(3030);

console.log("Feathers authentication app started on 127.0.0.1:3030");

Webhook

You can setup a webhook using the helper function setupWebhook in your service

export default function (app) {
  setupWebhook(app, "/stripe-webhook", {
    endpointSecret: "whsec_ededqwdwqdqwdqwd778qwdwqdq",
    stripe: new Stripe("sk_test_..."),
    handlers: {
      customer: {
        subscription: {
          async created({ object, event, params, app }) {
            return {};
          }
        }
      }
    }
  });

  // Get our initialized service so that we can register hooks
  const service = app.service("stripe-webhook");

  service.hooks(hooks);
}

License

Licensed under the MIT license.

feathers-stripe's People

Contributors

adamvr avatar bedeoverend avatar corymsmith avatar daddywarbucks avatar daffl avatar ekryski avatar emmanuelgeoffray avatar ericirish avatar fazilvp avatar fmoessle avatar fratzinger avatar greenkeeper[bot] avatar jordan-mcrae avatar marshallswain avatar mrfrase3 avatar regmish avatar shakir-abdo avatar thenoim avatar wdmtech avatar ydeshayes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

feathers-stripe's Issues

Can't pass params to .remove calls

Hey @daffl

Only one parameter is accepted in .remove(id) calls.
This of course means I have to use the services' Stripe object directly (which is fine for now!)

For instance, I want to write the following:

subscriptionsService.remove(subscription.id, { at_period_end: true })

But instead, I have to write:

subscriptionsService.stripe.subscriptions.del(subscription.id, { at_period_end: true })

Example of a .remove call that only accepts an id with no params

https://github.com/feathersjs-ecosystem/feathers-stripe/blob/master/lib/services/subscription.js#L28

I'm happy to send a PR if you think this should be added.

Cheers πŸ˜€

An in-range update of stripe is breaking the build 🚨

The dependency stripe was updated from 7.10.0 to 7.11.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for stripe-node v7.11.0
  • #719 Define 'type' as a property on errors rather than a getter
  • #709 README: imply context of stripe-node
  • #717 Contributor Convenant

See the changelog for more details.

Commits

The new version differs by 7 commits.

  • 60e1520 Bump version to 7.11.0
  • 748411e Merge pull request #719 from stripe/richardm-type-property
  • 7ff0dd1 Merge pull request #709 from dcousens/patch-1
  • 808d9ad Define 'type' as a property on errors rather than a getter
  • db4dde7 Merge pull request #717 from stripe/code-of-conduct
  • bc9c915 Contributor Convenant
  • 20bd1a1 README: imply context of stripe-node

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of stripe is breaking the build 🚨

Version 4.23.1 of stripe just got published.

Branch Build failing 🚨
Dependency stripe
Current Version 4.23.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

  • ddf10e4 Bump version to 4.23.1
  • 78dc35d Merge pull request #357 from stripe/jlomas-upcoming-subscription-items-encoding
  • 037754d Add utils.arrayToObject() to retrieveUpcoming() for subscription_items

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Missing AccountLinks

Steps to reproduce

  1. yarn add feathers-stripe
  2. Use AccountLinks

Expected behavior

AccountLinks should be an exported service.

Actual behavior

After installing feathers-stripe, it looks like AccountLinks service is not available. On investigating the module installed, it is version 0.10.1, however is completely missing the account-links.js file.

System configuration

  1. Using yarn

Here is a list of the services available:

Screen Shot 2020-08-26 at 12 01 54 PM

Export errorHandler

What are others thoughts about exporting the error handler?

I am building additional services on top of feathers-stripe - for beta features like stripe identity and would like to handle errors in the same way as feathers-stripe.

I think it would give people more flexibility to build there own services auxiliary to feathers-stripe. Would the maintainers be up for it if I put up a PR?

Also happy to write a service for Stripe Identity if interested!

Underscored Methods

I would like to see this package export services with underscored methods, similar to all DB adapters starting in V5. This is something I can handle if no one has any objections.

Underscored Methods

I would like to see this package export services with underscored methods, similar to all DB adapters starting in V5. This is something I can handle if no one has any objections.

I accidentally opened this issue under a different user. So i closed that one and re-opened under my main GitHub account.

An in-range update of stripe is breaking the build 🚨

The dependency stripe was updated from 6.17.0 to 6.18.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for stripe-node v6.18.0
  • #530 Export errors on root Stripe object

See the changelog for more details.

Commits

The new version differs by 3 commits.

  • b128a28 Bump version to 6.18.0
  • b7c3c8d Merge pull request #530 from stripe/ob-export-errors
  • 1aacc66 Export errors on root Stripe object

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 3.2.0 of debug was just published.

Branch Build failing 🚨
Dependency debug
Current Version 3.1.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

debug is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes 3.2.0

A long-awaited release to debug is available now: 3.2.0.

Due to the delay in release and the number of changes made (including bumping dependencies in order to mitigate vulnerabilities), it is highly recommended maintainers update to the latest package version and test thoroughly.


Minor Changes

Patches

Credits

Huge thanks to @DanielRuf, @EirikBirkeland, @KyleStay, @Qix-, @abenhamdine, @alexey-pelykh, @DiegoRBaquero, @febbraro, @kwolfy, and @TooTallNate for their help!

Commits

The new version differs by 25 commits.

There are 25 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add $ query parameters

Stripe uses some similar query params as the feathers defaults, but without the $. For example,

{
  created: { gt: 123144213 }
}

{
  created: { $gt: 123144213 }
}

Add a cleanQuery method that strips any $ from keys. This method should not try to "map" keys to "valid" keys with filters, operators, whitelist, etc. That is too much of a moving target for a provider (instead of a database) IMHO. Instead, let the developer use $ keys, if the converted key (key without $) is not valid then stripe will throw an error.

Add "auto" pagination

Stripe offers a couple of ways to paginate results. See: https://github.com/stripe/stripe-node#auto-pagination

The autoPagingToArray method seems most analogous to how feathers handles { paginate: false }; This should be relatively straight forward to add to most/all of our .list() methods inside a feathers find()

Side Note
This syntax really tripped me up when I saw it in a project. The stripe node library is using some kind of iterator or proxy to allow this kind of syntax for fetching all records.

for await (const customer of stripe.customers.list()) {
  doSomething(customer);
  if (shouldStop()) {
    break;
  }
}

Allow query to be passed to `Balance` service

The Balance service's methods do not pass any params to the underlying stripe methods, as seen here:

// NOTE (EK): Stripe doesn't accept params for this method

But, the stripe.balance method does actually accept query parameters, specifically stripe_account. When fetching a balance without providing a stripe_account, the balance of the account holding the keys is returned. But, when using Stripe Connect, we can manage other accounts and need to be able to fetch their balance.

You can see an example of this working here: https://github.com/stripe/stripe-connect-rocketrides/blob/897716cae8130f76254a71f6d1258c6b6f85dbc9/server/routes/pilots/pilots.js#L33

I propose that the Balance service's get and find methods pass params.query to the underlying stripe method.

An in-range update of @feathersjs/errors is breaking the build 🚨

The dependency @feathersjs/errors was updated from 4.3.10 to 4.3.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/errors is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.3.11

4.3.11 (2019-11-11)

Bug Fixes

  • authentication: Retain object references in authenticate hook (#1675) (e1939be)
  • authentication-oauth: Allow hash based redirects (#1676) (ffe7cf3)
Commits

The new version differs by 7 commits.

  • 2d95bfd chore(release): publish v4.3.11
  • 079937c chore(package): Add npm funding field (#1678)
  • ffe7cf3 fix(authentication-oauth): Allow hash based redirects (#1676)
  • e1939be fix(authentication): Retain object references in authenticate hook (#1675)
  • 1ebc58e chore(package): update @types/config to version 0.0.36 (#1669)
  • 43c654c Add GitHub sponsorship
  • b0f5653 chore: Update version and changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel-core is breaking the build 🚨

Version 6.25.0 of babel-core just got published.

Branch Build failing 🚨
Dependency babel-core
Current Version 6.24.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-core is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

No example with Feathers CLI generated code

Expected behavior

There has to be some example that shows how to implement stripe with CLI generated code.

Actual behavior

The example shown is difficult to use in the feathers CLI generated code.

needs some basic usage docs ;)

From https://github.com/feathersjs/feathers-stripe/blob/master/src/index.js I gather you could do:

import { card as Card, charge as Charge, customer as Customer, plan as Plan} from 'feathers-stripe'

In order to get started... each service takes an apiKey options:

const stripeCard = new Card({apiKey: 'xxxxxxx');

To use, see Stripe API. Each class is just a CRUD entity with basic stripe attributes.

An in-range update of @feathersjs/socketio is breaking the build 🚨

The devDependency @feathersjs/socketio was updated from 3.2.6 to 3.2.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/socketio is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 15 commits.

  • 55de15e Publish
  • f706db3 fix: Compare socket event data using lodash's isEqual instead of indexOf (#1061)
  • ef46002 Use Node 10 in CI for now (#1072)
  • 8a564f7 fix: Only merge authenticated property on update
  • 1356a1c feat: @feathers/cli: introduce option to choose jest for tests instead of mocha (#1057)
  • c6e7e63 Update feathers-knex in group default to the latest version πŸš€ (#1058)
  • 9974803 fix: Make Mocha a proper devDependency for every repository (#1053)
  • 7ecc6a7 Use linked instead of top level Mocha (#1051)
  • ce49822 Publish
  • 4f9acd6 fix: Catch connection initialization errors (#1043)
  • 0275722 Allow case-insensitive for email (username) (#1041)
  • 815ffe6 Publish
  • c8b27d0 feat: Added generators for feathers-objection & feathers-cassandra (#1010)
  • 74b31df fix: More robust parsing of mongodb connection string. Use new url parser. (#1002)
  • 8c2e49a build: Do not run client tests on pull requests (#1018)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @feathersjs/feathers is breaking the build 🚨

The devDependency @feathersjs/feathers was updated from 4.5.0 to 4.5.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/feathers is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.5.1

4.5.1 (2020-01-24)

Note: Version bump only for package feathers

Commits

The new version differs by 3 commits.

  • df79afe chore(release): publish v4.5.1
  • c200ae3 Update all dependencies and fix EventEmitter TypeScript import (#1793)
  • 6dec664 chore: Update version and changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add subscription service

Just after a subscriptions service to subscribe a given customer to a plan. I'm working on a PR for it - but the problem with the subscription is that it needs a customer ID involved too, it's not just the ID of a subscription needed. My initial thoughts is just to look for user on params which will contain the ID, though I'm not sure if this is somewhat opinionated - thoughts? Or have there been any other ideas on how to make a subscriptions service?

An in-range update of stripe is breaking the build 🚨

Version 4.23.0 of stripe just got published.

Branch Build failing 🚨
Dependency stripe
Current Version 4.22.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 2 commits.

  • b204dc2 Bump version to 4.23.0
  • ee3e107 Add support for ephemeral keys (#347)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

this.stripe.customers.updateCard is not a function

We recently started running into the issue where certain methods on the Card service don't seem to exist anymore. I'm not sure if this is an issue with feathers-stripe or whether something has changed on the Stripe side.

Error:

error: TypeError: this.stripe.customers.updateCard is not a function
at Service.update (myProject/node_modules/feathers-stripe/lib/services/card.js:40:34)
at Service.patch (myProject/node_modules/feathers-stripe/lib/services/card.js:33:17)

Steps to Reproduce:

const StripeCardService = new Card({ secretKey });

await StripeCardService.patch(preExistingStripeCard.id, {
  address_city    : data.address_city,
  address_country : data.address_country,
  address_line1   : data.address_line1,
  address_state   : data.address_state,
  address_zip     : data.address_zip,
  email           : data.email,
  name            : data.name,
}, {customer: currentUser.id});

Versions:

feathers-stripe : "0.8.0"
stripe : "^7.5.2"
Node : "10.15.0"

This is the line of code in question.

Any help would be greatly appreciated. Thanks!

Add default pagination

Stripe returns 10 objects by default.
Stripe's max limit property is 100.

This library should support allowing the developer to use standard feathers pagination config.

Use params.stripe

We probably should not blindly pass params to stripe methods. Instead, we should use params.stripe similar to how other adapters use. For example, params.mongoose and params.sequelize.

Some methods do currently pass params to their underlying stripe methods. Those should be updated to pass params.stripe instead. Furthermore, those methods that do not currently pass params should be updated to do so. This is particularly helpful for the expand keyword. See: https://stripe.com/docs/api/expanding_objects?lang=node

An in-range update of stripe is breaking the build 🚨

The dependency stripe was updated from 8.14.0 to 8.15.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v8.15.0
  • #801 Multiple API changes
    • Add support for new type values for TaxId.
    • Add support for payment_intent_data[statement_descriptor_suffix] on Checkout Session.

See the changelog for more details.

Commits

The new version differs by 3 commits.

  • 925c135 Bump version to 8.15.0
  • e8867c4 Merge pull request #801 from stripe/remi/codegen-7562c6b
  • ff45942 Codegen for openapi 7562c6b

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add support for upcoming invoices

Keen to have this implemented, and very happy to make a PR for it myself, but just wanted to open this issue to discuss how it should be implemented.

My thoughts are having it as a query parameter and the find just checking and calling another method if it exists. e.g.

let query = {
  customer: 'customer-id',
  upcoming: true
};

app.service('invoice')
  .find({ query })
  .then(upcoming => {

  });

Thoughts?

EDIT: Sorry, just saw the line comment above .get and given it will always return a single object, makes more sense to be handled in get but how would this happen without an ID? Do you use a special dummy ID to indicate you want upcoming, or a query param that gets handled by find as suggested above?

An in-range update of stripe is breaking the build 🚨

The dependency stripe was updated from 6.13.0 to 6.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for stripe-node v6.14.0
  • #509 Add support for new Invoice methods

See the changelog for more details.

Commits

The new version differs by 5 commits.

  • ed076a2 Bump version to 6.14.0
  • bb0d7d5 Merge pull request #509 from stripe/remi-add-invoice-methods
  • e521c7a Add new methods for the Invoice resource
  • e82286e Merge pull request #516 from stripe/ob-514
  • 3e5d414 Fix stripeMethod documentation, remove required parameter

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add support for Stripe Connect

Not really sure what this entails from this side since it is just OAuth but we'll treat this as a placeholder issue to track progress and discuss.

An in-range update of feathers is breaking the build 🚨

Version 2.1.3 of feathers just got published.

Branch Build failing 🚨
Dependency feathers
Current Version 2.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As feathers is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 5 commits.

  • 4d8f09c 2.1.3
  • dbc101a Merge pull request #587 from cranesandcaff/fix-typings
  • b063d26 Feathers typigns
  • 73fd713 Added before and after to feathers service
  • 2214f6c chore(package): update feathers-socketio to version 2.0.0 (#576)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Use the Charge service remove method to refund a charge

I noticed that there is a kind of β€œhelper” method on the Transfer service that creates a TransferReversal when calling the remove method on that service, and that has been nice to use. When either a charge or a transfer are refunded/reversed, that refund/reversal info is available on the charge/transfer itself without having to explicitly lookup the actual refund or reversal. That makes it quite nice to deal with a charge/refund and a transfer/reversal within the same service.

An in-range update of mocha is breaking the build 🚨

Version 3.4.2 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes fake-success

3.4.2 / 2017-05-24

πŸ› Fixes

πŸ”© Other

Commits

The new version differs by 7 commits.

  • a15b20a :ship: Release v3.4.2
  • fc802a9 :memo: Add Changelog for v3.4.2
  • 10ff0ec Eagerly set process.exitCode (#2820)
  • fc35691 Merge pull request #2818 from makepanic/issue/2802
  • 3e7152f Remove call to deprecated os.tmpDir (#2802)
  • e249434 Merge pull request #2807 from mochajs/npm-script-lint
  • 17a1770 Move linting into an npm script. Relates to #2805

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error provided by Stripe needs to be included in error response

When creating a charge with invalid card details an error is returned, but it's a stripped back version of the error provided by Stripe.

I'm not sure it's all necessary but one useful piece of information is the error code (i.e "incorrect_zip" ) as this identifies what the error is rather than just a generic payment failure error. One thing this is helpful for is when you want to provide your own error messages, as currently they are in US english which doesn't always read correctly in the UK.

I could create a pull request but was a little unsure what the best approach would be. I was thinking maybe

new errors.PaymentError(error, {stripe_error: error);

so at least the original error is available to those that need it.

An in-range update of @feathersjs/feathers is breaking the build 🚨

The devDependency @feathersjs/feathers was updated from 4.3.10 to 4.3.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/feathers is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.3.11

4.3.11 (2019-11-11)

Bug Fixes

  • authentication: Retain object references in authenticate hook (#1675) (e1939be)
  • authentication-oauth: Allow hash based redirects (#1676) (ffe7cf3)
Commits

The new version differs by 7 commits.

  • 2d95bfd chore(release): publish v4.3.11
  • 079937c chore(package): Add npm funding field (#1678)
  • ffe7cf3 fix(authentication-oauth): Allow hash based redirects (#1676)
  • e1939be fix(authentication): Retain object references in authenticate hook (#1675)
  • 1ebc58e chore(package): update @types/config to version 0.0.36 (#1669)
  • 43c654c Add GitHub sponsorship
  • b0f5653 chore: Update version and changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of stripe is breaking the build 🚨

Version 4.22.1 of stripe just got published.

Branch Build failing 🚨
Dependency stripe
Current Version 4.22.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 11 commits.

  • ed2ef33 Bump version to 4.22.1
  • 5a6d26c Merge pull request #353 from buholzer/buholzer-hasOwn
  • 1979974 fixes #352 isOptionsHash - TypeError
  • 778a132 Merge pull request #351 from stripe/jlomas-stripe-hte-is-not-a-word
  • 52feba2 hte is not a word
  • e0a6c12 Merge pull request #348 from stripe/jlomas-better-signing-example
  • 8fa1843 Remove body-parser from the Express webhook signing example
  • e970e04 Merge pull request #344 from peterkhayes/master
  • d6272af Fix two small typos in Readme
  • 641a6d0 Merge pull request #326 from stripe/remi-remove-raw-pans
  • 7f9a1db Use the new test tokens instead of raw PANs

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of @feathersjs/express is breaking the build 🚨

The devDependency @feathersjs/express was updated from 4.3.10 to 4.3.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/express is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.3.11

4.3.11 (2019-11-11)

Bug Fixes

  • authentication: Retain object references in authenticate hook (#1675) (e1939be)
  • authentication-oauth: Allow hash based redirects (#1676) (ffe7cf3)
Commits

The new version differs by 7 commits.

  • 2d95bfd chore(release): publish v4.3.11
  • 079937c chore(package): Add npm funding field (#1678)
  • ffe7cf3 fix(authentication-oauth): Allow hash based redirects (#1676)
  • e1939be fix(authentication): Retain object references in authenticate hook (#1675)
  • 1ebc58e chore(package): update @types/config to version 0.0.36 (#1669)
  • 43c654c Add GitHub sponsorship
  • b0f5653 chore: Update version and changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of feathers is breaking the build 🚨

Version 2.1.4 of feathers just got published.

Branch Build failing 🚨
Dependency feathers
Current Version 2.1.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As feathers is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 6 commits.

  • a8d7723 2.1.4
  • 7a5024f Merge pull request #602 from Creiger/patch-1
  • 29f015d Return types needed
  • 54e1fef Merge pull request #590 from alaycock/patch-1
  • 2882e46 Revert update to security links
  • 60b1f33 Update security links

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of @feathersjs/socketio is breaking the build 🚨

The devDependency @feathersjs/socketio was updated from 4.3.10 to 4.3.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@feathersjs/socketio is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.3.11

4.3.11 (2019-11-11)

Bug Fixes

  • authentication: Retain object references in authenticate hook (#1675) (e1939be)
  • authentication-oauth: Allow hash based redirects (#1676) (ffe7cf3)
Commits

The new version differs by 7 commits.

  • 2d95bfd chore(release): publish v4.3.11
  • 079937c chore(package): Add npm funding field (#1678)
  • ffe7cf3 fix(authentication-oauth): Allow hash based redirects (#1676)
  • e1939be fix(authentication): Retain object references in authenticate hook (#1675)
  • 1ebc58e chore(package): update @types/config to version 0.0.36 (#1669)
  • 43c654c Add GitHub sponsorship
  • b0f5653 chore: Update version and changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Typical usage scenario

Hello,

I am not sure how to use theses feathersjs services.
I am fluent in feathersjs, but new to stripe, which doesn't help understanding how feathers-stripe removes the need of rewriting code.

From what I understand the strip services are made to be used internally, not from routes. How is it easier to use a service instead of calling directly the node-stripe module? I guess there is a reason, but can't see it from my level.

I tried to implement the process of an user subscribing for a monthly plan: https://stripe.com/docs/payments/checkout/subscriptions/starting

  1. Checkout: I did not found the Checkout service in feathers-stripe, so I created a custom service, with node-stripe used inside the class, to create the Session.
  2. After the payment: I wrote a custom after hook for user, that uses the Customer service to get the subscription status.

Is my implementation of the scenario correct? Or am I missing a feature of feathers-stripe?

Thank you!
Emmanuel

Can this be used?

The warning about use in production has been there for some time, just wondering if it's safe to use or if I should leave it for now.

An in-range update of stripe is breaking the build 🚨

The dependency stripe was updated from 6.32.0 to 6.33.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

stripe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for stripe-node v6.33.0
  • #609 Add generateWebhookHeaderString to make it easier to mock webhook events

See the changelog for more details.

Commits

The new version differs by 3 commits.

  • 077bf84 Bump version to 6.33.0
  • 1f90bce Merge pull request #609 from stripe/paulasjes/expose-webhook-header-generator
  • 1062f11 Exposing generateHeaderString

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.