Skip to content

Commit

Permalink
upgraded packages to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
tima101 committed Mar 25, 2019
1 parent 26a41ec commit 36e948a
Show file tree
Hide file tree
Showing 6 changed files with 3,496 additions and 3,614 deletions.
59 changes: 29 additions & 30 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,43 @@
"coverageDirectory": "./.coverage"
},
"dependencies": {
"@passport-next/passport-google-oauth2": "^1.0.0",
"@types/mongoose": "5.2.19",
"@types/node": "10.11.7",
"aws-sdk": "2.333.0",
"compression": "1.7.3",
"connect-mongo": "2.0.0",
"cors": "2.8.4",
"dotenv": "6.1.0",
"@types/mongoose": "5.3.23",
"@types/node": "11.11.6",
"aws-sdk": "2.428.0",
"compression": "1.7.4",
"connect-mongo": "2.0.3",
"cors": "2.8.5",
"dotenv": "7.0.0",
"express": "4.16.4",
"express-session": "1.15.6",
"front-matter": "3.0.0",
"googleapis": "34.0.0",
"handlebars": "4.0.12",
"front-matter": "3.0.1",
"googleapis": "38.0.0",
"handlebars": "4.1.1",
"he": "1.2.0",
"helmet": "3.14.0",
"highlight.js": "9.12.0",
"helmet": "3.16.0",
"highlight.js": "9.15.6",
"isomorphic-unfetch": "3.0.0",
"lodash": "4.17.11",
"marked": "0.5.1",
"mongoose": "5.3.3",
"marked": "0.6.1",
"mongoose": "5.4.19",
"passport": "0.4.0",
"passport-google-oauth": "1.0.0",
"qs": "6.5.2",
"passport-google-oauth": "2.0.0",
"qs": "6.7.0",
"request": "2.88.0",
"stripe": "6.12.1",
"typescript": "3.1.3",
"winston": "3.1.0"
"stripe": "6.28.0",
"typescript": "3.3.4000",
"winston": "3.2.1"
},
"devDependencies": {
"@types/express": "4.16.0",
"@types/handlebars": "4.0.39",
"@types/lodash": "4.14.117",
"@types/passport": "0.4.6",
"@types/stripe": "6.0.1",
"husky": "1.1.2",
"jest": "23.6.0",
"nodemon": "1.18.4",
"ts-node": "7.0.1",
"tslint": "5.11.0"
"@types/express": "4.16.1",
"@types/handlebars": "4.1.0",
"@types/lodash": "4.14.123",
"@types/passport": "1.0.0",
"@types/stripe": "6.25.6",
"husky": "1.3.1",
"jest": "24.5.0",
"nodemon": "1.18.10",
"ts-node": "8.0.3",
"tslint": "5.14.0"
}
}
2 changes: 0 additions & 2 deletions api/server/google.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { Strategy as GoogleStrategy } from '@passport-next/passport-google-oauth2';
import * as passport from 'passport';
import { OAuth2Strategy as Strategy } from 'passport-google-oauth';

Expand Down Expand Up @@ -48,7 +47,6 @@ export default function auth({ ROOT_URL, server }) {
clientID,
clientSecret,
callbackURL: `${ROOT_URL}/oauth2callback`,
userProfileURL: 'https://www.googleapis.com/oauth2/v3/userinfo',
},
verify,
),
Expand Down
18 changes: 10 additions & 8 deletions api/server/stripe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as bodyParser from 'body-parser';
import * as stripe from 'stripe';
import logger from './logs';
import Team from './models/Team';
// import Team from './models/Team';

const dev = process.env.NODE_ENV !== 'production';

Expand Down Expand Up @@ -60,7 +60,7 @@ function updateCustomer({ customerId, newCardId }) {
}

function verifyWebHook(request) {
const event = stripeInstance.webhooks.constructEvent<any>(
const event = stripeInstance.webhooks.constructEvent(
request.body,
request.headers['stripe-signature'],
ENDPOINT_SECRET,
Expand All @@ -75,12 +75,14 @@ function stripeWebHooks({ server }) {
async (req, res, next) => {
try {
const event = await verifyWebHook(req);
logger.info(event.id);
const { subscription } = event.data.object;
logger.info(JSON.stringify(subscription));
await Team.cancelSubscriptionAfterFailedPayment({
subscriptionId: JSON.stringify(subscription),
});
logger.info(event);
logger.info(event.data);
logger.info(event.data.object);
// const { subscription } = event.data.object;
// logger.info(JSON.stringify(subscription));
// await Team.cancelSubscriptionAfterFailedPayment({
// subscriptionId: JSON.stringify(subscription),
// });

res.sendStatus(200);
} catch (err) {
Expand Down
Loading

0 comments on commit 36e948a

Please sign in to comment.