Git Product home page Git Product logo

nestjs-stripe's People

Contributors

9renpoto avatar dependabot[bot] avatar dhaspden avatar dolphub avatar greenkeeper[bot] avatar iamjoeker avatar rachaeldawn 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nestjs-stripe's Issues

Setup Codecov and hook into CI workflow

The following should be accomplished related to code coverage reports:

  • Upload code coverage to Codecov when CI runs
  • Add the Codecov badge to the README header

Fix deprecation warning with new Stripe version

Features:

With merging #82 we have some new deprecation warnings to fix. Once those are fixed we can get ready for a version bump. Instead of calling setAppInfo we should just pass those values to the Stripe configuration like it is suggesting. The warning is shown below:

(node:17938) Stripe: `setAppInfo` is deprecated. Use the `appInfo` config option instead.

Iris <> Job Possibility

I am the founder of a VC-backed app called Iris, that allows you to connect your brokerage to enable you to share your trades with your friends and family.

Here is a quick product video: https://www.youtube.com/watch?v=kHtE-LMYxcg

We only hire super active engineers that have a history of contributing/creating prominent open source packages as these are some of the most talented people out there.

We have the creator of the GetX package for flutter(most like and used flutter package)
We just hired the lead AI/ML engineer from TikTok

We love what you have done to make it easier to integrate nestjs and stripe.

Our app currently has 50k users and we can see $5 billion of orders on our platform, we are growing fast and are looking to slowly add talented engineers.

You are probably not looking for a job right now however do you have 15 min to chat this week or next? if so here is a calendar link I would love to speak with you!

https://calendly.com/brian-iris

Thanks,
Brian Schardt

Support the new Stripe configuration object

Features:

The stripe-node library supports a configuration object now. We can rewrite a bit of our logic to support that configuration object and support some values that we don't support currently (such as host and port.)

Am I able to replace the API key based in realtime?

Question:

I am working with a client that takes payments for several different Stripe accounts and need to be able to direct the payment to different API keys based on the company the booking is being made for.

I am new to Nest so am not sure about overriding the API that is applied when my module loads.

How to Mock Stripe Client for Unit Tests

I'm trying to unit-test a service which is using the Stripe class. The setup is similarly as described in the README

@Injectable()
export class MyService {
  constructor(@InjectStripe() private readonly stripe: Stripe) {}

  createCheckout() {
    this.stripe.checkout.sessions.create({/** **/});
  }
}

In the unit test I provide a mock as known from other services.

beforeEach(async () => {
  const module: TestingModule = await Test.createTestingModule({
    providers: [MyService, { provide: Stripe, useClass: StripeMock }],
  }).compile();
});

The mock looks like this:

class Sessions {
  create(): void {
    return null;
  }
}

class Checkout {
  sessions: Sessions;

  constructor() {
    this.sessions = new Sessions();
  }
}

export class StripeMock {
  checkout: Checkout;

  constructor() {
    this.checkout = new Checkout();
  }
}

The problem is that NestJs dose not recognize the mock completely. It throws the given error:

    Nest can't resolve dependencies of the CheckoutService (?). Please make sure that the argument StripeToken at index [0] is available in the RootTestModule context.

    Potential solutions:
    - If StripeToken is a provider, is it part of the current RootTestModule?
    - If StripeToken is exported from a separate @Module, is that module imported within RootTestModule?

Are there some recommendations how to mock the Stripe instance in tests? It could be useful to add a short section to the documentation about testing/mocking, because it seems not straight forward as known from other NestJs services. Maybe it make sense to provide sth. like a StripeTestingModule within this package? If someone explains the problem to me I can get my hands dirty adding a related "Unit Testing/Mock" section to the docs.

Adding the module in async mode not working

Bug reports:

Facing issue while adding the module in Async mode

import { StripeModule } from 'nestjs-stripe';
import { ConfigModule, ConfigService } from '@nestjs/config';

imports:[
StripeModule.forRootAsync({
      useFactory: (configService: ConfigService) => ({
        apiKey:  configService.get('stripe_key'),
      }),
    }),]

Error coming
Type '(configService: ConfigService) => { apiKey: string; }' is not assignable to type '(...args: any[]) => StripeOptions | Promise<StripeOptions>'. Type '{ apiKey: string; }' is not assignable to type 'StripeOptions | Promise<StripeOptions>'. Property 'apiVersion' is missing in type '{ apiKey: string; }' but required in type 'StripeOptions'.

NEST JS v7

Getting error Argument of type '{ apiKey: string; apiVersion: string; }' is not assignable to parameter of type 'StripeOptions'. Object literal may only specify known properties, and 'apiVersion' does not exist in type 'StripeOptions'. apiVersion: '2020-08-27',

I am facing this error
Getting error Argument of type '{ apiKey: string; apiVersion: string; }' is not assignable to parameter of type 'StripeOptions'. Object literal may only specify known properties, and 'apiVersion' does not exist in type 'StripeOptions'. apiVersion: '2020-08-27',

and this is my auth module
`
import { StripeModule } from 'nestjs-stripe';

@module({
imports: [
StripeModule.forRoot({
apiKey: 'my_secret_key',
apiVersion: '2020-08-27',
}),
ThrottlerModule.forRoot({
ttl: 60 * 60 * 1000, // 1 minute
limit: 100,
}),
// LoggerModule.forRoot(),
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['config.env'],
}),
MongooseModule.forRootAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
uri: configService.get('DB_URI'),
}),
inject: [ConfigService],
}),
AuthModule,
UserModule,
TodoModule,
],
controllers: [],
providers: [
NotificationsGateway,
{
provide: APP_GUARD,
useClass: ThrottlerGuard,
},
],
})
`

package not able to install having conflict with @nestjs/[email protected]

I am trying to install this package but it giving me this error:

image

Package.json file

"dependencies": {
   "@golevelup/nestjs-stripe": "^0.2.2",
   "@nestjs-modules/mailer": "^1.6.0",
   "@nestjs/common": "^7.0.0",
   "@nestjs/config": "^0.6.1",
   "@nestjs/core": "^7.0.0",
   "@nestjs/event-emitter": "^1.0.0",
   "@nestjs/jwt": "^7.2.0",
   "@nestjs/mapped-types": "^1.0.0",
   "@nestjs/mongoose": "^7.1.0",
   "@nestjs/passport": "^7.1.6",
   "@nestjs/platform-express": "^7.0.0",
   "@nestjs/platform-socket.io": "^8.2.0",
   "@nestjs/swagger": "^4.1.0",
   "@nestjs/websockets": "^8.2.0",
   "@types/bcrypt": "^3.0.0",
   "@types/mongoose-paginate-v2": "^1.3.8",
   "@types/passport-facebook": "^2.1.11",
   "aws-sdk": "^2.797.0",
   "bcrypt": "^5.0.0",
   "class-transformer": "^0.3.1",
   "class-validator": "^0.12.2",
   "googleapis": "^89.0.0",
   "handlebars": "^4.7.7",
   "hbs": "^4.1.2",
   "lodash": "^4.17.20",
   "messagebird": "^3.7.1",
   "moment": "^2.29.1",
   "mongoose": "^5.10.15",
   "mongoose-paginate-v2": "^1.3.11",
   "nodemailer": "^6.7.0",
   "passport": "^0.4.1",
   "passport-facebook": "^3.0.0",
   "passport-facebook-token": "^4.0.0",
   "passport-google-oauth20": "^2.0.0",
   "passport-jwt": "^4.0.0",
   "passport-local": "^1.0.0",
   "reflect-metadata": "^0.1.13",
   "request-context": "^2.0.0",
   "rimraf": "^3.0.2",
   "rxjs": "^6.5.4",
   "string-format": "^2.0.0",
   "string-format-ts": "^1.0.4",
   "stripe": "^8.194.0",
   "swagger-ui-express": "^4.1.6",
   "uniqid": "^5.4.0",
   "uuid": "^8.3.2"
 },

Looking for help, thank you.

Add support for extra options on the Stripe client

We should add some extra options for users that want more control over their Stripe client without having to modify it manually.

  • Enable / disable request telemetry
  • Max network retries
  • Using a proxy
  • Request timeout

New Stripe typescript definition complains about `httpProxy`

Bug reports:

There is an issue with the httpProxy option for the getStripeClient function. I'm going to have to make the appropriate changes when the dependencies are updated. That is the reason the Greenkeeper pull request builds are failing.

Support the httpProxy option properly by pulling in the required dependency (maybe as an optional dependency?) and hooking it up with stripe properly.

Remove default API version for Stripe

Bug reports:

Not sure it's 100% a bug but I think it would be best if we just left the API version default as null because the Stripe library handles that by just choosing the default for you (latest version I think.) If someone wants to pin an API version they can do that themselves.

Once this is done we should pin a new version.

What (if any) extra functionality does everybody think would benefit this library?

Request For Feedback

Hi anybody who is reading this! Now that a few people have started to use this library I wanted to take the chance to reach out to you all. This library fulfills what it set out to do but I'd like to extend the question anyway โ€” is there something that this library does not currently do that would be nice to have?

I toyed with the idea of webhook listeners but not sure it's worth the time investment if nobody would actually use it.

Alternatively just thumbs up this message if you think that this library is good as-is and only needs maintenance. I'll leave this up for a little bit to see if I get any responses ๐Ÿ˜ƒ.

Thanks for using this library, it means a lot!

Add plugin documentation to the Stripe client

Stripe requests that we add plugin documentation to the client when we create it. We should add some basic information about our library to it.

{
  "name": "nestjs-stripe",
  "version": "0.1.0",
  "url": "http://github.com/dhaspden/nestjs-stripe"
}

Update Readme to include stripe type in example

Bug reports:

Please replace this line with a brief summary of your issue.

Features:

Please note by far the quickest way to get a new feature is to file a Pull
Request.

We will consider your request but it may be closed if it's something we're not
actively planning to work on.

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.