Skip to content

Commit

Permalink
fix(Stripe): require instead of import package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Aspden committed Jul 5, 2019
1 parent 3f7fa5c commit 39097fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestjs-stripe",
"version": "0.1.1",
"version": "0.1.2",
"description": "Provides an injectable Stripe client to nestjs modules",
"repository": "https://github.com/dhaspden/nestjs-stripe",
"author": {
Expand Down
9 changes: 5 additions & 4 deletions src/util/getStripeClient.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import * as ProxyAgent from 'https-proxy-agent';
import * as Stripe from 'stripe';

import { name, repository, version } from './../../package.json';
import { StripeOptions } from './../interfaces';

const packageJson = require('./../../package.json');

export function getStripeClient(options: StripeOptions): Stripe {
const stripeClient = new Stripe(options.apiKey, options.version);

// TODO: update this when @types/stripe adds `setAppInfo`
(stripeClient as any).setAppInfo({
name,
url: repository,
version,
name: packageJson.name,
url: packageJson.repository,
version: packageJson.version,
});

if (typeof options.httpProxy === 'string') {
Expand Down

0 comments on commit 39097fa

Please sign in to comment.